September 2011 Archives

Fri Sep 30 19:51:24 EEST 2011

How to find out all programs bandwidth use with (nethogs) top like utility on Linux

Just run across across a super nice top like, program for system administrators, its called nethogs and is definitely entering my "l337" admin outfit next to tools like iftop, nettop, ettercap, darkstat htop, iotop etc.

nethogs is ultra easy to use, to get immediately in console statistics about running processes UPLOAD and DOWNLOAD bandwidth consumption just run it:

linux:~# nethogs


Nethogs screenshot on Linux Server with Nginx
Nethogs running on Debian GNU/Linux serving static web content with Nginx

If you need to check what program is using what amount of network bandwidth, you will definitely love this tool. Having information of bandwidth consumption is also viewable partially with iftop, however iftop is unable to track the bandwidth consumption to each process using the network thus it seems nethogs is unique at what it does.

Nethogs supports IPv4 and IPv6 as well as supports network traffic over ppp. The tool is available via package repositories for Debian GNU/Lenny 5 and Debian Squeeze 6.

To install Nethogs on CentOS and Fedora distributions, you will have to install it from source. On CentOS 5.7, latest nethogs which as of time of writting this article is 0.8.0 compiles and installs fine with make && make install commands.

In the manner of thoughts of network bandwidth monitoring, another very handy tool to add extra understanding on what kind of traffic is crossing over a Linux server is jnettop
jnettop's shows which hosts/ports is taking up the most network traffic.
It is available for install via apt in Debian 5/6).

Here is a screenshot on jnettop in action:

Jnettop check network traffic in console

To install jnettop on latest Fedoras / CentOS / Slackware Linux it has to be download and compiled from source via jnettop's official wiki page
I've tested jnettop install from source on CentOS release 5.7 and it seems to compile just fine using the usual compile commands:

[root@prizebg jnettop-0.13.0]# ./configure
...
[root@prizebg jnettop-0.13.0]# make
...
[root@prizebg jnettop-0.13.0]# make install


If you need to have an idea on the network traffic passing by your Linux server distringuished by tcp/udp/icmp network protocols and services like ssh / ftp / apache, then you will definitely want to take a look at nettop (if of course not familiar with it yet).
Nettop is not provided as a deb package in Debian and Ubuntu, where it is included as rpm for CentOS and presumably Fedora?
Here is a screenshot on nettop network utility in action:

Nettop server traffic division by protocol screenshot
FreeBSD users should be happy to find out that jnettop and nettop are part from the ports tree and can be installed straight from ports, however nethogs would not work on FreeBSD, I searched for a utility capable of what Nethogs can, but couldn't find such.
It seems the only way on FreeBSD to track bandwidth back and from originating process is using a combination of iftop and sockstat utilities. Probably there are other tools which people use to track network traffic to the processes running on a host, if anyone knows of some good tools, please share it with me ;)

Posted by hip0 | Permanent link

Fri Sep 30 13:32:29 EEST 2011

How to convert any internet Webpage to PDF from command line on GNU/Linux

If you're looking for a command line utility to generate PDF file out of any webpage located online you are looking for Wkhtmltopdf
The conversion of webpages to PDF by the tool is done using Apple's Webkit open source render.
wkhtmltopdf is something very useful for web developers, as some webpages has a requirement to produce dynamically pdfs from a remote website locations.
wkhtmltopdf is shipped with Debian Squeeze 6 and latest Ubuntu Linux versions and still not entered in Fedora and CentOS repositories.

To use wkhtmltopdf on Debian / Ubuntu distros install it via apt;

linux:~# apt-get install wkhtmltodpf
...


Next to convert a webpage of choice use cmd:

linux:~$ wkhtmltopdf pc-freak.net pc-freak.net_website.pdf
Loading page (1/2)
Printing pages (2/2)
Done


If the web page to be snapshotted in long few pages a few pages PDF will be generated by wkhtmltopdf
wkhtmltopdf also supports to create the website snapshot with a specified orientation Landscape / Portrait
-O Portrait options to it, like so:

linux:~$ wkhtmltopdf -O Portrait pc-freak.net pc-freak.net_website.pdf


wkhtmltopdf has many useful options, here are some of them:

  • Javascript disabling - Disable support for javascript for a website
  • Grayscale pdf generation - Generates PDf in Grayscale
  • Low quality pdf generation - Useful to shrink the output size of generated pdf size
  • Set PDF page size - (A4, Letter etc.)
  • Add zoom to the generated pdf content
  • Support for password HTTP authentication
  • Support to use the tool over a proxy
  • Generation of Table of Content based on titles (only in static version)
  • Adding of Header and Footers (only in static version)


To generate an A4 page with wkhtmltopdf:

wkhtmltopdf -s A4 pc-freak.net/blog/ pc-freak.net_blog.pdf


wkhtmltopdf looks promising but seems a bit buggy still, here is what happened when I tried to create a pdf without setting an A4 page formatting:

linux:$ wkhtmltopdf pc-freak.net/blog/ pc-freak.net_blog.pdf
Loading page (1/2)
OpenOffice path before fixup is '/usr/lib/openoffice' ] 71%
OpenOffice path is '/usr/lib/openoffice'
OpenOffice path before fixup is '/usr/lib/openoffice'
OpenOffice path is '/usr/lib/openoffice'
** (:12057): DEBUG: NP_Initialize
** (:12057): DEBUG: NP_Initialize succeeded
** (:12057): DEBUG: NP_Initialize
** (:12057): DEBUG: NP_Initialize succeeded
** (:12057): DEBUG: NP_Initialize
** (:12057): DEBUG: NP_Initialize succeeded
** (:12057): DEBUG: NP_Initialize
** (:12057): DEBUG: NP_Initialize succeeded
Printing pages (2/2)
Done
Printing pages (2/2)
Segmentation fault


Debian and Ubuntu version of wkhtmltopdf does not support TOC generation and Adding headers and footers, to support it one has to download and install the static version of wkhtmltopdf
Using the static version of the tool is also the only option for anyone on Fedora or any other RPM based Linux distro.

Posted by hip0 | Permanent link

Thu Sep 29 22:21:05 EEST 2011

How to debug mod_rewrite .htaccess problems with RewriteLog / Solve mod_rewrite broken redirects

Its common thing that CMS systems and many developers custom .htaccess cause issues where websites depending on mod_rewrite fails to work properly. Most common issues are broken redirects or mod_rewrite rules, which behave differently among the different mod_rewrite versions which comes with different versions of Apache.

Everytime there are such problems its necessery that mod_rewrite's RewriteLog functionality is used.
Even though the RewriteLog mod_rewrite config variable is well described on httpd.apache.org , I decided to drop a little post here as I'm pretty sure many novice admins might not know about RewriteLog config var and might benefit of this small article.
Enabling mod_rewrite requests logging of requests to the webserver and process via mod_rewrite rules is being done either via the specific website .htaccess (located in the site's root directory) or via httpd.conf, apache2.conf etc. depending on the Linux / BSD linux distribution Apache config file naming is used.

To enable RewriteLog near the end of the Apache configuration file its necessery to place the variables in apache conf:

1. Edit RewriteLog and place following variables:

RewriteLogLevel 9
RewriteLog /var/log/rewrite.log


RewriteLogLevel does define the level of logging that should get logged in /var/log/rewrite.log
The higher the RewriteLogLevel number defined the more debugging related to mod_rewrite requests processing gets logged.
RewriteLogLevel 9 is actually the highest loglevel that can be. Setting the RewriteLogLevel to 0 will instruct mod_rewrite to stop logging. In many cases a RewriteLogLevel of 3 is also enough to debug most of the redirect issues, however I prefer to see more, so almost always I use RewriteLogLevel of 9.

2. Create /var/log/rewrite.log and set writtable permissions

a. Create /var/log/rewrite.log

freebsd# touch /var/log/rewrite.log


b. Set writtable permissons

Either chown the file to the user with which the Apache server is running, or chmod it to permissions of 777.

On FreeBSD, chown permissions to allow webserver to write in file, should be:

freebsd# chown www:www /var/log/rewrite.log


On Debian and alike distros:

debian:~# chown www-data:www-data /var/log/rewrite.log


On CentOS, Fedora etc.:

[root@centos ~]# chown httpd:httpd /var/log/rewrite.log


On any other distribution, you don't want to bother to check the uid:gid, the permissions can be set with chmod 777, e.g.:

linux# chmod 777 /var/log/rewrite.log


Next after RewriteLog is in conf to make configs active the usual webserver restart is required.

To restart Apache On FreeBSD:

freebsd# /usr/local/etc/rc.d/apache2 restart
...


To restart Apache on Debian and derivatives:

debian:~# /etc/init.d/apache2 restart
...


On Fedora and derivive distros:

[root@fedora ~]# /etc/init.d/httpd restart
...


Its common error to forget to set proper permissions to /var/log/rewrite.log this has puzzled me many times, when enabling RewriteLog's logging.

Another important note is when debugging for mod_rewrite is enabled, one forgets to disable logging and after a while if the /var/log partition is placed on a small partition or is on an old server with less space often the RewriteLog fills in the disk quickly and might create website downtimes. Hence always make sure RewriteLog is disabled after work rewrite debugging is no longer needed.

The way I use to disable it is by commenting it in conf like so:

#RewriteLogLevel 9
#RewriteLog /var/log/rewrite.log


Finally to check, what the mod_rewrite processor is doing on the fly its handy to use the well known tail -f

linux# tail -f /var/log/rewrite.log


A bunch of time in watching the requests, should be enough to point to the exact problem causing broken redirects or general website malfunction.
Cheers ;)

Posted by hip0 | Permanent link

Thu Sep 29 09:43:22 EEST 2011

How to convert Ogg Video (.ogv) to Flash video (.flv) on Linux

ffmpeg is the de-facto standard for Video conversion on Linux platform. I was more than happy to find out that ffmpeg is capable of conv erting an .ogv file format to .flv (Flash compressed Video).
Ogg Vorbis Video to Flash's conversion on Linux is a real piece of cake with ffmpeg .
Here is how to convert .ogv to .flv:

debian:~# ffmpeg -i ogg_vorbis_video_to_convert_.ogv converted_ogg_vorbis_video_to_flash_video.flv
...


Conversion of a 14MB ogg vorbis video to flv took 28 seconds, the newly produced converted_ogg_vorbis_video_to_flash_video.flv has been reduced to a size of 9MB. This is on a system with 2 GB of memory and dual core 1.8 Ghz intel CPU.

Posted by hip0 | Permanent link

Wed Sep 28 12:21:53 EEST 2011

How to find out which processes are causing a hard disk I/O overhead in GNU/Linux

iotop monitor hard disk io bottlenecks linux
To find out which programs are causing the most read/write overhead on a Linux server one can use iotop

Here is the description of iotop - simple top-like I/O monitor, taken from its manpage.

iotop does precisely the same as the classic linux top but for hard disk IN/OUT operations.

To check the overhead caused by some daemon on the system or some random processes launching iotop without any arguments is enough;

debian:~# iotop


The main overview of iostat statistics, are the:

Total DISK READ: xx.xx MB/s | Total DISK WRITE: xx.xx K/s
If launching iotop, shows a huge numbers and the server is facing performance drop downs, its a symptom for hdd i/o overheads.
iotop is available for Debian and Ubuntu as a standard package part of the distros repositories. On RHEL based Linuxes unfortunately, its not available as RPM.

While talking about keeping an eye on hard disk utilization and disk i/o's as bottleneck and a possible pitfall to cause a server performance down, it's worthy to mention about another really great tool, which I use on every single server I administrate. For all those unfamiliar I'm talking about dstat

dstat is a - versatile tool for generating system resource statistics as the description on top of the manual states. dstat is great for people who want to have iostat, vmstat and ifstat in one single program.
dstat is nowdays available on most Linux distributions ready to be installed from the respective distro package manager. I've used it and I can confirm tt is installable via a deb/rpm package on Fedora, CentOS, Debian and Ubuntu linuces.

Here is how the tool in action looks like:

dstat Linux hdd load stats screenshot

The most interesting things from all the dstat cmd output are read, writ and recv, send , they give a good general overview on hard drive performance and if tracked can reveal if the hdd disk/writes are a bottleneck to create server performance issues.
Another handy tool in tracking hdd i/o problems is iostat its a tool however more suitable for the hard core admins as the tool statistics output is not easily readable.

Posted by hip0 | Permanent link

Tue Sep 27 10:57:16 EEST 2011

Sjecas li se dolly bell? - Do you remember Dolly Bell? - A classic serbian movie by Emil Kosturica

Sjecas li se Dolly Bell / Do you remember dolly bell?

Sjecas li se dolly is a piece of classic in the well known Kosturica genre, the movie is from the distant 1981. The movie action takes place in communistic Yugoslavia. It clearly contains anti-communistic nuances. I'm really amazed that this movie see the light of the day in the early '90s while still communism had strong influence on information media in Yugoslavia.

As I've lived until the age of 7 in communism and post-communism (and experienced myself communism), the movie was especially interesting to see. In the family in the movie I can see many things I've seen and suffered many of the anti-human communistic bull-shit in my own family in my boy years.
Communism has cripppled us the Bulgarians as a nation and destroyed any society which it was in (clearly observable in all post-communistic countries).

Interesting thing to notice among the communistic Marxist ideas in the plot is the growing influence of the Western World (seen in the anti social behavior of the actors),the enthusiasm to look for occult of the main actor the teenager boy - (Dino), the desire to look follow Italian western culture etc.
The movie also keeps the mark of the negativism and crazyness which is so distinct about all Kosturica movies I've seen. Anyways from an art point of view the movie is a real master piece.

The movie plot takes place in the so conflict area of Sarajevo, a place predominated by Muslims. What is shocking about the movie considering its time of make, is the explicit erotic and sexually related scenes. The censorship in communistic times was quite severe so it's amazing, how this anti-communistic movie containing society unacceptable scenes ever came to existence.
Do you remember Dolly Bell? is a drama movie, presenting a sad reality, we still partially continue to live in the Balkans. Though 20 years has passed since the fall of communism pitily not much has changed here...

Near the movie end there are some religious scenes as well obviously attempting to fill in the material emptiness of communism with something spiritual. The religious scene,is a muslim local tradition of a funeral preparations.
The relation between the movie and Islam is understandable as Kosturica had some Bosnian Muslim roots from the line of his father. This kind of muslim influence is also observable on the other Kosturica movies as well.
Nowdays since 2005, Kosturica is officially Orthodox Christian baptized in Savina Monastery which makes me happy as myself am Orthodox Christian ;)

Posted by hip0 | Permanent link

Mon Sep 26 17:06:19 EEST 2011

PixBros a nice Arcade Game remake of Bubble Bobble for GNU/Linux

PixBros Linux Bubble Bobble like Game Screenshot

While checking my sister's notebook running Ubuntu GNU/Linux. I decided to check the gui package installer for some new Linux games that entered Ubuntu 11.04. A quick view over the games and I come across awesome game called PixBros

The game is combining three great arcade games from my young years Bubble Bobble, Snow Bros and Tumple Pop . The game really brought some joy to my boring lifeand here it comes I've written a small article to share my little joy.

In the game you can select one of three characters and play a remake version of Bubble Bobble on your Linux Desktop. Besides that the music is absolutely awesome like it is with most of the classic arcade games ;)
The game characters graphics is also trendy, like you can see in the screen below:

PixBros Bubble Bobble Linux game like entry Screen characters

The game history is also intriuging and in the old-school arcade games spirit.
PixBros Start New Game screen, game gangsta characters

The game is published under GPL v2, so its one more great game in the family of free software games ;)
PixBros has also port (binary installer) for Windows, Nintendo Wii and few other platforms. As a multi-platform game its very suitable for little Children to develop their reflexes and intellect. Therefore for parents who wants to use free software to grow up their kids mind, PixBros will fit well with other games likeTux Math, Tux Paint, Tux Typing which are stimulating the kid to learn
The game is also great for big kids like me and other arcade maniacs as well ;)
I have only one small note about the game just like with many other Linux games, by default the game starts in minimized screen and trying to play it in fullscreen is only possible by using the menus available from within the game itself.
This kind of behaviour reduces some of the initial game enjoyment and maybe in the future releases of the game let's say when it reaches stable version 1.0 it will be nice the game to start in fullscreen by default.

The creator team of PixBros - Pix Juegos has 4 other games created, all of which are primary developed for GNU/Linux and downloadable from PixJuegos game dev crew official website . Unfortunately the crew official website does not English translation.

The other games from PixJuegos one can enjoy are; A Remake of the classic Atari frog game again for Linux (available for install via a deb package on latest Ubuntu 11.04):

PixFrogger - Atari modern Frog game remake for Linux

A Super Pang modern remake - Pix Pang , below is a screenshot for all those that can't remember Pang ;)

Super Pang arcade classic screenshot
Super Pang

Here is also a screenshot of PixJuegos's PixPang running on Linux:

PixPang Super Pang Linux Remake

PixGuegos game development team has also two other games in their site portfolio; this are Garnatron and PixDash . Here are screenshots:

Garnatron Linux Spaceship arcade game screenshot

PixDash Linux arcade game screenshot
Congrats to the guys of PixJuegos for their great Linux games! I wish them a lot of success and a lot of productive years in Linux game development ;)

Posted by hip0 | Permanent link

Sun Sep 25 22:50:14 EEST 2011

How to play VCD videos in Debian Linux

Totem VCD error occured, could not open location you might not have permissions to open the file

A friend of mine gave me a VCD with some coptic Orthodox Christian exorcism, where there pope was chasing some evil spirits from possessed muslims who came to the Coptic Orthodox Church in egypt. The video was made to be in VCD and as you can expect this did not worked out of the box with Totem and VLC out of the box.
Putting in the VCD video inside my cdrom poped up an error like the one in the header of the post.
In order to make the video play I had to use the old school and now a bit obsolete mplayer.
Hence in order to play the VCD on Debian Linux I had to install mplayer and w32codecs packages first e.g.:

debian:~# apt-get update && apt-get install mplayer w32codecs


Second to play the video from gnome-terminal, I had to switch to the mounted cdrom location /media/cdrom0 and launch the video with mplayer cmd like so:

debian:~$ cd /media/cdrom0/vcd
debian:/media/cdrom0/vcd$ mplayer vcd://2
...


In some cases it might be necessery to play the video with mplayer command like:

debian:/media/cdrom0/vdd$ mplayer vcd://2 vcd://3


Watching it with mplayer from console has some downsides as I couldn't make the fast rewind work, but still it's way better than nothing.
Too bad in Debian Squeeze 6 gmplayer is no longer installable. The gmplayer can probably be installed if mplayer is compiled from source, but I'm too lazy to try it out.
I've red also in some forums online that gxine is capable of playing the VCD play nice, but I couldn't install it from my existing Debian repositories so I did not give it a go.

Posted by hip0 | Permanent link

Sat Sep 24 23:31:01 EEST 2011

How to add Apache 301 redirect to VirtualHost in Apache

I've had two domain names which were pointing to the same website content.
As one can read in any SEO guide around this is a really bad practice as search engines things automatically there is a duplicate site content and this has automatically a negative effect on the site pagerank.
To deal with situation where multiple domains are pointing to the same websites its suggested by many SEO specialists that a 301 redirect is created from all the domain websites to a single website domain which will open the actual website.

Making the 301 direct domain from the sample domain my-redirect-domain.com to www.mydomain.com can be done with a virtualhost dfefinition in either httpd.conf or with the respective file containing the domain virtualhost definitions:
Here is the exact VirtualHost code I use to make a 301 redirect.

<VirtualHost *> ServerAdmin support@mydomain.com ServerName my-redirected-domain.com ServerAlias my-redirected-domain.com www.my-redirected-domain.com RewriteEngine on RewriteRule ^/(.*) http://www.mydomain.com/$1 [L,R=301] </VirtualHost>

After placing the VirtualHost redirect, an apache redirect is required.
Further on when a Gooogle or Yahoo Bot visits the website and does any request to my-redirect-domain.com or www.my-redirect-domain.com , they will be redirected with a 301 reuturned code to www.mydomain.com

This kind of redirect however can have a negative impact on the Apache CPU use (performance), especially if the my-redirect-domain.com is high traffic domain. This is because the redirect is done with mod_rewrite.

Therefore it might be better on high traffic domains to create the mod_rewrite redirect by using a vhost like:

lt;VirtualHost *> ServerAdmin support@mydomain.com ServerName my-redirected-domain.com Redirect 301 / http://www.mydomain.com/ </VirtualHost>

The downside of using the Apache 301 redirect capabilities like in the above example is that any passed domain urls like let's say http://www.my-redirected-domain.com/support/ would not be 301 redirected to http://www.mydomain.com/support/ but instead the redirect will be done straight to http://www.mydomain.com/

Posted by hip0 | Permanent link

Fri Sep 23 13:49:37 EEST 2011

WP-Minify, Scripts Gzip and HeadJS Loader three scripts that might have positive impact on Wordpress performance

I'm trying to get the most of server + wordpress performance and these days I'm heavily playing with it as one can read from my past few articles ;)

Today I've come across three other plugins which in many cases could be beneficial and bring a good performance increase in wordpress, this are:

  • WP-Minify - http://wordpress.org/extend/plugins/wp-minify/
  • HeadJS Loader - http://wordpress.org/extend/plugins/headjs-loader/
  • Scripts Gzip - http://wordpress.org/extend/plugins/scripts-gzip/
WP-Minify - does combine all JS and CSS script into one consolidated compressed script or style as well removes any duplicate script resources and hence could have positive impact on performance

HeadJS Loader - does strips out all your old javascript declarations and puts them into one head.js file so that they are loaded in parallel in the head of the pages and through that prevents the blocking of load up until all JS is a loaded so commonly seen these days on the net for more info on how HeadJS works check out http://headjs.com

Script Gzip - merges and compresses the CSS and JS links on page, the plugin does not have caching functionality. The plugin doesn't have much configuration options which I find as a good thing

To find out what works best for you its a best practice if the website speed load time is tested after loading each of the plugins and with all of them enabled and configured, finally for best results just leave only the plugins or a combination of them which gives the lowest page responce times.

Posted by hip0 | Permanent link

Fri Sep 23 11:45:57 EEST 2011

W3 total Cache a nice wordpress "all in one" wordpress Caching plugin

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 ;)

Posted by hip0 | Permanent link

Thu Sep 22 17:44:24 EEST 2011

Two wordpress plugins to accelerate wordpress opening times and decrease server load time

A combination of two wordpress caching plugins (Hyper Cache and Db Cachesignificantly improves the access times of a wordpress based blogs and websites.

Installing the two websites has drastically improved my blog opening times, so in my view having the two plugins on every wordpress install out there is a must! :)
The plugins installation is straight forward, here is how I installed them.

1. Installing Hyper Cache on Wordpress

To install Hyper Cache all I had to do is download and enable the plugin, the plugin doesn't require any configuration. I always love it when I don't have to bother with reading configuration options and pondering for some 20 minutes on the plugin features, so in that perspective Hyper Cache in my view is a good alternative to Wordpress Super Cache

Besides that Wordpress Super Cache was having issues when enabled on few wordpress based websites I manage these days. For comparison Hyper Cache worked just great on all wordpress install I tried the plugin so far.

To install all I had to do is download the plugin unzip and enable it:

a. Download and unzip it

debian:/var/www/blog# wget http://downloads.wordpress.org/plugin/hyper-cache.zip
...
debian:/var/www/blog# cd wp-content/plugins
debian:/var/www/blog/wp-content/plugins# unzip hyper-cache.zip


b. Enable Hyper Cache plugin

To enable the plugin follow to standard plugin location;

Plugins -> Inactive -> Hyper Cache (Enable)


A Let me proceed with how I did the install of Db Cache .

a. Download and Install Db Cache br />
debian:/var/www/blog/wp-content/plugins# wget http://downloads.wordpress.org/plugin/db-cache.0.6.zip
...
debian:/var/www/blog/wp-content/plugins# unzip db-cache.0.6.zip


b. Enable the plugin

Plugins -> Inactive -> Db Cache (Enable)


c. Make sure the permissions for Db Cache are correct

On Debian to enable Db Cache, the permissions should be changed for Apache to have a read/write permissions to plugin directory, on Debian to fix the permissions I used the commands:

debian:/var/www/blog# chown www-data:www-data wp-content/
debian:/var/www/blog# chown -R www-data:www-data wp-content/plugins/db-cache


On other GNU/Linux distributions the above commands (user and group) www-data:www-data , should be set to whatever user/group Apache is running with, on Slackware this would be nobody:nobody , on CentOS and RHEL it would be apache:apache .

Finally to enable Db Cache

Tue Sep 20 00:07:49 EEST 2011

A sysctl Linux variable to change randomly temporary the PC mac address for IPv6 and increase anonymity on IPv6 networks

To prevent tracking and increase anonymity in IPv6 networks the Linux kernel has a variable to change randomly the MAC identifier. This feature will be very useful in terms of security in the short future, when all the IPv4 IP addresses are finished. The UIE (Extended Unified Udentifier) for an ipv6 address can be changed with command:

sysctl -w net.ipv6.conf.all.use_tempaddr=2
Microsoft Windows Vista and Windows 7 has the UIE enabled by default, enabling the random MAC changes automatically for a host cvan be done as usual by adding the net.ipv6.conf.all_use_tempaddr=2 to /etc/sysctl.conf

On an IPv6 network every ifconfig eth0 down and ifconfig eth0 up will instruct the lan card to be set a different MAC address for the ipv6 ip on the interface.

Changing the UIE randomly however also have security downsides if the host gets infected with a Virus or Worm. The security downsides of the enabled UIE affects mainly Windows hosts on IPv6 networks as UIE variable is enabled by default there. I've found this great tip in an article in the latest Linux Magazine October 2011. Its the first time I saw a paper Linux Magazine, the magazine contains a lot of helpful info on the latest Linux developments and latest trends in the Linux world. Subscription to receive the magazine via normal post is for the magazine costs 6.65 EUR per month (80 EUR) yearly. The 80 euro yearly includes 12 CDS (each magazine is bundled with a newly launched new version of a Linux distribution).
There is also a cheaper subscription for the magazine which costs 64.90 EUR.

Posted by hip0 | Permanent link

Sat Sep 17 14:06:15 EEST 2011

Burj Al Arab, Towers of the Arabs and my bathing in Arab Sea

Burj Al Arab and Dubai shoe pciture

Burj Al Arab is probably the symbol of Dubai and is the 4th tallest hotel in the world as well as 5 star hotel.
The hotel is a majestic peace of modern architecture and is built on artificially made island near Jumeirah beach where the aparment where I sojourn in Dubai is situated ;).

I saw Burj Al Arab hotel building from some distance and it looks really majestic too bad I would not have the time to go closer to it as I would be going on a Safari in the desert. That's right, they organize a Safari in the desert here with a dinner, they let you ride a camel and even have a belly dancers.
I'm very excited on going to the Safari, as I love Camels and I've never been in the wild desert ;) Thanks God for letting my eyes see this things.
I've also tested the Beach here for a second time and the experience is way inferior if compared to any of the Black Sea Resorts we have in Bulgaria and possibly in many locations in Europe.
The Sun here is too strong, so its not a good idea to stay exposed to the sun for more than an hour, also the sea is too salty so if your eyes are directly exposede to water its a bit painful for the eyes.
Besides that the sea water is really too warm so it feels a bit like entering in soup stew. Going for a swim in Arabian sea does give you a hot bath after the excessive sun and does not cool you.
I found it interesting the Arab woman bath up in Sea here in UAE with a special long swimming suit (burkas) as they're called in Arabic.
Here is a picture I've found online two Arab woman bathing in sea in Burkas.


By the way the Arab woman look very beautiful wearing these black traditional dress (burka). Also in my view from Christian perspective it's very righteous kind of think as covering the body and hiding the face reduces the sexual associations one does when seeing a woman and hence should be good from a spiritual perspective.

However wearing this burkas in the background of all this internationaliazation looks a bit strange. Anyways its worthy for admiration that they were able to keep this pious tradition for so many years, so instead of mocking the Arabs for asking their wifes to wear the burkas I think its we better learn from them and suggest our european woman to be a bit less sexually opened and more pious ;)

Posted by hip0 | Permanent link

Fri Sep 16 19:36:09 EEST 2011

Adding a nice advanced text editor to make wordpress wp-admin have Microsoft Word like edit fucntionality

By the default wordpress does not have support for changing the exact font, therefore copying and pasting a text made in Open Office or MS Word often places in the Post or Page wp edit fonts different from the default one set for articles.
Hence some articles after being published on a wordpress blog show up with improper font and the only way to fix that is to change the font first in Open Office and then copy back to wordpress instead of simply being able to change the font from within the wordpress article.

To get around this problem, there is a nice plugin fckeditor-for-wordpress-plugin which aids wordpress with an awesome Word like edit functionalities.
, downhload location for FCKEdit for Wordpress is here

Here is a screenshot of the extra nice functionality the FCKEditor for wordpress providces.

FCKEDitor for wordpress extra functionality screenshot

Installing the plugin is like installing any other wordpress plugin and comes easily to:

debian:/~# cd /var/www/blog/wp-content/plugins
debian:/plugins# wget http://downloads.wordpress.org/plugin/fckeditor-for-wordpress-plugin.3.3.1.zip
...
debian:/plugins# unzip fckeditor-for-wordpress-plugin.3.3.1.zip
...
debian:/plugins# cd fckeditor-for-wordpress-plugin/


And further enabling the plugin from:

Plugins -> Inactive -> (Dean's FCKEditor For Wordpress) Enable


fckeditor for wordpress will replace the default wordpress editor TinyMCE straight after being enabled.

Now really file editting inside wordpress admin panel is way easier and convenient ;) Cheers

Posted by hip0 | Permanent link

Thu Sep 15 16:53:08 EEST 2011

My 5 cents on our quickly worsening online privacy and anonymity - Facebook your account is temporary locked

I needed to use another computer (IPad 2)to add one guy as a future business contact. I was suprised by a message which you see in the screenshot.
Facebook privacy breach again facebook your account is temporary locked
Facebook your account is temporary locked

obviously Facebook are becoming more and more impudent, so now apart from tracking all my activity in facebook and having the copyright rights over all my pictures uploaded, they now want to bind me to use their shitty service only from a single computer.

"We don't recognize the device you're using." is scary to me personally and it shows a very bad direction, we have taken.
Now its supposed that any normal member of society is using his personal personal computer equipment (notebook, desktop, mobile tablet etc.), where the direction is that unification of devices is happening with development of handheld devices, so suddenly, we might soon be forced to only use only one personal device for all kind of activities phone calls, entertainment, checking online ... etc. you name it
Then imagine, we might little by little be forced by mass adoption to only use this devices for all kind of communication.
Let me explain a bit thoroughflly what I mean. With the invention of the radio, people part of modern society has little by little started adopting the TVs as a device to retrieve information from various types from a centralized sources.

A time came, where everybody in the developed countries were using the radio, then came the TV and the television as a mass media, people who previously used the radio has comparatively quickly migrated to TVs and little by little, the radios use from the masses died.
Then came the more advanced kind of technologies the computers, first they were used by only choosen "elite" people who were beneficial to live in the developed society where first mainframe computers were invented, the technology was advanced and when the personal computers went out, the decrease of computer price allowed practically almost everyone from the developing or the development world to buy and start using it.
The increased use of computers and the emerge of Internet in the end of '80s has suddenly shifted the mass use of TV to computer use.
People were crazy about computers, now most of the young and mid aged people from developed societies has almost completely abandoned the TV as a mean to get informed as the computer is doing the same. The emerge of pagers and mobile phones little by little and the development of the mobile phones has lead many people who actively was using a PC to switch to use of mobile or handheld devices and therefore forget compeltely about old desktop computers. These days even laptops use is getting threatened by tables like IPAD or Samsung's Android tabloid. The trend therefore is that people who actively use their computers switch to tabloids and mobile phones in the next 10 years at worst.
It's more and more rarely now that people use a random computer device to access the internet or in there daily lives this creates a very severe possible short-coming future issue as its possible we reach the time that most services available online might only be accessible via only certain devices which has "a hardware" (hard or unchangeble way to identify us).
This might sound a bit like a scenario for a sci-fi movie but unfortunately I see it as one very possible scenario.
If the idea of online provided resources and services social networks like twitter,facebook, xing etc. is originally to provide easy access to piece of information from anywhere in the world they shouldn't definitely try to restrict us on how we use their services (especially if this is not illegal or in contradtion in country's law.

I really feel my privacy violated from facebook and I'll probably delete my account there or always access it via a proxy, I don't like the idea that facebook is able to detect based on my IP change from country to country, the cookie shit it stores int he browser and browser and OS version of my computer what exactly is my computer and that I'm the only one to use this computer. What would it be if I was in a poorer country where the computer is used by many people, or I have borrowed my sister to travel abroad and use my notebook to access the internet and surrounding daily services she uses.
She might for example used the desktop at home and when travelling outside with my notebook access facebook, its a perfectly possible scenario. I don't like the idea that I'm currently associated with a single computer really this is too much.The idea of linking my credentials for a shitty website like facebook to my personality is something I really don't think is right.
If the Cloud Computing and online services should continue, there at least should be a government law to enforce, monopolists in online services to encrypt the user data in order to prevent, some facebook sysadmin or programmer or even the facebook Management board or CEO to have immediate access to privat information one puts in.

Same goes also for google, yahoo msn etc. Having an email account at any of the services and searching online reveals a lot of sensitive personal data, i'm quite sure that google/msn's information stored for all the mail user accounts using the search engine services contains very sensitive information about a person's personal private life and likings.
I'm quite sure google and the most of the big elephant companies are spying on their users and do create a thorough personal records for their users.
Scroogle instead of Google, improving browser security to secure, browser leaked personal identity data, Anonymizing ICQ and MSN to route traffic via tor , anonymizing Skype to hide your IP with Tor , Install torbutton to route Firefox browser traffic via Tor or use a combination of all to try to increase the level of anonimity online.
Also with the mass production and deloment of GPS integrated with most modern mobile phones, notebooks, cars etc. its pretty easy for one to be found nomatter where he is.
Its getting almost impossible for us to keep privacy and anoimty. While looking in the future and the latest technology development it appears situation will be getting worser.
Maybe the only way in future times for a man to be free will be completely abandon technology, as every piece of technology nowdays is doing some kind of tracking and leaking information about its user.
The increase of public security on airports, bus stations e.g. in airplanes, buses stregthens general society security, however it does this on account of decrease of personal privacy and makes us humans more and more dependent on "the system".

All this induces a serious threat especially with the increase of unification of local countries and country adhering societies as a direct cause of globalization.
The globalization also leads to unification and merging of laws in countries around the world. The result from all this is also absollute necesity of internationalion of banking and financing system which is currently happening in front of our eyes.
They say it's security measure but is it reall, just imagine if Gail, Yahoo or any other But let's be optimistic, maybe I'm over-exaggerating, maybe things will go for good in short future and the "Doom scenario" will not happen ;)

Posted by hip0 | Permanent link

Wed Sep 14 14:36:51 EEST 2011

Exaltation of the Holy Cross day in the Bulgarian Orthodox Church / Veneration of the Holy cross church feast

Exaltation of the Holy Christ Cross icon, day in the Bulgarian Orthodox ChurchThe Universal Exaltation of the precious and life-giving Cross XVII century - icon from village of Belovo Trqvna region

he Universal Exaltation of the Precious and Life-Giving Cross (Elevation of the Cross)'s day is feted on 14th of September each year in accordance to the new calendar order, according to old church calendar, the Church celebrated it on 27th of September.

The day is marked by a strong fasting, for short we refer in Bulgarian to this big Church feast as (The day of the Cross / Krystov den).
The Holy Orthodox Christian Church does worship the cross 4 times a year on:

  • Third Sunday after the start of the Great Lent

  • Holy Friday (Good Friday)

  • 1st of August

  • and
  • 14th of September - The Exaltation of the Holy life giving Cross

On this day, we the orthodox christians go to the Church and admirationally bow and kiss the Holy Cross on which our Saviour Jesus Christ suffered for our salvation.Through his cross suffering our Lord has granted to all of us the Christians an unbeatable "weapon" against evil and sin.
Through cross Christ has been victorious over sin and death.

According to old Church tradition, on the day Christian people were asking for the priest to go to their homes and do vodosvet (sprinkle their houses with a blessed holy water).
Vodosvet is one of the Orthodox Church mystics, there is a specific prayers begging God for forgiveness of sins, asking for good health and blessing. The prayers are being red over a vessel containing clean water. Finally he blesses the vessel with Water with the life Giving cross 3 times (as a symbol of the Holy Trinity). Then the priest uses a the cross and a tiny piece of twig to sprinkle all the people and objects in the house.

On the holy exaltation of the holy cross feast we also celebrate also the following 3 events:

1. The miraculous appearance of the Holy Cross to emper st. Constantine
2. The finding in Jerusalem of the Holy life-giving cross in Golgotha
3. The return of the Life-giving cross from persian captivity
On 14th of September, according to Church tradition saint John of John Chrysostom has give away his spirit and joined the assembly of saints of God, however because of the Exaltation great significance, the church holy fathers decided that this is celebrated on 13th of September.

The Antiphon for the Exaltation of the Cross feast is singed and translated from Slavonic its meaning goes like this:

Troparion voice 1

Save Oh Lord, your people and bless possession, grant us oh Lord a victory over our enemies and save your inheritance with your Cross


Troparion voice 2

You've been lifted willingly on the cross, grant you mercies to your inheritance oh Christ our Lord,
stregthen the spirits of the pious king and to your people,
grant us victory against our enemies,
Surround us with peace and with peace give us unbeatable victory


In the Glorification part of the Holy Liturgy feast service its singed:

We magnify you, oh Christ life giver,
and your Holy cross, because you have saved us from the enemy.


What does the Church tradition says about the finding of the holy cross of Christs sufferings?

After the Church crucifixion of Christ, according to the tradition of that times, the weapon for punishment from this kinds - the cross tree was buried in the ground on the same place, where the punishment was executed.
Following the tradition on Gologthas where Christ was crucified was buried the cross used for crucifixion.
In later times, emperor Adrian in his attempt to destroy christianity and the place of pilgrimage of Golgotha has issued an order to built a pagan shrine on the same place.
Later under the reign of Emperor st. Constantine the cross appeared in the sky in a miraculous way and again under his reign the Golgotha place which means literally translated( the place of the Skulls) was discovered.
Let witht he Holy miracle making power of our Saviour's cross by the prayers of all the Saints and our Theotokos (Holy Virgin Merry) God grant to all of us christians victory of our enemies! Amen

Posted by hip0 | Permanent link

Tue Sep 13 14:43:49 EEST 2011

Flight to Dubai via Istanbul, my Dubai first impressions and how it feels to be in Arab country

Burj Al Arab and the 360 degree club

On Sunday I had a flight to Dubai - the the United Arab Emirates. The flight's goal is to do some business meetings with potential investors willing to invest in Cadia Holding 's Ofsshore Solutions
I'm employed as IT & Security Specialist and business consultant as well as doing the system administration for the company

The company has already scheduled a business meetings to look for new investors in order to finance the current company offered products and services as well as finance its entrance in the field of biometrics technology for the people to allow people to pay in stores with no need for plastic cards only using a finger partial imprint and a code.

The flight from Sofia to Istanbul was about 1 h and 15 minutes and it went quite smoothly thanks God. It seems Sofia's Airport has changed a lot since my last flight before more than a year and half to Dotmund Germany.
Now Sofia's airport looks way more modern than before, which means Bulgaria is slowly but surely developing it's infrastructure ;)
Sofia Airport long distance view

I used an electronic ticket for the flight which was pre-purchased by Cadia so what, all I had to do on the airport is show a copy of my e-ticket and immediately, they hand me in the fly ticket necessery to check in for the airplane

I should say the flight with Turksih airlines was really enjoyable and the plane we flight with felt much more secure compared to the WizzAir's airus.

It is true the last time I flight with with Wizzair's Airbus it was in January and the weather was quite bad as there was harsh winter with a lot of snow and this might be the reason, why my flight with them felt so shaky.

Anyways before entering the plane I had to go throught the regular security procedures, where I had to remove all kind of metals in bas, pockets etc. and go through a metal scanner, they sa an (anti terourisim) measure, besides that one of the airport security personnel checked me thoroughfully if I dont' bring any kind of objects hidden in m clothes. Generally during the check up with the metal scanner and the check up person I was treated like a criminal ...
The Turkish airlines, stewardesses and the service was wonderful and we were given a not too bi but decent lunch (my first time I eat in airplane ;)).

Turkish Airlines Istanbul Airport

The flight as went smoothly and we were in Istanbul about 12:00 at midday, after coming down from the bus we were transferred with a bus from the plane like 1 or 1.5 km to Terminal 2 (the terminal of arrival scheduled).
I travelled with another colleague Krasimir, so we had to check our Tickets in the ticket office and let them issue us the flight ticket based on the e-ticket.
After a quick check of our International travelling passport, so called red passpower we were let to enter the duty free zone full of stores for food, beverages, clothes, parfumes suits cafeterias and everything, tech equipment stores, book stores, turkish ice-cream, duner kebaps and mostly any kind of shops and tings one can think of.

AtaTurk airport Istanbul picture
Ataturk Airport Istanbul

Something that catched my attention was that actually the model of how things are ordered and what they sell, the elevators the materials for building in the airport was very much like how things are in westerm country.
I thought it's a bit sad that everybody, everyone is following a modern design and a specific kind of order of things literally followed after the way things are in the western world. This somehow kills partially the uniqueiness of the country's culture and gives it a taste of the west, where the original culture and traditions the country possess somehow stay in the background.

What made me a bad impression on the airport is the too high prices of food and drinks. I just took one coffee (cappucino) and it costed me the solid sum 5 EUR!!
I was even fooled by the Turkish guy as if converted the coffee price from Turkish currency (Liras), when I calculated the price of the coffee was actually about 4 euro.

I've also spotted that in Turkey they're big nationalists. I've been told by Krasi the airport of Istanbul is called Ataturk and it appears this is the biggest airport in all Turkey. I've noticed in the bookstores we went through many many books even in English talking about the greatness of Turkey's first president Ataturk. There is no doubt that Ataturk has done a lot for internationalizing Turkey, it seems in Turkey they consider Ataturk as a national hero, but in my view it is a bit too much, somehow it looked like Ataturk's great respect in Turkey is comparable to the Chineese's love for Mao Dun ....

We had to spend some 4 hours with Krasi before the time for the second fly comes, so we had 4 hours to take a general look over everything offered in stores on the airport to kill some time

I was quite amazed to see so big variety products and goods on the same place, there was basicly everything one needs except furniture offered ont he airport.
The bookstores English books was reallya lot, where I should say it was quite good that about 40% of the books to be sold, were in English (quite odd especially if I take in consideration that most of the Turkish people I know couldn't speak too good English).

The flight to Dubai was scheduled for 16:45 in the afternoon, so 40 minutes earlier I and Krasi went again through the metal scanner again and thanksfully this time we were not searched for guns and bombs by airport police.

The airplane, we flied with was Boeing 777, which is really a beatiful machine. We were lucky to travel with two other Bulgarians Nikolay and Gergana, who were flying to Chennai India for some kind of personnel training of some company personnel for the company http://Yazaki.com (an international company producing vehicles components) .

Emirates Boeing 777 nice airplane

Emirates airlines's organization service and convenience was really incredible! Emirates has done a great, job really. I had a lot of fun in the airplane in the flight, as they had every passenger sit with a touch screen display computer with a joystick similar to the ones with playstation.


Emirates Boeng 777 Passenger personal computer touch screen device
A Boeng 777 Passenger seat view , the passenger touch screen device mounted on seats back

The little touch screen computer had a number of capabilities the passenger could watch a movie, get information about Dubai play his favourite old fashioned games like Pong, Asteroids, Galaga like, Checss, Arkanoid and like 10 outhers of classic games I know from my childhood.
Besides that the passenger's flight personal computer was equipped was even capable to make satellite phone calls chargable directly from VISA or Mastercard Debit or Credit card. The telephone was embedded with the joystick, so on the back of the control device joystick one has the satellite phone, the phone had the capability to call passengers who are inside the plane. To call another traveller inside the airplane you just need to have the passenger seat number.
As a computer security hobbyist, I've noticed one major problem with the phone calls in between airplane travelling passengers.
By default each sit's phone was sett upped to automatically answer phone calls from other passengers, Which means that if I'm a malicious abuser I can easily just call random people in the airplane and do social engineering pretending to be the plane Commander, stewardess or any other personal from the plane crew ;)
On the other hand calling random people, by getting advantage of how the system "hole", could easily give you the opportunity to make yourself random friends or share contacts with people from around the world ;)

Another handy thing about the onboard touch screen computer, I've noticed is the possibility to listen music from a list of a huge database with music. Also a huge database like (300+) movies ready to be seen was available, as well as some serials and some popular podcasts as well as the device even supported e-mail check and some basic internet functionalities (which unfortunately had to be used only after payment with a debit or credit card :|).

Emirates Passenger personal computer touch screen incredible device
Emirates / Skywards Passenger personal computer touch screen device

In the middle of the 4 hours and 15 minutes flight, we were handed in a good portions of dinner meals, which obviously was properly selected to be suitable to be easily digestable and vitaminous food. Also alcohol arabian Coca-Cola, Coffe and tea was offered.

Before the meals was handed in by the few stewards in the airplane, each passenger was handed with a (hot) towel, to carefully clear his hand or face!

Many of the Arabs used the towels to wipe their face sweat, where europeans tended to clean up their hands (probably shows something about the each about arabian and european habits and culture?).

Dubai side view from the airplane before the landing was really amazing, I've never seen so much light concentrated on one place never ever in my life, landing went pretty smoothly thanks God, though it felt a bit more risky than the landing done by the Turkish airlines, pilots.
Maybe there is difference in the landing because it was done during night time and probably landings in night time a way difficult task for the pilot.

Just like in Istanbul, after going down from the plane, via the plane step-ladder we were transported to the Airport with Buses (I was told by Krasimir that, the bus transportation is used becuase, it's a way cheaper than using the equipment for "hot tie" to connect the plane with the terminal via "tuble".
Also maybe its difficult in terms of parking the airplane as the airplane has to drive like 1.5, 2km and park this is an astonishing amount of petrol plane fuel ;)

Anyways just to sum-up my first flight with Emirates/Skywards it was more than enjoyable and nice, everything from the plane take off through the overall airplane experience to landing felt like a veery well crafted, organized and stricktly managed process. It felt like verything happening is perfectly tuned, again really nice feeling ;)
Interestingly inside th airplaine they had a stewardesses which were either Malaysian or Indonesian. The reason for tat was probably because Arabs are crazy about chineese and the variations of yellow races as I've heard from Baky (an Egyptian) as well as from some few Egyptian colleagues I had.

After we went down from the bus transporting us to Dubai's terminal arrival terminal 3, which I think is the only terminal dedicated for visitors in Dubai, we couldn't freely anter Dubai, but we were supposed to go through a biometric security measure the airport here implemented few years ago an Eye Scan .

Dubai Airport Arrival in United Arab Emirates - Airport Terminal 3

The organization on the airport and the information that we were supposed to have the eye scan in order to enter Anyways after some questioning near few of the airport desks and offices, we found or way to the device place where the eye scans took place.

The eye scan process is quick and not that scary as it sounds, they ask you sit on a chair cover left eye, then cover right eye and open the eye widely to make a picture of the iris, then based on some algorthim for interpreting the data and through a complex IT develoepd system a check is done against a database of well known criminals and if no match is found you're given a seal which lets you in Dubai.

The only concern, I have is once they took your eyescan they have this information stored so basicly they have your biometric data and if the information is stolen or send to third parties you can never know, but that's how it goes you know it's life, if you don't do the eye scan you can't go in.
You don't have the option to just choose if you want to have the eye scan or not ... My company boss tried to cheat them and walk through inside Dubai without ahe eye scan as he said he went through the eye scan so man times, but still he was obliged to go through the eye scan in order to be let in the city.

After the eye scan on the airport, we had to line up on a long line with arriving people waiting for being let in Dubai, show the copy of the visa with the eye scan seal to airport police officer. He checks the seal the visa, the international passport and then one is asked to stay in front of another camera snd they take a picture of him, once again a security measure ...
This is just crazy, I understand that security is important but the measures implemented today on airports are inhuman and even abusive, not to mention they break any privacy one can have in today's world ... I'm even scared to think about how a security check on an airport will look like 20 years from now.
Anyways after all the aforementioend checks we were FINALLY allowed to enter Dubai, what first striked me was the size of the buildings, its the first time in my life I've seen a buildings of this amazing size, just incredible!
Also all the buildings are all in color lights and are flashing like spaceships, probably requirement to make sure no airplane tries to land over some of the buildings at night time ;)

Roland, a part time tech consultant for Cadia Holding and a colleague, took us up from the airport and drove us to the hire apartment in Jumeirah Beach, Rimal 6 - ap. number 53, where we're currently settled.

Jumeirah Beach Residence Rimal
Jumeira Beach Rimal buildings

I'm very thankful Roland was there otherwise if we were supposed o pick up a taxi, they would have charged us at least 80, 90 EUR! for bringing us to the apartment.
The prices of transportation here and in general prices are a killing onse. I guess this is pretty normal especially if you consider the countless amount of money invested in Dubai.
Honestly Dubai looks like a paradise on earth, everything is amazingly well organized, as well the technology involved everywhere is on a perfect and a better level than almost everything, I've seen in Holland, Germany and probably almost every other of the Western Europe countries.

Something strange that took my attention here was that in every big mall or big store, they have a special prayer room, which are suited for pracicing muslims to do they're 5 times daily prayers ;)
Here in Dubai I was shocked to see many of the native arabic ladies to be completely wrapped up inside mostly black dresses, where the man were often dressed in a complete dress without a zipper called thobes as well as a sort of a hat like long veil very similar to our orthodox christian priest monks viels.

Dubai man with Thobes in order smiling ;) Dubai man with Thobes lined in order smiling

The veil like dresshing the man wears has a ring on top of the head which has some kind of muslim symbolism probably I'm not aware of. An interesting thing, I've found out here is that this veil for the hat has colors, if it's red this means it's Saudi Arabia a white one means usually the man is from Dubai and the nearby regions o something like that.

When we went out of the airport here the temperature difference was killing it was like 35 Celsium degrees at 21:00 o'clock night time!!

I'm actually lucky to come here in Autumn, temperatures on Autumn are acceptable at night it's like 20-25C and in day usually 35-40C.

The private apartment, where we're accommodated is amazing, it's big like a place, it has everything a flat TV, wireless internet, 2 bathrooms, 4 bedrooms etc.
To enter the buillding one needs to use his special ID card which is secured by a bar code, which has to be tagged on a bar code reader on the building entrance door.
Dubai itself seems more international at times, even than Western europe, you can see everything in Both English and Araabic, so you can understand basicly everything. Everyone speaks from the lowest employee to the office workers an acceptable English and thus communication is not a constraint like in Holland, where many people speak English which is too much influenced by German and german lingual structure.

I'm very thankful to God for blessing me to come to this nice place, now I'm laing over a nice coach and blogging.
By so far, I've seen two of the biggest Dubai Malls and some general architecture, all is collosal in size and reall amazingly built. I've heard from people quality of buildings is not that good as everything is being built in too short time and with cheap materials and by Indian labours who earn like 5 dollars a day. I'm not sure though how truthful is this as I think the quality of the apartment, we're accommodated is great.

Each room is equipped with a Clima, so the temperature inside is steady 22- 24C degrees. The body shock when you go out hence is really severe as usually there is like 10 or 15C degrees difference in temmperature.
Climas are, good but they create too much noise at night it's a bit noisy, but maybe with time one can get used to it.
The cars I saw here in Dubai are amazing, all the cards are really really expensive maybe the cheapeast car in Dubai worths no less than 10 000 o 20 000 EUR.
Euro, Dollars and the official UAE currency dirham are accepted everywhere in shopping malls and food stores and this is really nice.
The taxi drivers charge a lot here, I was out with Jure and we took taxi feew times and each time for like 5-7 km distance, the taxi charged approximately 30 EUR per drive.
Random Taxi in Dubai

The Taxis are all luxurious cars with a (airconditioners) climas, it seems they have a metro already operating here as well as comperativfe cheap transportation with buses, but I'm not sure if something could be really cheap here ;)
Everywhere I went here I can notice something really beautiful in terms of either mostly modern design with arabic elemnts or technology. The elevators here are really quick. To go to the last stage of the 36 stages building here in Dubai it tooks the elevator no more than 1 minute ;)
The food here in Dubai seems decent, though its not that good like naturally grownned products or a chicken or cow who was rised in a private farm.
Anyways the food here in United Arab Emirates seems to be way better than the food in Holland and Germany, where it is a bit like plastic.
I don't know if its because of the Sun excessive warmth, God's grace to me or what but I should mark, here in Dubai and maybe in rest of UAE one feels warmer than in Western Europe.

People don't smile too much here especially the people who work on the lower levels of job, clear indicator that they don't earn good money.
I like that they don't smile too much as this reminds me in Bulgaria, where you can see sour faces a way more often than a smiled one.
Here people look a bit less soury than in Bulgaria.

I will be in Dubai 6 more days, so I'll have a clearer picture in my head about the place after some few days. Nevertheless from what I've seen so far, I'm really very amazed and very thankful to God to leeting me see all this new interesting things and culture.
I should take the time to find and take a look in the more traditional places here. Pitily globalization is seriously destroing the local people culture here, and you can't feel the real culture besides the arabic kind of dress, the mosques , prayer rooms and some entwisted muslim architecture with the modernistic buildings.
It will be very nice to see some real camels, elephants or some typically arabic kind of things ;)

Summing it up, the overall atmosphere here, the organzation of thingsm the business climate and infrastructure is something we europeans should learn from.

Thu Sep 8 17:54:47 EEST 2011

Plamenko and his project Symphology - One of the greatest composer guitarists in Bulgaria presently

A friend of mine Plamen Panayotov is one of the best guitarists, I've ever watched live.
He is self-taught musician and is one of the notable guitar composers of our times (in my view).
As every genious he is not recognized on time and his music is not well known in Bulgaria.
Plamenko
, he uses unique tunings not to be find in musicians official books.
Plamenko's music is highly charged with positivism and goodness as it also reflects his life as a Christian and his Christian views.
He tried hard to make living with music and has issued a couple of music albums which are available for purchase in Amazon (just in case if you like his works).

Plamenko's living is very interesting and he was actually the first person, I've met to publicly confess his faith in Christ.
I found it nice to share some of his inspirational and highly spiritual songs here in hope it will be bring some peace and spiritual joy to my readers, enjoy ;)


Plamenko - The Wisdom from Abvove


Plamenko - Renewal / Revival


Plamenko - First is Pure

Plamenko's music is very unusual and I believe it would not be an interet to people, who are after pop culture. Also his music is not a music one, can listen everyday as it's high music diversity and complexity of compsings is not easy for to be comprehended by the unskillful eye, however I'm sure his music can be appreciated well by professional musicians, spiritual seekers and unique music connoisseurs.

Plamenko's living is as unsual as his music is, he spend many of his years playing his guitar and travelling throughout Bulgaria's montain, waterfall regions and the wildest places in the country.

On many occasions he has shared with me his stories on how he lived, almost like a hermit for few weeks in abandoned old houses, vineyeards, meadows located in the wild.
During his tiny periods of hermit like living, he told me how much he enjoyed the birds singing, crickets plays at night, just wandering in the mountain pathways.
The most unique story, I've heard from his mouth is when he lived in an abandoned house situated in high ridges of Rodopi Mountains, where he lived only eating some wild blueberrys and other kind of fruits many of which wild ones located nearby the place.
Such kind of people, are hard to meet in todays crazy life, when money are considered the highest good and people forgot that the essence of life is not in eating and drinking as our saviour Jesus Christ told us.

People like Paco are extremely hard to find today, and most probably almost impossible to find in the developed Western Countries.
If you like Plamenko's works and you have the financial wellness to afford buying his works, support him to continue making wonderful music by buying some of his albums in Amazon.

Plamenko is currently living and working in Copenhagen Denmark, as he found it's nearly impossible to earn enough money in a legal way in Bulgaria to afford buyig a house situated in the mountain.
He is working as a postman, distributing newspapers at night with a bike in Copenhagen. Last time, I saw him he said he haven't seriously played his guitar for about a year as he has a lot of work distributing newspapers and pamphlets as well as he doesn't feel passion for playing.
This is quite normal, I guess since he couldn't find appreciators of his music. Plamenko's music is produced without any company label under by himself, manually copying his music to CDs producing CD covers etc., and this is quite unique as well for today's world of mass production.
If you're living in Copenhagen, you can see Plamenko on the streets and say Hi. He works in city center an unusual just like his music.
His daily job there consists of standing still for hours, holding a big Advertising sign of a famous Copenhagen Tatoo Studio ;)

Enjoy his great music!

Posted by hip0 | Permanent link

Wed Sep 7 14:53:14 EEST 2011

Secure Apache against basic Denial of Service attacks with mod_evasive on Debian

Secure Apache against basic Denial of Service attacks with mod evasive, how webserver DDoS works

One good module that helps in mitigating, very basic Denial of Service attacks against Apache 1.3.x 2.0.x and 2.2.x webserver is mod_evasive

I've noticed however many Apache administrators out there does forget to install it on new Apache installations or even some of them haven't heard about of it.
Therefore I wrote this small article to create some more awareness of the existence of the anti DoS module and hopefully thorugh it help some of my readers to strengthen their server security.

Here is a description on what exactly mod-evasive module does:

debian:~# apt-cache show libapache2-mod-evasive | grep -i description -A 7
Description: evasive module to minimize HTTP DoS or brute force attacks
mod_evasive is an evasive maneuvers module for Apache to provide some
protection in the event of an HTTP DoS or DDoS attack or brute force attack.
.
It is also designed to be a detection tool, and can be easily configured to
talk to ipchains, firewalls, routers, and etcetera.
.
This module only works on Apache 2.x servers


How does mod-evasive anti DoS module works?

Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address which matches the criterias:

  • Requesting the same page more than number of times per second
  • Making more than N (number) of concurrent requests on the same child per second
  • Making requests to Apache during the IP is temporarily blacklisted (in a blocking list - IP blacklist is removed after a time period))
    • These anti DDoS and DoS attack protection decreases the possibility that Apache gets DoSed by ana amateur DoS attack, however it still opens doors for attacks who has a large bot-nets of zoombie hosts (let's say 10000) which will simultaneously request a page from the Apache server. The result in a scenario with a infected botnet running a DoS tool in most of the cases will be a quick exhaustion of system resources available (bandwidth, server memory and processor consumption).
      Thus mod-evasive just grants a DoS and DDoS security only on a basic, level where someone tries to DoS a webserver with only possessing access to few hosts.
      mod-evasive however in many cases mesaure to protect against DoS and does a great job if combined with Apache mod-security module discussed in one of my previous blog posts - Tightening PHP Security on Debian with Apache 2.2 with ModSecurity2
      1. Install mod-evasive

      Installing mod-evasive on Debian Lenny, Squeeze and even Wheezy is done in identical way straight using apt-get:

      deiban:~# apt-get install libapache2-mod-evasive
      ...
      2. Enable mod-evasive in Apache

      debian:~# ln -sf /etc/apache2/mods-available/mod-evasive.load /etc/apache2/mods-enabled/mod-evasive.load


      3. Configure the way mod-evasive deals with potential DoS attacks Open /etc/apache2/apache2.conf, go down to the end of the file and paste inside, below three mod-evasive configuration directives:

      <IfModule mod_evasive20.c>
      DOSHashTableSize 3097 DOSPageCount 30
      DOSSiteCount 40
      DOSPageInterval 2
      DOSSiteInterval 1
      DOSBlockingPeriod 120
      #DOSEmailNotify hipo@mymailserver.com
      </IfModule>


      In case of the above configuration criterias are matched, mod-evasive instructs Apache to return a 403 (Forbidden by default) error page which will conserve bandwidth and system resources in case of DoS attack attempt, especially if the DoS attack targets multiple requests to let's say a large downloadable file or a PHP,Perl,Python script which does a lot of computation and thus consumes large portion of server CPU time.

      The meaning of the above three mod-evasive config vars are as follows:

      DOSHashTableSize 3097 - Increasing the DoSHashTableSize will increase performance of mod-evasive but will consume more server memory, on a busy webserver this value however should be increased
      DOSPageCount 30 - Add IP in evasive temporary blacklist if a request for any IP that hits the same page 30 consequential times.
      DOSSiteCount 40 - Add IP to be be blacklisted if 40 requests are made to a one and the same URL location in 1 second time
      DOSBlockingPeriod 120 - Instructs the time in seconds for which an IP will get blacklisted (e.g. will get returned the 403 foribden page), this settings instructs mod-evasive to block every intruder which matches DOSPageCount 30 or DOSSiteCount 40 for 2 minutes time.
      DOSPageInterval 2 - Interval of 2 seconds for which DOSPageCount can be reached.
      DOSSiteInterval 1 - Interval of 1 second in which if DOSSiteCount of 40 is matched the matched IP will be blacklisted for configured period of time.

      mod-evasive also supports IP whitelisting with its option DOSWhitelist , handy in cases if for example, you should allow access to a single webpage from office env consisting of hundred computers behind a NAT.
      Another handy configuration option is the module capability to notify, if a DoS is originating from a number of IP addresses using the option DOSEmailNotify
      Using the DOSSystemCommand in relation with iptables, could be configured to filter out any IP addresses which are found to be matching the configured mod-evasive rules.
      The module also supports custom logging, if you want to keep track on IPs which are found to be trying a DoS attack against the server place in above shown configuration DOSLogDir "/var/log/apache2/evasive" and create the /var/log/apache2/evasive directory, with:
      debian:~# mkdir /var/log/apache2/evasive

      I decided not to log mod-evasive DoS IP matches as this will just add some extra load on the server, however in debugging some mistakenly blacklisted IPs logging is sure a must.
      4. Restart Apache to load up mod-evasive debian:~# /etc/init.d/apache2 restart
      ...


      Finally a very good reading which sheds more light on how exactly mod-evasive works and some extra module configuration options are located in the documentation bundled with the deb package to read it, issue:

      debian:~# zless /usr/share/doc/libapache2-mod-evasive/README.gz



Posted by hip0 | Permanent link

Mon Sep 5 19:52:30 EEST 2011

What it would be if the Matrix ran on Windows XP ;)

A friend of mine (Atanas) sent me this funny video. I'm not Ubuntu user but still enjoy greatly the last Neo's replica Ubuntu, I'm going to learn Ubuntu?! ;)
Enjoy


What it would be like if The Matrix run on Windows XP

Posted by hip0 | Permanent link

Sat Sep 3 22:44:03 EEST 2011

Filter messages in Qmail with unwanted words, get rid of the Viagra annoying spam with Qtrap

#################################
# _ #
# | | #
# __ _| |_ _ __ __ _ _ __ #
# / _` | __| '__/ _` | '_ \ #
# | (_| | |_| | | (_| | |_) | #
# \__, |\__|_| \__,_| .__/ #
# | | | | #
# |_| |_| v2.0.0#
#################################


Recently the annoying Viagra spam has emerged again. Therefore I decided to clean up some of the mails received to one of the qmail servers to protect users emailbox from this viagra peril.

To do so I've remember about an old script which used to be part of qmailrocks.org qmail install, the script is called qtrap and is able to filter emails based on list of specific mail contained words.
Since qmailrocks.org is gone (down) for some time and its still available only on few mirrored locations which by the way are not too easy to find I decided to write a little post on how qtrap.sh could be integrated quick & easy with any Qmail + Vpopmail install out there.

Hereby I include the description for qtrap.sh given by the script author:

"qtrap.sh script is applied on a per domain basis and serves as a "bad word" scanner to catch any spam that Spamassassin may have missed. This filter serves as the last defense against SPAM before it arrived in your inbox. I like this filter because it helps to get rid of any SPAM that happens to make it by Spamassassin. Without any protection at all, my mailbox gets a shit ton of SPAM every day. Within the first 3 months I enacted the Qtrap filter, Qtrap logged over 9,000 deleted SPAM messages, none of which were legitimate e-mails. My keyboard's delete key was very appreciated the extra rest.

Any emails that are scanned and contain a banned word will be automatically deleted and logged by the qtrap script. A whitelist feature now exists so that individual addresses or domains can be exempt from the qtrap scan.


Now as one might have general idea on what the script does. Here is the step by step qtrap.sh integration;

1. Create necessery qtrap directory and logs and set proper permissions

If the vpopmail is installed in /home/vpopmail , issue the following commands.

debian:~# cd /home/vpopmail
debian:~# mkdir -p qtrap/logs
debian:/home/vpopmail/qtrap# cd qtrap
debian:/home/vpopmail/qtrap# wget http://pc-freak.net/files/qtrap.sh
...
debian:/home/vpopmail/qtrap# cd ~
debian:~# touch /home/vpopmail/qtrap/logs/qtrap.log debian:~# chown -R vpopmail:vchkpw /home/vpopmail/qtrap debian:~# chmod -R 755 /home/vpopmail/qtrap


On older qmail installations it could be vpopmail is installed in /var/vpopmail if that's the case, link /var/vpopmail to /home/vpopmail and go back to step 1. To link:

debian:~# ln -sf /var/vpopmail/ /home/vpopmail


2. Edit qtrap.sh to whitelist email addresses and build a ban words list

a) Include the email addresses mail arriving from which would not be checked by qtrap.sh

Inside qtrap.sh in line 63, there is a shell function whitelist_check(), the function looks like so:

whitelist_check () {
case $WHITELIST in
address@somewhere.com|address@somewhereelse.com)
echo $SENDER found in whitelist on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log
exit 0;;
*)
;;
esac
}


By default the script has just two sample mails which gets whitelisted this is the line reading:

address@somewhere.com|address@somewhereelse.com


The whitelisted emails should be separated with a pipe, thus to add two more sample emails to get whitelisted by script the line should be changed like:

address@somewhere.com|address@somewhereelse.com|hipod@mymailserver.com|hipo@gmail.com


In order to whitelist an entire domain let's say yahoo.com add a line to the above code like:

address@somewhere.com|address@somewhereelse.com|hipod@mymailserver.com|hipo@gmail.com|*yahoo.com


b) Defining the bad words ban list, mails containing them should not be delivery by qmail

The function that does check for the ban word list inside the script is checkall();, below is a paste from the script function:

checkall () {
case $BANNED_WORDS in
porn|PORN|Sex|SEX)
printout $BANNED_WORDS
echo MESSAGE DROPPED from $SENDER because of $BANNED_WORDS on `date "+%D %H:%M:%S"` >> /home/vpopmail/qtrap/logs/qtrap.log
exit 99;;
*)
;;
esac
}


checkall(); is located on line 74 in qtrap.sh, the exact list of banned words which the script should look for is located on line 76, the default qtrap.sh filters only mails containing just 4 words, e.g.:

porn|PORN|Sex|SEX)

To add the Viagra and VIAGRA common spam words to the list, modify it and expand like so:

porn|PORN|Sex|SEX|viagra|Viagra)

The delimiter is again | , so proceed further and add any unwanted spam words that are not common for any legit mails.

3. Install qtrap.sh to process all emails delivered to vpopmail

If its necessery to install the dropping of mails based on word filtering only to a single vpopmail virtualdomain do it with cmd:

debian:~# cd /home/vpopmail/domains/yourdomain.com
debian:/home/vpopmail/domains/yourdomain.com# touch .qmail-default.new
debian:/home/vpopmail/domains/yourdomain.com# echo '| /home/vpopmail/qtrap/qtrap.sh' >> .qmail-default.new
debian:/home/vpopmail/domains/yourdomain.com# echo "| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" >> .qmail-default.new
debian:/home/vpopmail/domains/yourdomain.com# chown vpopmail:vchkpw .qmail-default.new
debian:/home/vpopmail/domains/yourdomain.com# cp -rpf .qmail-default .qmail-default.bak; mv .qmail-default.new .qmail-default
If however qtrap.sh needs to get installed for all existing vpopmail virtualdomains on the qmail server, issue a one liner bash script:

debian:~# cd /home/vpopmail/domains
debian:/var/vpopmail/domains# for i in *; do cd $i; echo "| /home/vpopmail/qtrap/qtrap.sh" >> $i/.qmail-default.new; echo echo "| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" >> $i/.qmail-default.new; chown vpopmail:vchkpw .qmail-default.new; mv .qmail-default .qmail-default.old; mv .qmail-default.new .qmail-default; cd ..; done


This for loop will add '| /home/vpopmail/qtrap/qtrap.sh' to all .qmail-default for all vpopmail domains.

Afterwards the .qmail-default file should contain the following two lines:

| /home/vpopmail/qtrap/qtrap.sh | /home/vpopmail/bin/vdelivermail '' delete

A very important thing here you should consider that adding some common words, as let's say hello or mail etc. could easily drop almost all the emails the qmail hands in to vpopmail.

Caution!! Never ever implement common words in the list of words !!
Always make sure the banned words added to qtrap.sh are words that are never enter an everyday legit email.

Another thing to keep in mind is that qtrap.sh doesn't make a copy of the received message ,though it can easily be modified to complete this task.
Any mail that matches the banned words list will be dropped and lost forever.

4. Check if qtrap.sh is working

To check, if qtrap is working send mail to some mailbox located on the qmail server containing inside subject or mail message body the unwanted word defined inside qtrap.sh.

The mail should not be received in the mailbox to which its sent, if qtrap is working moreover qtrap.sh should log it inside it's log file:

debian:~# cat /home/vpopmail/qtrap/logs/qtrap.log MESSAGE DROPPED from hipo@mytestmail.com because of viagra on 09/03/11 11:34:19
MESSAGE DROPPED from support@mymailserver.com because of Viagra on 09/03/11 11:39:29


If the qtrap.log contains records similar to the one above, and the mail matching the banned word is not delivered, qtrap.sh is properly configured. If any issues check in qmail logs, they should have a good pointer on what went wrong with qtrap.sh invokation.

Note that I've integrated qtrap.sh to custom qmail install running on Debian Lenny 5.0 GNU/Linux.
If I have time I'll soon test if its working fine on the latest stable Debian Squeeze and will report here in comments.
If however someone is willing to test if the script works on Debian Squeeze 6.0 or have tested it already please drop a comment to report if it works fine.
qtrap.sh, is a bit oldish and is not written to work too optimal therefore on some heavy loaded mail servers it can create some extra load and a bit delay the mail delivery. Thus when implementang one needs to consider the downsides of putting it in.

Also I was thinking tt might be nice if the script is rewritten to read the ban words and whitelist mails from files instead of as it is now as the words are hard coded in the script.
If I have some free time, I'll probably do this, though I'm not sure if this is a too good idea as this might have a negative performance impact on the script execution time, as each instance of the script invoked should do one more operation of reading a file storing the ban words.

Well that's pretty much it, enjoy ;)

Posted by hip0 | Permanent link

Sat Sep 3 20:07:04 EEST 2011

Thanks G-Male

The G Male dream of every girl. Google has created the perfect boyfriend.
Google delved deep into your personal life and found that something was missing. Introducing G-Male. Yes, Google has created The Perfect Male.
Thanks G-Male! ;)

Posted by hip0 | Permanent link

Fri Sep 2 15:43:29 EEST 2011

Fix 503 AUTH first (#5.5.1) mail receive errors in Qmail

I have one qmail rocks install based on This Qmalrocks tutorial

I had to do some changes, to:
/etc/service/qmail-smtpd/run and /etc/service/qmail-smtpdssl/run init scripts.

After a qmail restart suddenly qmail stopped receiving any mail messages and my sent messages was returned with an error:

Connected to xx.xxx.xx.xx but sender was rejected.
Remote host said: 503 AUTH first (#5.5.1)


After investigating the issue I finally found, that one value I've changed in /etc/service/qmail-smtpd/run and /etc/service/qmail-smtpdssl was causing the whole mess:

The problematic variable was:

REQUIRE_AUTH=1

To solve the issue I had to disable the value which it seems, I have enabled by mistake.

Below is a quote from http://qmail.jms1.net which explains what REQUIRE_AUTH shell variable does:

Setting REQUIRE_AUTH=1 will make the service not accept ANY mail unless the client has sent a valid AUTH command. This also prevents incoming mail from being accepted for your own domains, so do not use this setting if the service is accepting "normal" mail from the outside world.
Restarting via qmailctl restart and qmail started receiving messages normal ;)

Posted by hip0 | Permanent link

Thu Sep 1 23:22:31 EEST 2011

How to renew self signed QMAIL toaster and QMAIL rocks expired SSL pem certificate

One of the QMAIL server installs, I have installed very long time ago. I've been notified by clients, that the certificate of the mail server has expired and therefore I had to quickly renew the certificate.

This qmail installation, SSL certificates were located in /var/qmail/control under the names servercert.key and cervercert.pem

Renewing the certificates with a new self signed ones is pretty straight forward, to renew them I had to issue the following commands:

1. Generate servercert encoded key with 1024 bit encoding

debian:~# cd /var/qmail/control
debian:/var/qmail/control# openssl genrsa -des3 -out servercert.key.enc 1024 Generating RSA private key, 1024 bit long modulus
...........++++++
.........++++++
e is 65537 (0x10001)
Enter pass phrase for servercert.key.enc:
Verifying - Enter pass phrase for servercert.key.enc:


In the Enter pass phrase for servercert.key.enc I typed twice my encoded key password, any password is good, here though using a stronger one is better.

2. Generate the servercert.key file

debian:/var/qmail/control# openssl rsa -in servercert.key.enc -out servercert.key
Enter pass phrase for servercert.key.enc:
writing RSA key


3. Generate the certificate request

debian:/var/qmail/control# openssl req -new -key servercert.key -out servercert.csr
openssl rsa -in servercert.key.enc -out servercert.key Enter pass phrase for servercert.key.enc: writing RSA key root@soccerfame:/var/qmail/control# openssl req -new -key servercert.key -out servercert.csr You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:UK
State or Province Name (full name) [Some-State]:London
Locality Name (eg, city) []:London
Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Company
Organizational Unit Name (eg, section) []:My Org
Common Name (eg, YOUR name) []:
Email Address []:admin@adminmail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:


In the above prompts its necessery to fill in the company name and location, as each of the prompts clearly states.

4. Sign the just generated certificate request

debian:/var/qmail/control# openssl x509 -req -days 9999 -in servercert.csr -signkey servercert.key -out servercert.crt
Notice the option -days 9999 this option instructs the newly generated self signed certificate to be valid for 9999 days which is quite a long time, the reason why the previous generated self signed certificate expired was that it was built for only 365 days

Finally to load the new certificate, restart of qmail is required:

5. Restart qmail server

debian:/var/qmail/control# qmailctl restart
Restarting qmail:
* Stopping qmail-smtpd.
* Sending qmail-send SIGTERM and restarting.
* Restarting qmail-smtpd.


Test the newly installed certificate

To test the newly installed SSL certificate use the following commands:

debian:~# openssl s_client -crlf -connect localhost:465 -quiet
depth=0 /C=UK/ST=London/L=London/O=My Org/OU=My Company/emailAddress=admin@adminmail.com
verify error:num=18:self signed certificate
verify return:1
...
debian:~# openssl s_client -starttls smtp -crlf -connect localhost:25 -quiet
depth=0 /C=UK/ST=London/L=London/O=My Org/OU=My Company/emailAddress=admin@adminmail.com
verify error:num=18:self signed certificate
verify return:1
250 AUTH LOGIN PLAIN CRAM-MD5
...


If an error is returned like 32943:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:607: this means that SSL variable in the qmail-smtpdssl/run script is set to 0.

To solve this error, change SSL=0 to SSL=1 in /var/qmail/supervise/qmail-smtpdssl/run and do qmailctl restart

The error verify return:1 displayed is perfectly fine and it's more of a warning than an error as it just reports the certificate is self signed.

Posted by hip0 | Permanent link