Posts Tagged ‘reading’

How to disable nginx static requests access.log logging

Monday, March 5th, 2012

NGINX logo Static Content Serving Stop logging

One of the companies, where I'm employed runs nginx as a CDN (Content Delivery Network) server.
Actually nginx, today has become like a standard for delivering tremendous amounts of static content to clients.
The nginx, server load has recently increased with the number of requests, we have much more site visitors now.
Just recently I've noticed the log files are growing to enormous sizes and in reality this log files are not used at all.
As I've used disabling of web server logging as a way to improve Apache server performance in past time, I thought of implying the same little "trick" to improve the hardware utilization on the nginx server as well.

To disable logging, I proceeded and edit the /usr/local/nginx/conf/nginx.conf file, commenting inside every occurance of:

access_log /usr/local/nginx/logs/access.log main;

to

#access_log /usr/local/nginx/logs/access.log main;

Next, to load the new nginx.conf settings I did a restart:

nginx:~# killall -9 nginx; sleep 1; /etc/init.d/nginx start

I expected, this should be enough to disable completely access.log, browser request logins. Unfortunately /usr/local/nginx/logs/access.log was still displaying growing with:

nginx:~# tail -f /usr/local/nginx/logs/access.log

After a bit thorough reading of nginx.conf config rules, I've noticed there is a config directive:

access_log off;

Therefore to succesfully disable logging I had to edit config occurance of:

access_log /usr/local/nginx/logs/access.log main

to

After a bit thorough reading of nginx.conf config rules, I've noticed there is a config directive:

access_log off;

Therefore to succesfully disable logging I had to edit config occurance of:

access_log /usr/local/nginx/logs/access.log main

to

access_log /usr/local/nginx/logs/access.log main
access_log off;

Finally to load the new settings, which thanksfully this time worked, I did nginx restart:

nginx:~# killall -9 nginx; sleep 1; /etc/init.d/nginx start

And hooray! Thanks God, now nginx logging is disabled!

As a result, as expected the load avarage on the server reduced a bit 🙂

How to add extra plugins, effects, brushes and functionality to GIMP on GNU / Linux

Tuesday, February 28th, 2012

How to add extra plugins, effects brushes and functionality to GIMP on Debian and Ubuntu Linux / GIMP logo head pictureThese days, I'm playing with The GIMP. I've been a GNU / Linux, FreeBSD user for already 11 years now but as I'm doing mostly system administration and I don't have much expertise in Panting or Computer Graphical Design, I've never put much time to learn more in the interesting area of graphical design. Hence until just recently, Just until now, I've never spend time with the GIMP (GNU Image Manipulation Program) and never realized how powerful this great program is. The more I learn about GIMP functionalities and how it works the more it makes me determined to learn some basic web design 🙂

The functionality which The GIMP offers in a basic install is quite rich, however by default on most Debian and Ubuntu installations many of the great plugins which easifies the way to edit pictures is missing.

Example for a very valuable functionality which is not present with standard gimp package installed on Debian and Ubuntu are:
 

Here I will mention here few words on:

  • GIMP FX-Foundry Collection

GIMP FX-Foundry is a thoroughful collection of GIMP scripts (addon plugins), that automates many of the operations which requires a professional web design skills and gives an easy intuitive interface through which very robust "high level" graphic design can be accomplished. This additional GIMP extensions helps to create very unique design in just few simple steps, as well as gives multiple tools for the sake of easy pro design creation. For anyone looking for quick edit of images with GIMP FX-Foundry is a must have GIMP plugins extension. The script pack is located on http://gimpfx-foundry.sourceforge.net/

To install FX-Foundry scripts collection on Debian / Ubuntu / Linux Mint and other based Linux distributions:

debian:~# apt-get install --yes gimp-plugin-registry
...

gimp-plugin-registry package name is based on GIMP Plugin registry's website
. Gimp plugin registry contains many helpful design goodies 🙂

Once installed you will notice GIMP with a new menu on the main menus bar reading FX-Foundry :

GIMP Screenshot GNU Linux Debian additional FX Foundry menu

GIMP FX Foundry extensionos package contains 124 scripts for additional graphics manipulation. The collection contains less scripts than the ones provided by gimp-plugin-registry. package has 156 scripts inside.

One of the most helpful GIMP addition from the package is the inclusion of Save for Web button under:

File -> Save for Web

GIMP Save for Web menu suitable for reduced size images for HTML image producing on Debian GNU / Linux screenshot

Another very helpful .deb package which adds up to GIMP's design possibilities is gimp-data-extras .

gimp-data-extras adds 111 new GIMP Fill in Patterns , which can be used through the Blend Tool to Fill selected areas with color gradients.

To install gimp-data-extras on Debian:

debian:~# apt-get install --yes gimp-data-extras
...

Generally once installed this package will add to GIMP – an extra set of brushes, palettes, and gradients for The GIMP as you can read in the package description.

I was also quite stunned to find out the good old GIMP is capable of basic Video editting!!

On Debian and Ubuntu there is a package called gimp-gap which once installed adds an extra Video menu.

GIMP Screenshot GNU Debian linux adding GIMP extra Video editting capabilities

I've not tested the GIMP video editting capabilities yet, however I intend to learn something about it immediately when I have some free time left. You see the enormous list of Video editting possibilities GIMP obtaines with gimp-gap which btw stands for (The GIMP Animation Package).

To install gimp-gap:

debian:~# apt-get install --yes gimp-gap

I've noticed also the following list of others useful GIMP additions (mainly helpful in Web, Brochure and Logo Graphic Design) to install them:

debian:~# apt-get --yes install gimp-gmic gimp-ufraw gtkam-gimp gimp-gluas \gimp-dimage-color gimp-dds gimp-dcraw gimp-cbmplugs flegita-gimp gimp-texturize \gimp-resynthesizer gimp-lensfun gimp-gutenprint gtkam-gimp mrwtoppm-gimp

Here is the package description of the packages above command will install:

  • gimp-cbmplugs – plugins for The GIMP to import/export Commodore 64 files
  • gimp-data-extras – An extra set of brushes, palettes, and gradients for The GIMP
  • gimp-dcraw – GIMP plug-in for loading RAW digital photos
  • gimp-dds – DDS (DirectDraw Surface) plugin for the gimp
  • gimp-dimage-color – GIMP plugin to convert Minolta DiMAGE pictures to sRGB colour space
  • gimp-gap – The GIMP Animation Package
  • gimp-gluas – Lua environment plug-in for GIMP
  • gimp-gmic – GIMP plugin for GREYC's Magic Image Converter
  • gimp-gutenprint – print plugin for the GIMP
  • gimp-lensfun – Gimp plugin to correct lens distortion using the lensfun library
  • gimp-normalmap – Normal map plugin for GIMP
  • gimp-plugin-registry – repository of optional extensions for GIMP
  • gimp-resynthesizer – Gimp plugin for texture synthesis
  • gimp-texturize – generates large textures from a small sample
  • gimp-ufraw – gimp importer for raw camera images
  • flegita-gimp – Gnome Gimp scan plugin.
  • gtkam-gimp – gtkam gimp plugin to open digital camera pictures
  • mrwtoppm-gimp – GIMP-plugin to support Minolta DiMAGE 5/7/7i RAW images

Now after installing all this plugins and seeing all GIMP's power, I'm starting to wonder why are still people ranting Adobe PhotoShop is feature rich.
That's all, enjoy the great new GIMP features. Happy picture editting 😉

How to fix clock on Slackware / Slackware and this old incorrect BIOS time troubles

Friday, February 24th, 2012

There two main reasons which cause incorrect clock settings on Slackware Linux.
One common reason for incorrectly set time is improper clock and timezone settings during Slackware install.

On install, one of the ncruses install menus asks an ambigious dialog question reading

HARDWARE CLOCK SET TO UTC?
Is the hardware clock set to Coordinated Universal Time (UTC/GMT)?

Some newbie Slackware users make the mistake to choose YES here, resulting in incorrectly set clock.

Second possibility for improper time is incorrect time on BIOS level. This is not so common among laptop and modern desktop PCs. However in the past impoper system BIOS hardware clock was usual.
In any case it is a good practice to check the system PC BIOS clock settings.

To check BIOS battery hardware clock from command line use:

bash-4.1# hwclock --show
Fri 24 Feb 2012 01:24:18 AM EET -0.469279 seconds

The system clock on Slackware is set via a script called timeconfig. To fix slack's incorrect host time run:

bash-4.1# timeconfig

Slackware Linux timeconfig set to UTC ncurses dialog clock setting

Slackware Linux timeConfig Country Selection dialog

Running timeconfig once should configure a proper timezone to be set on next system reboot, however the system time will probably still be not ok.
To manually set time to right time, use date command. To set manually the system wide time to 12:00:00 with date:

bash-4.1# date -s "12:00:00"

Anyways for time accuracy the ntpdate should be used to feth time from NTP internet time server:

bash-4.1# ntpdate time.nist.gov
...

Finally to make the new set right time permanent also for the BIOS battery clock issue:

bash-4.1# hwclock --systohc

By the way its curious fact Slackware Linux is the oldest still existent GNU / Linux based distribution. Its up and running since the very day GNU and Linux came to merge at one Free OS 😉

BSD (Berkley Software Distribituion) use by distribution type (FreeBSD, NetBSD, OpenBSD, DrangflyBSD) use percantage charts

Saturday, February 18th, 2012

I've hit an interesting article in Wikipedia called Comparison of BSD operating systems
The article explains basic difference between different BSD (Berkley Software Distributions) and what is the primary accent of each of the BSD (free software OS) distributions. It also reveals basic details about the history and how each of the BSD's came to existence. I recommend to anyone interested in free software as it is just a great reading for everybody interested in FOSS.

The most interesting part of the wiki thread is a bar chart, provided by BSD Certification Group research conducted in September 2005.

FreeBSD, OpenBSD, NetBSD, Dragonflybsd usage statistics

The above diagram is showing the proportion of users of each BSD variant from the BSD usage survey prior conducted

The research is already 6 years old, and unfortunately as of time of writting seems to be the only publicly available. Though being outdated, I believe generally the bar charts distributions along different BSD variants would be mostly true. The only big difference will be probably in PC-BSD which is not even on the diagram should have outbeaten DragonflyBSD's use. Since there is no public data available for 2012 and the years 2005 – 2012 for the use percantage of each of the BSD distributions, I've thought about a pseudo way to get some general statistics on each of the BSD distributions popularity. The methodology to gather the required statistics comes to simply, type in Google each of the BSD variant "code names" (e.g. freebsd, netbsd, openbsd etc.) and look at the number of results returned. It seems logical the more results distribution keyword searched returns, the bigger the probability of more users to be involved in developing or using the respective BSD variant.

Below you see the results, I've gathered in my quick "google research":

FreeBSD NetBSD OpenBSD BSD variant (users) use diagram based on Google searches of keywords 2012

As you can see in the above data FreeBSD is still probably leading the BSD use, the public interest to OpenBSD – BSD focused on security has significantly grow since the last 6 years. Next it is seen the PC-BSD users base has probably tremendously increased and according to the Google results returned it is probably on a 3rd place by users interest (use?) followed by NetBSD with only 1.47% of all the BSD users. Lastly with only 0.99%, orders Dragonfly BSD which no longer is so popular as a Desktop BSD based OS as it used to be back in 2005.
Again the presented diagram results are based on only on the factor of Google BSD variant popularity and hence shouldn't be consired too trustworthy, still I'm sure it gives a general idea on how used is each of the BSD variants as of Jan 2012.

How to change default Comments and No Comments location in WordPress in wordpress default theme

Tuesday, April 5th, 2011

For a number of time I’ve been planning to change my blog comments placement. Until this very day however I’ve kept the default wordpress theme’s Comments button placement.

I realize the default Comments button placement is a bit hard to see and not that much intuitive for the user that enters my blog for a first time.

My first guess was that there might be somewhere a wordpress plugin which will allow me to adjust my comments button placement.
After some research online and a realization that probably there is no such plugin existing yet. I’ve forced myself to tune it up myself.

It was clear to me that in order to change the it will be necessery to edit the WordPress templates files. I’m not a designer and when I hear about templates I usually get scared, however I took the time to take a look at the default wordpress template and find out actually that template modifications is actually rather easier than I thought.

My previous idea was that in order to edit templates you have to be some kind of CSS and HTML guru (which I’m not). Nevertheless it seems that in order to play and adjust in a good way the templates you don’t need ot be a pro.
Even an uneducated fool like myself can easily do almost everything he thinks of throughout few lines of code in the wp templates.

To get back to the major topic thanks God after a bit of review and reading of wordpress.org documentation and some user forums. I’ve figured out that in order to change my Comments placement you need to modify the file:
 

  • blog/wp-content/themes/default/index.php

In index.php find the line starting with:

You will notice within this opened paragraph the php code:

<?php the_tags('Tags: ', ', ', '
'); ?> Posted in <?php the_category(', ') ?>
| <?php edit_post_link('Edit', '', ' | '); ?>
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

This is the actual default theme php code that makes the wordpress Comments or No Comments that maes the comments appear on the blog.

Now I’ve decided to let this be as it is but add one more Comment button to wordpress on a different location that is more appealing to my blog visitors

After quick evaluation I’ve determined that probably the best location that the Comments button should have is right after the end of the post text

If you think my idea for button placement is appropriate, to set this location for the Comments button, you will have to find the follwoing code in index.php:

<div class="entry">
<?php the_content('Read the rest of this entry »'); ?>
</div>

Right after the end of this code place the following code:

<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
</div>

W3 total Cache a nice wordpress “all in one” wordpress Caching plugin

Friday, September 23rd, 2011

w3 total cache logo wordpress speed up w3tc

In my recent question of looking for best ways to optimize my wordpress blog, as well as other wordpress based websites, I’m managing I’ve come across a great plugin called W3 Total Cache or W3TC as it’s widely known among wordpress geeks.

The full caching wordpress solution in face of W3TC is already actively deployed among many major wordpress powered websites, to name a few:
stevesouders.com, mattcutts.com, mashable.com

I gave a try W3 Total Cache and was amazed about the rich caching functionality it provides. Having the W3TC plugin installed adds a whole menu on the left wordpress admin panel reading Performance , clicking on it shows a menu with thorough choices on numerous things which deal with the running of wordpress on the server.
Here is a screenshot on the menus W3 Total Cache provides:

w3 total cache whole wordpress caching pages and sql solution

The plugin has support for html caching, sql caching, CDN, CSS and Javascript compress & minify etc.
To test the plugin adequately I disabled HyperCache and Db Cache . My observations is that with W3TC wordpress renders php and the overall user experience and download times in wordpress are better. Therefore I’ll probably use only W3 Total Cache as a cacher for wordpress installs.
Besides that I had some issues on some wordpress based websites with the Db Cache SQL caching.
On these websites after enabling Db Cache, suddenly page edditing of the created existing pages started returning empty pages. This could be due to the fact that these wordpress based websites was customly tailered and many code was wiped out, however it could also be a Db Cache bug. So to conclude W3TC is the perfect solution for wordpress caching 😉

Fix of “Unable to allocate memory for pool.” PHP error messages

Saturday, October 15th, 2011

Since some time, I don’t know exactly where, after some updates of my WordPress running on a small server with FreeBSD 7.2. I’ve started getting a lot of Apache crashes. Often the wordpress scripts stopped working completely and I got only empty pages when trying to process the wordpress blog in a browser.

After a bunch of reading online, I’ve figured out that the cause might be PHP APC stands for Alternative PHP Cache .

I was not sure if the PHP running on the server had an APC configured at all so I used a phpinfo(); script to figure out if I had it loaded. I saw the APC among the loaded to show off in the list of loaded php modules, so this further led me to the idea the APC could be really causing the unexpected troubles.

Thus first I decided to disable the APC on a Virtualhost level for the domain where the crashing wordpress was hosted, to do I placed in the VirtualHost section in the Apache configuration /usr/local/etc/apache2/httpd.conf the following config directive:

php_flag apc.cache_by_default Off

These get me rid of the multiple errors:

PHP Warning: require_once() [function.require-once]: Unable to allocate memory for pool. in /usr/local/www/data-dist/blog/wp-content/plugins/tweet-old-post/top-admin.php on line 6

which constantly were re-occuring in php_error.log:

Further after evaluating all the websites hosted on the server and making sure none of which was really depending on APC , I’ve disabled the APC completely for PHP. To do so I issued:

echo 'apc.enabled = 0' >> /usr/local/etc/php.ini

Similarly on GNU/Linux to disable globally APC from PHP only the correct location to php.ini should be provided on Debian this is /etc/php5/apache2/php.ini .

How to fix “sslserver: fatal: unable to load certificate” Qmail error on GNU / Linux

Friday, October 14th, 2011

After setupping a brand new Qmail installation following the QmailRocks Thibs Qmail Debian install guide , I’ve come across unexpected re-occuring error message in /var/log/qmail/qmail-smtpdssl/ , here is the message:

@400000004e9807b10d8bdb7c command-line: exec sslserver -e -vR -l my-mailserver-domain.com -c 30 -u 89 -g 89
-x /etc/tcp.smtp.cdb 0 465 rblsmtpd -r zen.spamhaus.org -r dnsbl.njabl.org -r dnsbl.sorbs.net -r bl.spamcop.net qmail-smtpd
my-mailserver-domain.com /home/vpopmail/bin/vchkpw /bin/true 2>&1
@400000004e9807b10dae2ca4 sslserver: fatal: unable to load certificate

I was completely puzzled initially by the error as the sertificate file /var/qmail/control/servercert.pem was an existing and properly self generated one. Besides that qmail daemontools init script /service/qmail-smtpd/run was loading the file just fine, where the same file failed to get loaded when sslserver command with the cert argument was invoked via /service/qmail-smtpdssl/run

It took me quite a while to thoroughfully investigate on what’s wrong with the new qmail install. Thanksfully after almost an hour of puzzling I found it out and I was feeling as a complete moron to find that the all issues was caused by incorrect permissions of the /var/qmail/control/servercert.pem file.
Here are the incorrect permissions the file possessed:

linux:~# ls -al /var/qmail/control/servercert.pem
-rw------- 1 qmaild qmail 2311 2011-10-12 13:21 /var/qmail/control/servercert.pem

To fix up the error I had to allow all users to have reading permissions over servercert.pem , e.g.:

linux:~# chmod a+r /var/qmail/control/servercert.pem

After adding all users readable bit on servercert.pem the file permissions are like so:

linux:~# ls -al /var/qmail/control/servercert.pem
-rw-r--r-- 1 qmaild qmail 2311 2011-10-12 13:21 /var/qmail/control/servercert.pem

Consequently I did a qmail restart to make sure the new readable servercert.pem will get loaded from the respective init script:

linux:~# qmailctl restart
* Stopping qmail-smtpdssl.
* Stopping qmail-smtpd.
* Sending qmail-send SIGTERM and restarting.
* Restarting qmail-smtpd.
* Restarting qmail-smtpdssl.

Now the annoying sslserver: fatal: unable to load certificate message is no more and all works fine, Hooray! 😉

Theophany (Jesus’s baptizm in Jordan) feast in Bulgarian Orthodox Church on 6th of January

Saturday, January 7th, 2012

Baptism of Christ Theophany Old Orthodox icon

On 6th of January in our Bulgarian Orthodox Church just like in the most Christian realm, we celebrate the great feast of Theophany / Epiphany (Baptizm of our Saviour Jesus Christ in Jordan).

What exactly we celebrate is the Baptizm of our Saviour Jesus Christ in Jordan by st. John the Baptist (John the Forerunner as we call him in the church). This day is very important for us as Christians and this is why the holy fathers in the church has ordered this feast to be among the 12 most important feasts in our Church, the so called (Lords feasts).

On Theophany's day it is a rule in orthodox Church that the Great Blessing of Water is performed. The Blessing of the water and the preceding holy water from the priests blessing is taken by Church layman and we bring a little of this water to our homes to bless through that our homes.

In our Church belief the Holy Water from the Theophany feast is considered the most powerful in spiritual sense holy water as this water is the same water with which our sinless Saviour and lamb (Son) of God Jesus Christ was baptized in Jordan.

The reason why we call the feast Theophany is because God in his essence of Holy Trinity appeared clearly to mankind for a first time in Human history. Our Holy Trinity (3 essence God in one indistructable and insaparatable God – one God as God said for himself in the beginning of writtings) has revealed himself in front of all the people gathered along John the Baptist in Jordan waiting to be baptized in his three essences:

1. God the Father spoke from heaven manifesting and testifying about Jesus Christ being his beloved and only son and saviour of mankdin
,br />2. God the Son (Jesus Christ), has physically appeared to receive the baptizm to fulfill all righteousness and (the old testemential prophecies) and to begin his 3 years mission on earth.

3. God Holy Spirit) has descended from heaven on Jesus Christ in a publicly observable form of a dove

Theophany's feast is called by some english speaking orthodox christians Epiphany, but this is a term less used in orthodox christendom and much more spread in Roman Catholic one.

The Gospel readings in the church tell of the Lord's baptism by John in the Jordan River. The epistle reading of the Divine Liturgy tells of the consequences of the Lord's appearing which is the divine epiphany.

After the end of the st. Basil the Great Holy Liturgy served, the Great Blessing of Water is performed by one or more priests (depending on the number of present priests). The meaning of the blessing of the waters meaning is to show that mankind and all of God's creation, were created to be blessed and filled with the sanctifying of God's presence.

A very local unique bulgarian tradition on this number is that if the great blessings of water is performed by a priest near a river or a sea shore the cross be thrown in the water in order to bless the waters. Pulling out the holy cross from the Sea Bulgarian local Tradition on Theophany feast

Then a number of brave man jump in and do a race swimming aiming to pull out the crucifixion of the water. It is believed that the one who could pull out the cross will get God's great blessings through the upcoming church year.A person who pulled out the cross on Theophany Bulgarian tradition

Let us pray trust and hope on God to also appear to us who seek him, and show us his Holy Trinity wholeness mercies just like he did himself to the people waiting for Baptizm from John the Baptist by the holy prayes of the Theotokos and his holy saints and all heavinly hosts. Amen