Posts Tagged ‘reason’

How to create ssh tunnels / ssh tunneling on Linux and FreeBSD with openssh

Saturday, November 26th, 2011

ssh-tunnels-port-forwarding-windows-linux-bypassing-firewall-diagram
SSH tunneling
allows to send and receive traffic using a dedicated port. Using an ssh traffic can have many reasons one most common usage reason is to protect the traffic from a host to a remote server or to access port numbers which are by other means blocked by firewall, e.g.: (get around firewall filtering)
SSH tunneling works only with TCP traffic. The way to make ssh tunnel is with cmds:

host:/root# ssh -L localhost:deshost:destport username@remote-server.net
host:/root# ssh -R restport:desthost:localport username@remote-server.net
host:/root# ssh -X username@remote-server.net

This command will make ssh to bind a port on localhost of the host host:/root# machine to the host desthost:destport (destination host : destinationport). Important to say deshost is the host destination visible from the remote-server.net therefore if the connection is originating from remote-server.net this means desthost will be localhost.
Mutiple ssh tunnels to multiple ports using the above example commands is possible. Here is one example of ssh tunneling
Let’s say its necessery to access an FTP port (21) and an http port (80), listening on remote-server.net In that case desthost will be localhost , we can use locally the port (8080) insetad of 80, so it will be no necessery to make the ssh tunnel with root (admin privileges). After the ssh session gets opened both services will be accessible on the local ports.

host:/home/user$ ssh -L 21:localhost:21 -L 8080:localhost:80 user@remote-server.net

That’s all enjoy 😉

Tracking I/O hard disk server bottlenecks with iostat on GNU / Linux and FreeBSD

Tuesday, March 27th, 2012

Hard disk overhead tracking on Linux and FreeBSD with iostat

I've earlier wrote an article How to find which processes are causing hard disk i/o overhead on Linux there I explained very rawly few tools which can be used to benchmark hard disk read / write operations. My prior article accent was on iotop and dstat and it just mentioned of iostat. Therefore I've wrote this short article in attempt to explain a bit more thoroughfully on how iostat can be used to track problems with excessive server I/O read/writes.

Here is the command man page description;
iostatReport Central Processing Unit (CPU) statistics and input/output statistics for devices, partitions and network filesystems

I will further proceed with few words on how iostat can be installed on various Linux distros, then point at few most common scenarious of use and a short explanation on the meaning of each of the command outputs.

1. Installing iostat on Linux

iostat is a swiss army knife of finding a server hard disk bottlenecks. Though it is a must have tool in the admin outfut, most of Linux distributions will not have iostat installed by default.
To have it on your server, you will need to install sysstat package:

a) On Debian / Ubuntu and other Debian GNU / Linux derivatives to install sysstat:

debian:~# apt-get --yes install sysstat

b) On Fedora, CentOS, RHEL etc. install is with yum:

[root@centos ~]# yum -y install sysstat

c) On Slackware Linux sysstat package which contains iostat is installed by default. 

d) In FreeBSD, there is no need for installation of any external package as iostat is part of the BSD world (bundle commands).
I should mention bsd iostat and Linux's iostat commands are not the same and hence there use to track down hard disk bottlenecks differs a bit, however the general logic of use is very similar as with most tools in BSD and Linux.

2. Checking a server hard disk for i/o disk bottlenecks on G* / Linux

Once having the sysstat installed on G* / Linux systems, the iostat command will be added in /usr/bin/iostat
a) To check what is the hard disk read writes per second (in megabytes) use:

debian:~# /usr/bin/iostat -m
Linux 2.6.32-5-amd64 (debian) 03/27/2012 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
15.34 0.36 2.76 2.66 0.00 78.88
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda 63.89 0.48 8.20 6730223 115541235
sdb 64.12 0.44 8.23 6244683 116039483
md0 2118.70 0.22 8.19 3041643 115528074

In the above output the server, where I issue the command is using sda and sdb configured in software RAID 1 array visible in the output as (md0)

The output of iostat should already be easily to read, for anyone who didn't used the tool here is a few lines explanation of the columns:

The %user 15.34 meaning is that 15.34 out of 100% possible i/o load is generad by system level read/write operations.
%nice – >Show the percentage of CPU utilization that occurred while executing at the user level with nice priority.
%iowait – just like the top command idle it shows the idle time when the system didn't have an outstanding disk I/O requests.
%steal – show percentage in time spent in time wait of CPU or virtual CPUs to service another virtual processor (high numbers of disk is sure sign for i/o problem).
%idle – almost the same as meaning to %iowait
tps – HDD transactions per second
MB_read/s (column) – shows the actual Disk reads in Mbytes at the time of issuing iostat
MB_wrtn/s – displays the writes p/s at the time of iostat invocation
MB_read – shows the hard disk read operations in megabytes, since the server boot 'till moment of invocation of iostat
MB_wrtn – gives the number of Megabytes written on HDD since the last server boot filesystem mount

The reason why the Read / Write values for sda and sdb are similar in this example output is because my disks are configured in software RAID1 (mirror)

The above iostat output reveals in my specific case the server is experiencing mostly Disk writes (observable in the high MB_wrtn/s 8.19 md0 in the above sample output).

It also reveals, the I/O reads experienced on that server hard disk are mostly generated as a system (user level load) – see (%user 15.34 and md0 2118.70).

For all those not familiar with system also called user / level load, this is all kind of load which is generated by running programs on the server – (any kind of load not generated by the Linux kernel or loaded kernel modules).

b) To periodically keep an eye on HDD i/o operations with iostat, there are two ways:

– Use watch in conjunction with iostat;

[root@centos ~]# watch "/usr/bin/iostat -m"
Every 2.0s: iostat -m Tue Mar 27 11:00:30 2012
Linux 2.6.32-5-amd64 (centos) 03/27/2012 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
15.34 0.36 2.76 2.66 0.00 78.88
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda 63.89 0.48 8.20 6730255 115574152
sdb 64.12 0.44 8.23 6244718 116072400
md0 2118.94 0.22 8.20 3041710 115560990
Device: tps MB_read/s MB_wrtn/s MB_read MB_wrtn
sda 55.00 0.01 25.75 0 51
sdb 52.50 0.00 24.75 0 49
md0 34661.00 0.01 135.38 0 270

Even though watch use and -d might appear like identical, they're not watch does refresh the screen, executing instruction similar to the clear command which clears screen on every 2 seconds, so the output looks like the top command refresh, while passing the -d 2 will output the iostat command output on every 2 secs in a row so all the data is visualized on the screen. Hence -d 2 in cases, where more thorough debug is necessery is better. However for a quick routine view watch + iostat is great too.

c) Outputting extra information for HDD input/output operations;

root@debian:~# iostat -x
Linux 2.6.32-5-amd64 (debian) 03/27/2012 _x86_64_ (8 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
15.34 0.36 2.76 2.66 0.00 78.88
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
sda 4.22 2047.33 12.01 51.88 977.44 16785.96 278.03 0.28 4.35 3.87 24.72
sdb 3.80 2047.61 11.97 52.15 906.93 16858.32 277.05 0.03 5.25 3.87 24.84
md0 0.00 0.00 20.72 2098.28 441.75 16784.05 8.13 0.00 0.00 0.00 0.00

This command will output extended useful Hard Disk info like;
r/s – number of read requests issued per second
w/s – number of write requests issued per second
rsec/s – numbers of sector reads per second
b>wsec/s – number of sectors wrote per second
etc. etc.

Most of ppl will never need to use this, but it is good to know it exists.

3. Tracking read / write (i/o) hard disk bottlenecks on FreeBSD

BSD's iostat is a bit different in terms of output and arguments.

a) Here is most basic use:

freebsd# /usr/sbin/iostat
tty ad0 cpu
tin tout KB/t tps MB/s us ni sy in id
1 561 45.18 44 1.95 14 0 5 0 82

b) Periodic watch of hdd i/o operations;

freebsd# iostat -c 10
tty ad0 cpu
tin tout KB/t tps MB/s us ni sy in id
1 562 45.19 44 1.95 14 0 5 0 82
0 307 51.96 113 5.73 44 0 24 0 32
0 234 58.12 98 5.56 16 0 7 0 77
0 43 0.00 0 0.00 1 0 0 0 99
0 485 0.00 0 0.00 2 0 0 0 98
0 43 0.00 0 0.00 0 0 1 0 99
0 43 0.00 0 0.00 0 0 0 0 100
...

As you see in the output, there is information like in the columns tty, tin, tout which is a bit hard to comprehend.
Thanksfully the tool has an option to print out only more essential i/o information:

freebsd# iostat -d -c 10
ad0
KB/t tps MB/s
45.19 44 1.95
58.12 97 5.52
54.81 108 5.78
0.00 0 0.00
0.00 0 0.00
0.00 0 0.00
20.48 25 0.50

The output info is quite self-explanatory.

Displaying a number of iostat values for hard disk reads can be also achieved by omitting -c option with:

freebsd# iostat -d 1 10
...

Tracking a specific hard disk partiotion with iostat is done with:

freebsd# iostat -n /dev/ad0s1a
tty cpu
tin tout us ni sy in id
1 577 14 0 5 0 81
c) Getting Hard disk read/write information with gstat

gstat is a FreeBSD tool to print statistics for GEOM disks. Its default behaviour is to refresh the screen in a similar fashion like top command, so its great for people who would like to periodically check all attached system hard disk and storage devices:

freebsd# gstat
dT: 1.002s w: 1.000s
L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name
0 10 0 0 0.0 10 260 2.6 15.6| ad0
0 10 0 0 0.0 10 260 2.6 11.4| ad0s1
0 10 0 0 0.0 10 260 2.8 12.5| ad0s1a
0 0 0 0 0.0 0 0 0.0 20.0| ad0s1b
0 0 0 0 0.0 0 0 0.0 0.0| ad0s1c
0 0 0 0 0.0 0 0 0.0 0.0| ad0s1d
0 0 0 0 0.0 0 0 0.0 0.0| ad0s1e
0 0 0 0 0.0 0 0 0.0 0.0| acd0

It even has colors if your tty supports colors 🙂

Another useful tool in debugging the culprit of excessive hdd I/O operations is procstat command:

Here is a sample procstat run to track (httpd) one of my processes imposing i/o hdd load:

freebsd# procstat -f 50404
PID COMM FD T V FLAGS REF OFFSET PRO NAME
50404 httpd cwd v d -------- - - - /
50404 httpd root v d -------- - - - /
50404 httpd 0 v c r------- 56 0 - -
50404 httpd 1 v c -w------ 56 0 - -
50404 httpd 2 v r -wa----- 56 75581 - /var/log/httpd-error.log
50404 httpd 3 s - rw------ 105 0 TCP ::.80 ::.0
50404 httpd 4 p - rw---n-- 56 0 - -
50404 httpd 5 p - rw------ 56 0 - -
50404 httpd 6 v r -wa----- 56 25161132 - /var/log/httpd-access.log
50404 httpd 7 v r rw------ 56 0 - /tmp/apr8QUOUW
50404 httpd 8 v r -w------ 56 0 - /var/run/accept.lock.49588
50404 httpd 9 v r -w------ 1 0 - /var/run/accept.lock.49588
50404 httpd 10 v r -w------ 1 0 - /tmp/apr8QUOUW
50404 httpd 11 ? - -------- 2 0 - -

Btw fstat is sometimes helpful in identifying the number of open files and trying to estimate which ones are putting the hdd load.
Hope this info helps someone. If you know better ways to track hdd excessive loads on Linux / BSD pls share 'em pls.
 

Convert WAV to MP3 in command line with LAME on Linux

Friday, April 8th, 2011

I needed to convert a bunch of files from WAV to MP3 format on my Linux desktop.

I’ve placed all my wav files to the directory /home/hipo/wav

And then I issued the small one liner script to convert the .wav files to .mp3 using the niftly lame linux mp3 convertor.

Here is how I did it:

linux-desktop:~$ cd wav
linux-desktop:/home/hipo/wav$ for i in *.wav; do
new_name=$(echo $i |sed -e 's#wav#mp3#g');
lame -V0 -h -b 160 --vbr-new "$i" "$new_name";
done

After executing the little script you might go and have a coffee, if you have thousands of files, each file convertion takes about 10-15 seconds of time (speed depends on your CPU).

Here is some output from a lame convertion to mp3 taking place:

Encoding as 8 kHz single-ch MPEG-2.5 Layer III VBR(q=0)
Frame | CPU time/estim | REAL time/estim | play/CPU | ETA
27237/27237 (100%)| 0:12/ 0:12| 0:12/ 0:12| 155.89x| 0:00
64 [27237] ***************************************************************
----------------------------------------------
kbps mono % long switch short %
64.0 100.0 84.1 8.9 7.0
If you want to save my convertion quickly for a later, download my Convert WAV to mp3 from a directory with lame shell script here

Actually there are plenty of other ways to convert wav to mp3 on Linux through mplayer, ffmpeg even with mpg123.

There are also some GUI programs that could do the convertion like winff , however for some weird reason after installing WinFF on my debian it was not able to complete convertion to mp3?!
But it doesn’t matter, the good news is I did what I wanted to via the simple lame program and the above script, hope it helps somebody out there.

Ancient Christian Coptic Oriental Orthodox icons – The reason for asymmetric body members in early Christian iconography

Monday, July 30th, 2012

While checking some information on Coptic Eastern Oriental faith, I've stumbled upon a very beautiful (and unique) ancient Orthodox Christian icon depicting Saint Menas and our saviour the Lord Jesus Christ, below is the very beautiful icon

Saint Mena (Sv. Mina) and The Lord Jesus Christ icon from 6th century

Saint Mena (Sv. Mina) and The Lord Jesus Christ icon from 6th century

As you can see the iconography is very interesting, the images differ from modern day iconography the portraits are not looking so serious but looks like "childish". This childish forms and faces on the early Christian iconography is not accidental; it expresses the childish like pure faith our Christian devoted ancestors had. This early Christian faith and spiritual life icon is obviously in conjunction with our Saviour Jesus Christ words as red in the Gospel according to Matthew:
 

At that time the disciples came to Jesus, saying, "Who then is greatest in the kingdom of heaven?" Then Jesus called a little child to Him, set him in the midst of them, and said, "Assuredly, I say to you, unless you are converted and become as little children, you will by no means enter the kingdom of heaven. Therefore whoever humbles himself as this little child is the greatest in the kingdom of heaven. Whoever receives one little child like this in My name receives Me.

Matthew 18:1-5

This icon as well as the early Christian icons are very different from nowdays iconography probably for reason;
the images difference, the seriousness and the lack of brightness in the faces of nowdays iconography is a clear sign of the great decay of both Orthodox Christian as well as the down-fall of spiritual life worldly.
I've seen similar childish looking image icons in some Bulgarian ancient relics museums in my child years and always thought the depictions are so kiddish because iconographers of that time did not have the painting knowledge and skills to draw better ones.
Now as I know Christianity much better than then, I understand my previous assumption for the reason of the kiddish looking images is wrong.
Saint Mena (Sv. Mina) and The Lord Jesus Christ icon from 6th century

Very interesting in the early Christian iconography are the shapes. If you take a close look to above icon, you will notice the disparity of the two body members; the hands, head and eyes are unusually big. My guess for the lack of correspondence of body members is the attempt of early iconographers to put accent on most important members of our bodies;

– The head (holding the mind and thoughts of the saints)
– The hands through which the daily food is raised and the eyes through which the world is comprehended are much bigger than in a real person portrait.
– The mouth which is almost the size of the eyes; obvious reference that for early Christian contemplating was much more precious (important) thing, than speech.
This is also in accordance with the New Testament holy scriptures which says like so concerning the tongue:
 

8 But no one can tame the tongue; it is a restless evil and full of deadly poison.
9 With it we bless our Lord and Father, and with it we curse men, who have been made in the likeness of God;
10 from the same mouth come both blessing and cursing. My brethren, these things ought not to be this way.
11 Does a fountain send out from the same opening both fresh and bitter water?
12 Can a fig tree, my brethren, produce olives, or a vine produce figs?
Nor can salt water produce fresh.

Notice also the Halos of the two saints, the size of the halos is almost one third of the whole body of the saints. The Gospel hold by our and all humanity Saviour Jesus Christ is also enormous sized; corresponding almost the height of the arm of Christ on the icon.
The size of the Gospel stresses out the importance of the Holy Bible writtings for early Christians. Nowdays the size of Gospels or Holy Bible especially among protestant Churches "tradition" is becoming smaller and smaller following the spirit of the time proclaiming mobility …

Today the iconography Orthodox Christian "school" has severely changed and the icon images are much more complicated than in ancient times.
The complication of images and elements on Orthodox Icons is a "mirror" of the internal complicated world of us modern-time Christians. This over-complication of our internal spiritual world, does separate us from God instead of uniting us as it is well known in Holy Orthodox Christian tradition God is best known through simplicity and pureness in life thoughts and actions.

The Coptic Oriental Orthodox Church is the only Church, where there is still iconographers drawing in the style of the ancient times childish looking icons. The reason Copts preserved this ancient iconography is that they have conservated big portion of the ancient faith rejecting the decisions of all 7 Orthodox Ecumenical Church Councils. Copts still accept only ecumenical council decisions up to the III-rd ecumenical council. This is also the reason why Eastern Oriental Orthodox Christians are considered not in official communion with the rest of Eastern Orthodox Churches. I had the opportunity by God's grace to meet an Coptic Orthodox Christian (a guy called Baky); From what I've seen and experienced within the few months with Baky my conclusion is Coptic Orthodox layman faith is much stronger than the one in most of other Orthodox Christians I know. The official standpoint of our Eastern Orthodox Church concerning the copts are that they're in heresy and not really orthodox. I'm not sure if this is really true, since I have spend few months with this Coptic Christian brother this autumn and winter and from what I've seen and heard as well as researched on coptic Orthodox it seems their overall Church teaching, Holy Liturgies and everything is very much orthodox (with very little service and faith differences). Here are few beautiful Coptic Orthodox Christian icons still being drawn in the spirit of early days Christianity.

Saint Abba Anthony the Great Coptic Oriental orthodox Icon

Abba (saint) Anthony the Great the father of Orthodox Christian Monastic Life

Coptic Orthodox Oriental Icon Abba Anthony and saint Paul

Coptic Orthodox Oriental Icon of Saint Anothony the Great – "the founder" of Monastic life

Coptic Oriental Orthodox Icon Tobias old testamential Book story

Tobias Old Testamential Story coptic icon

Holy Family Flight into Egypt Coptic Orthodox Icon

Holy Family – Flight into Egypt Coptic Orthodox oriental icon

Christ the Saviour Coptic Oriental Orthodox icon

Christ the Saviour – Coptic Oriental Orthodox icon

Holy Theotokos Coptic Oriental Orthodox icon

Holy Theotokos Coptic Oriental icon

Saint Athanasius defender of pure orthodoxy Oriental Orthodox icon

Saint Athnasius coptic orth icon

The Dormition of Holy Theotokos Mother Mary Coptic Orthodox Oriental Icon

The Dormition of Virgin Mary Coptic icon

Disabling PHP system(); and exec(); functions to raise up Apache security on Debian GNU / Linux

Wednesday, July 18th, 2012

Disabling PHP system(); and exec(); functions to raise up Apache security on Debian Gnu / Linux

At security critical hosts running Apache + PHP based sites it is recommended functions like:

system();
exec();shell_exec();.....

to be disabled. The reason is to mainly harden against script kiddies who might exploit your site/s and upload some shitty SK tool like PHP WebShell, PHP Shell and the probably thousands of “hacker” variations that exist nowdays.

In latest Debian stable Squeeze, suhosinadvanced protection module for php5 is being installed and enabled in Apache (by default).
Simply disabling a number of functions using suhosin, could prevent multiple of future headaches and hours of pondering on who 0wn3d your server ….

Disabling the basic PHP system(); and other similar functions which allows shell spawn is not always possible, since some websites or CMS platforms depends on them for proper runnig, anyways whether it is possible disabling ’em is a must.
There are two ways to disable system(); functions; One is through using /etc/php5/apache2/conf.d/suhosin.ini and 2nd by adding a list of functions that has to be disabled directly in Website Virtualhost file or in apache2.conf (/etc/apache2/apache2.conf;
For people hosting multiple virtualhost websites on the same server using the custom domain Virtualhost method is probably better, since on a global scale the functions could be enabled if some of the websites hosted on the server requires exec(); to work OK. In any case using /etc/php5/apache2/conf.d/suhosin.ini to disable system(); functions in PHP is less messy …

1. Disabling PHP system(); fuctions through /etc/apache2/apache2.conf and custom site Vhosts

Place somewhere (I prefer near the end of config);;;


php_admin_flag safe_mode on
php_admin_value disable_functions "system, exec, shell_exec, passthru , ini_alter, dl, pfsockopen, openlog, syslog, readlink, symlink, link, leak, fsockopen, popen, escapeshellcmd, apache_child_terminate apache_get_modules, apache_get_version, apache_getenv, apache_note,apache_setenv,virtual"

Disabling it for custom virtualhost is done by simply adding above Apache directvies (before the closing tag in /etc/apache2/sites-enabled/custom-vhost.com

2. Disabling PHP system();, exec(); shell spawn with suhosin.ini

In /etc/php5/apache2/conf.d/suhosin.ini add;;

suhosin.executor.func.blacklist =system, exec, shell_exec, passthru, ini_alter, dl,
pfsockopen, openlog, syslog, readlink, symlink, link, leak, fsockopen, popen,
escapeshellcmd, apache_child_terminate apache_get_modules, apache_get_version,
apache_getenv, apache_note,apache_setenv,virtual

To do it directly via shell issue;;;

server: conf.d/# cd /etc/php5/apache2/conf.d/
server: conf.d# echo 'suhosin.executor.func.blacklist =system, exec, shell_exec, passthru, ini_alter, dl,' >> suhosin.ini
server: conf.d# echo 'pfsockopen, openlog, syslog, readlink, symlink, link, leak, fsockopen, popen,' >> suhosin.ini
server: conf.d# echo escapeshellcmd, apache_child_terminate apache_get_modules, apache_get_version,' >> suhosin.ini
server: conf.d# echo 'apache_getenv, apache_note,apache_setenv,virtual' >> suhosin.ini

Then to re-load the memory loaded Apache libphp library an Apache restart is necessary;

server: conf.d# /etc/init.d/apache2 restart
Restarting web server: apache2 ... waiting .
server: conf.d#

Tadam, this should be quite a good security against annoying automated script attacks. Cheers 😉

How to fix bug with WordPress domain extra trailing slash (Double wordpress trailing slash)

Monday, July 9th, 2012

How to fix bug with wordpress extra slash, domain double slash issue pic

2 of the wordpress installations, I take care for had been reported an annoying bug today by some colleagues.
The bug consisted in double trailing slash at the end of the domain url e.g.;

http://our-company-domainname.com//

As a result in the urls everywhere there was the double trailing slash appearing i.e.::

http://our-company-domainname.com//countact-us/
http://our-company-domainname.com//languages/

etc.

The bug was reported to happen in the multiolingual version of the wordpress based sites, as the Qtranslate plugin is used on this installations to achieve multiple languages it seemed at first logical that the double slash domain and url wordpress issues are caused for some reason by qTranslate.

Therefore, I initially looked for the cause of the problem, within the wordpress admin settings for qTranslate plugin. After not finding any clue pointing the bug to be related to qTranslate, I've then checked the settings for each individual wordpress Page and Post (There in posts usually one can manually set the exact url pointing to each post and page).
The double slash appeared also in each Post and Page and it wasn't possible to edit the complete URL address to remove the double trailin slashes. My next assumption was the cause for the double slash appearing on each site link is because of something wrong with the sites .htaccess, therefore I checked in the wp main sites directory .htaccess
Strangely .htacces seemed OKAY and there was any rule that somehow might lead to double slashes in URL. WP-sites .htaccess looked like so:
 

server:/home/wp-site1/www# cat .htaccess
RewriteEngine On
RewriteBase /

# Rewrite rules for new content and scripts folder
RewriteRule ^jscripts/(.*)$ wp-includes/js/$1
RewriteRule ^gallery/(.*)$ wp-content/uploads/$1
RewriteRule ^modules/(.*)$ wp-content/plugins/$1
RewriteRule ^gui/(.*)/(.*)$ wp-content/themes/$1/$2 [L]

# Disable direct acceees to wp files if referer is not valid
#RewriteCond %{THE_REQUEST} .wp-*
#RewriteCond %{REQUEST_URI} .wp-*
#RewriteCond %{REQUEST_URI} !.*media-upload.php.*
#RewriteCond %{HTTP_REFERER} !.*cadia.*
#RewriteRule . /error404 [L]

# Standard WordPress rewrite
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Onwards, I thought a possible way to fix bug by adding mod_rewrite rules in .htaccess which would do a redirect all requests to http://www.our-company-domainname.com//contact-us/ to http://www.our-company-domainname.com//contact-us/ etc. like so:

RewriteRule ^/(.*)$ /$1

This for unknown reasons to me didn't worked either, finally thanks God I remembered to check the variables in wp-config.php (some month ago or so I added there some variables in order to improve the wordpress websites opening times).

I've figured out I did a mistake in one of the variables by adding an ending slash to the URL. The variable added was:

define('WP_HOME','http://our-company-domainname.com/');

whether instead it should be without the ending trailing slash like so:

define('WP_HOME','http://our-company-domainname.com');

By removing the ending trailing slash:

define('WP_HOME','http://our-company-domainname.com/');

to:

define('WP_HOME','http://our-company-domainname.com');
fixed the issue.
Cheers 😉

The lack of sharing in modern world – One more reason why sharing Movies and any data on the Internet should be always Legal

Saturday, July 7th, 2012

Importance of sharing in modern digital society, sharing should be legal, Sharing caring
 I've been thinking for a lot of time analyzing my already years ongoing passion for Free Software, trying to answer the question "What really made me be a keen user and follower of the ideology of the free software movement"?
I came to the conclusion it is the sharing part of free software that really made me a free software enthusiast. Let me explain ….

In our modern world sharing of personal goods (physical goods, love for fellows, money, resources etc.) has become critically low.The reason is probably the severely individualistic Western World modern culture model which seems to give good economic results.
Though western society might be successful in economic sense in man plan it is a big failure.
The high standard in social culture, the heavy social programming, high level of individualism and the collapsing spirituality in majority of people is probably the major key factors which influenced the modern society to turn into such a non-sharing culture that is almost ruling the whole world nations today.

If we go back a bit in time, one can easily see the idea and general philosophy of sharing is very ancient in nature. It was sharing that for years helped whole societies and culture grow and mature. Sharing is a fundamental part of Christian faith and many other religions as well and has been a people gathering point  for centuries.
However as modern man is more and more turning to the false fables of the materialistic origin of  man (Darwininsm), sharing is started seeing as unnecessary . Perhaps the decreased desire in people to share is also the reason why in large number people started being  self-interest oriented as most of us are nowadays.

As we share less and less of our physical and spiritual goods, our souls start being more and more empty day after day. Many people, especially in the western best developed societies; the masses attitude towards sharing is most evidently hostile.
Another factor which probably decreased our natural human desire to share is technocracy and changing of communication from physical as it used to be until few dacades to digital today.

The huge shift of communication from physical to digital, changes the whole essence of basic life, hence I believe at least the distorted sharing should be encouraged on the Internet (file movies and programs sharing) should be considered normal and not illegal..
I believe Using Free Software instead of non-free (proprietary) one is another thing through which we can stimulate sharing. If we as society appreciate our freedom at all  and  care for our children future, it is my firm conviction, we should do best to keep sharing as much as we can in both physical and digital sense.

Negative impact of Cell Phones (GSM) use on individual and society

Monday, June 25th, 2012

Negative impact of Cell Phones GSM on individual and society

We all live in an age, where cell-phone communication has become a standard part of our daily lives. As with everything new adopted in basic human life. GSM tool inclusion in our life had a severe impact on both individuals and in summary to whole society groups and nations.

The benefits out of having an instant “channel” for communication to anyone else in the world are indoubtfully numerous. However as present tosicety is learned to mostly thing in one direction, most people didn’t have a clear understanding on the negative impact of this little communicators on our mind body and soul.

1.; Negative impact of mobile phones on body level

Whenever we talk over the phone especially when picking up incoming calls or initiating out-going ones, the GSM device has to connect to the closest network cell “dial up” and wait for initialization of remote or local connection. The levels of radiation waves during the two mobiles connects up is higher. Therefore if one moves the phone near his ear listening for the status of call the amount of radiation that enters our brains is slightly higher. The extra-radiation whether mobiles are connecting is also few times more whether our phone is ringning, hence it is unhealthy to put the phone near our ear before we press the Answer Call button.

2.;; Negative effect of continuous mobile phones use on human brain

Knowing about the increased radiation on connection initialization thanksfully one can protect himself by simply not putting the mobile headset near ear on call initialization. Though this “problem” can be partially solved, next comes the health brain damage (tumours) which according to some researches are higher among people who do frequentlong phone call conversations. In long phone calls the brain is exposed for a longer time to the flowing waves making the peer to peer call possible. According to some medical researches, a long and frequent phone calls could be a reason not only for brain cancers but also other misfunctions or damages in normal brain cells functioning.

3.;;; The bad impact of Cell Phones on nervous system

Another health issue which the daily phone use and the constant exposure to mobile network cells radio frequency radiation affects generally our nervous system.

Unexpected phone calls early in morning or late at night are a cause for increased bodily stress and even the fear sometimes for an incoming phone call are a cause for many types of neurological disorders diagnosed by psychiatrists.
Even when we sleep at night the mobile phone periodically connects to the nearest mobile cell generating some almost undetectable “waves contamination”. This constant waves air flow caused by the mobile network cells positioned all around cities is not usual thing for our bodies. This also has some influence on our nervous system as the nervous sysm tends to be a bit more alert because of the waves constantly passing the body. The natural reaction of our bodies nerves is to try to balance itself. As nervous system of different people is not equal some people’s nervous system is more prone to having difficulties to balance the disbalance created by the increased number of mobile air waves.
The result of this to many people is in increased sleeplessnes and hardships to get asleep (according to research taken place in American Academy of Sleep Medicine.).

4.;;;; Lost of social and ethical behaviour in people

There is lately observed a huge shift from a face to face communication to peer to peer (p2p) on the phone. The cellphones breeds a culture of socially group detached people (the communication over phone is rarely a conference) but rather consists of communication between two persons (peer to peer). The p2p communication is not only a primary mean of communication of people exposed to heavy phone use. p2p Communication is a primary communication in Skype, Google Talk and mostly all modern available communication medias and softwares.

As more and more people spend nowdays more time on the mobile than in real communication, this makes them introverted and isolated and increases the inability to deal with real human f2f interaction. In other words continuous phone use re-trains us to communicate with others via the mobile. Besides that according to numerous researches about 40 to 50% of visual communication whether a phone call is used is lost (this also makes negotiation or expressing over phone harder and at least twice longer than in real communication).

The influence of the decreased social abilities cause of the phone use has also an impact on ethical behaviour of people too. The increased lost of communication abilities makes even daily real communication vague and lacking accepted social norms and ethical values. Next to that comes the huge problem of over-simplification of communication. As the line communication over the phone loose half of the communication as well as sometimes there are quality of voice over the network interferences. People are doing their best to simplify the communication adopting short command like like phrases and talking in a slang.

5.;;;;; Addiction to mobile phone use

The use of mobile phone often has a short beep sounds, whether you work on the keyboard receive a phone call or look for some mobile functionality staring at the screen. We’re wearing the mobile everywhere with us so often we do check the mobile screen quite un-consciously (by addiction). Checking the mobile screen to see what time is it has become almost an instinct and an automated learned behaviour.

The continous use of mobile phones makes many people mobile addicts. There are huge amount of people I’ve observed who speaks everyday for few hours (whether everytime they feel lonely they call someone in order not to feel lonely). The mobile phone addiction in youngsters is slighly higher than in adults. Probably the most mobile dependent addicts are kids who were given a mobile to use since there very early years.
Anyways there are tons of adults nowdays who cannot even think to be able to live without mobile and even cannot understand: how can anyone think that life could be possible without a cell phone. This kind of thinking is a direct trait showing an addiction and dependency on the phone such people have.

Trip to Romania ( TTR ) – Few of my impressions from Ro-Mania :)

Thursday, June 21st, 2012

I just came home from a short 4 days trip to Romania. I'm truly impressed by the beauty, the people goodness and their piety.

Over the last few years, I've visited Romania numerous times, most of the times I just crossed by car while traveling to Holland. My impressions the previous years were quite good already but I didn't have the opportunity until now to see how the country looks "from within" – I mean how the life flows there etc.

I've heard quite a lot of BAD thinks about corruption (from european parliament critics in new) and gipsy like people and plenty of bad stuff over the years.
This is all lies, the country people are not corrupt, they're just smart and find plenty of ways to earn money. For instance while I was traveling there were Romanians people selling raspberries brought by the nearby woods, the raspberry selling is not entering the treasury of the country and this is considered by the European Union corruption and a crime 🙂
Well talking about police, they're a bit corrupt and stopping you for no reason sometimes to ask if you can give them some coffee or cigarettes but i wouldn't put this police act as corruption it is rather an act the patrol police do in order to find some extra cash near the low sallaries received for serving in police 🙂

Well anyways my trip to Romania here are few of my travel notes. The whole travel Route was Bulgaria – Romania, the aim of my travel can be classified as business trip, since I was travelling with a relative's husband who was their to transfer some physical goods (a kind of logistics). The wohle trip started from my hometown Dobrich; we went through Silistra and Ruse and then the so famous Danube bridge. The roads in Bulgaria are not perfect and some regions were full of road holes, but this is normal since we have a harsh winter here and now a road recovery works are in progress on the roads. Crossing the Danube bridge, there is a custom police and they charge something like 23 BGN (Bulgarian levs) for crossing it. Then there is a border police check which as most people who travelled by bus or car over borders (out of Schengen) knows pretty well. You have to hand in your ID and it is checked by a policeman and if you're not in the list of WANTED CRIMINALS 🙂 they let you go. Some 500 meters or a 1 kilometer after that is the Romanian border police which (since not part of Schengen yet checks your traveller ID again).

In Romania we travelled through Gurgevo which is one of the closest cities to Danube river bridgeroad and one of nearest romanian cities to Bulgaria.
Our first destination was a place in Romania called Targo Mures, to go their our route passed through the side road of Bucuresht – Bururesti as Domneles (misters) calls it.

As I'm trying to live an Orthodox Christian life the most striking think from the moment we entered Romania to the one we went off it was the number of Churches, Crucifix and religious references one can see by just crossing the country roads.
Many villages in Romania had 2 or 3 Churches a small chapels a Cross on the road sidewalks etc. Even many Romanian houses almost everywhere had a Christian Cross on top of the house or on the house door. Putting a Christian cross on top of your home is something I myself has thought of and wondered why Christians did not put here in Bulgaria and other Christian countries seeing this being a reality in RO-MANIA 🙂 was unexpected.

Other from my impression is that Romanian people work hard and a lot of them live in the village, owning a small land to grow vegetables and animals (sheeps and cows) mostly. While driving we saw on many places shepherds with large herds of sheeps, people mowing and generally many people who seemed to be working hard to grow their own food. This really made sense since here in Bulgaria grievously animals are rarely grown by country people and most people are living in cities (our rural population is very small).
Growing myself vegetables and having sheeps and living a village life is one of my dreams so seeing so many people growing big portion (if not all of their food on their own) especially in this crazy super-market times is really something that gives me hope, we're not completely doomed yet.

Biggest part of Romania is Orthodox Christian, while the deep central part and the western part is Roman Catholic. Nomatter the differences between the two the people in both parts seemed to live in piece. The western part was visibly more developed than the eastern.
In my observations the western part of Romania is highly influenced by Hungarian culture and architecture, while a lot of Hungarians live their today. We went through Sigishuara which seemed to be mostly Roman Catholic though I saw some Orthodox Church too on the city center. Sigishuara is amazingly beautiful. The people we met all throughout the trip was extremely friendly and always wanted to help and threated us like true Christians, something one can rarely see happening nowdays …

Most of Romania we travelled is mountain covered and the air was extremely clean, so when you're even breathing you feel very different and alive if compared to whether in my hometown.
Brasov is one of the big cities in Romania but its construction is not too much concentrated, the city is quite scattered consisting of neap houses up to few stages per hight. Generally in Romania I haven't seen too high buildings almost anywhere, in Bucurest there are some but still they're not so tall as the blocks in Bulgaria or some other ex-communist countries.

Something interesting about Brasov is that near it is Transilvania and a castle in a small village (or town) called Bran, the castle is dating back from the 12 century and is told to be the original castle where Count Dracula lived. Perhaps the region is filled with Vampire stories but unfortunately my knowledge in Romanesco was so poor so I couldn't get into contact to locals to ask for that (neither I had the time to).

Bran Count Dracula Castle

Bran castle was restored a couple of times and has been a host for the royal family of Romania (many Romanian kings, princesses) through the middle ages in Communistic time it was abandoned and just recently it was turned to a cultural museum (probably part of UNESCO).

The castle is located on a high rock and near it is a beatiful garden and an old times mention. In the castle there are plenty of objects left and traditional princess dresses, pictures, a cinema room, an ancient torture room and plenty of other medievel furniture.
The price was normal 25 LEU (the romanian currency), this equals to something like 6,5 EURO.

On the road, while travelling in Romania on many places you see the signs reading <b> DRUM BUN</b>: which in English means <b>"Have you a good trip"</b>.
During our way back from Bran we travelled through another mountain region – Sinaia.
The prices of food in the super-markets in Romania are quite almost same like in Bulgaria and if compared to western europe many products can be considered even cheap. The quality of food I found to be quite satisfying. A lot of people in Romania are still selling home made yellow cheese and natural grown products in villages as well as I've seen plenty of this street old fashioned tradesman which I like so much on the streets. The country roads especially the central ones and highways were quite good too. Well there is a lot to be said but unfortunately I don't have the time to prolonge this post anymore. In the mountain areas there were some sinaguture for monasteries according to what I've heard from some priests here in Bulgaria in Romania currently they have 7000 Orthodox Christian MONKS! ! ! The number is amazing high just for a comparison in Bulgaria as of time of writting we have not more than 300 monks.

Our trip thanksfully was safe and every romanian we met or ask anything was more than welcome to us and tried his best to help us. Finally it was time and we hit the road back to Bulgaria through Danube riverbridge – the bridge road is a bit better than before some holes are filled in but still there are plenty of holes.
We had to pass through the Romanian Customs and pay a fee for passing by and later were checked by Bulgarian border police – thanksfully with no problems. We had to deliver some cargo to Karnobat in Bulgaria so we passed by there and then through Burgas headed back through Stara Planina (Old Mountain) which is amazingly beautiful mountain and is a must visit place for any keen on mountain tourism.

Thanks God I came back home alive and well and here I am writting this post. To sum it up if I have to grade America and being asked if it is worthy as a tourist destination I would say not only worthy but it is a real pearl you must see!
 

Color Psychology – Color Mind Programming or how big companies boost their sales and make up your mind

Thursday, June 21st, 2012

Colors Programming Color mind Programming, how big companies boost their sales and make up your mind

As I've pointed earlier there is plenty of "secretly" kept and less known by public research on how colors influence us daily. The biggest companies are heavily taking advantage of what is found and known for colors impact on our minds (psyche). Actually there is a whole branch in psychology which deals with impact of colors perception on us.Besides companies, many modern governments are well aware of the many facts on how citizens percept colors and use this in color 'installment' in government offices and government institutions.

There is no universal knowledge on how colors completely affect us as every human on earth is very unique and saying this or that color has this or that impact on indivirual or group is not 100% accurate. However there are general traits nowdays formed especially with globalization and unification of TV ads and big companies corporate image, a unification started on how different nationality people perceive colors.

Nowdays in developed countries there are more and more people who perceive certain colors in similar fashion. Therefore every serious top marketer should carefully study colors and their relation with ancient time people believes and understanding on what each of the 'rainbow' colors symbolize. Most likely because there is no completely unified understanding of colors between various individuals may companies like Google and Microsoft started using all the rainbow colors in their basic company logos and branding for more on this topic please check my previous blog post Color trick Microsoft and Google use to keep their users loyal

Another large industry area, where color programming is very heavy is Computer and Video Games. You certainly still remember large portions of the games like Sega’s Sonic the HendgeHog or Mario Super Bros. or even the old arcade machines with games like Punisher or Cadillacs and Dinosaurs, Street Fighter etc.
All this old arcade games have a big portion of Color programming embedded in and this is one of the main reasons we remember them for a long time and playing them evoked such a strong feelings in youth.

This trend of using colors to make up our minds is being observed for many other physical goods as well as is starting to get more and more heavy adoption by websites branding on the internet.
Actually those with most succesful businesses on the internet have already integrated some kind of color programming scheme. An example for this would be the Internet top domain names seller GoDaddy. The have adopted a green scheme as a primary color combined with some other ones to create in the customer a feeling of ecology, naturality, peace and solitude.

The study of color programming is one major field to be known by anyone truly willing to understand why certain big store chainslike Carrefour, Lidl, Billa, MediaMarkt – in western europe or TechnoMarket, TechnoPolis (MediaMarkt copied tech equipment by shops here in Bulgaria) are decorated inside the way they are. I personally didn't like the concept of color programming since from Spiritual point of view it is a big evil. Trying to manipulate people perception to do something you would like to in general is very evil from spiritual point of view. A mixture of rainbow colors in a natural environment for example flowers in the wood or wild mountain place is one thing, but making it artificial and placing it in certain pre-desired order is totally another. Besides that the colors in the natural environment are natural and therefore the impact on us even if colorful is very much better than if it is done with a certain intention like in the big supermarkets stores, fast just food companies – McDonalds, Burger King etc.

The research on color mind influcence – Color mind programming is a controversial science. Nowdays many big businesses however use this as a granted science, even whole business sects with some mambo-jambo believes universities, children garden and schools in modern countries have employed the use of some type of color programming aiming to influence their pupils, students (organizational members – you call it).
Color mind programming and heavy use on advertisements on the TV, the Internet, Stores and mostly everywhere are however starting to took their tolls. The high increase in mental problems and dumbness in developed and some undeveloped countries as well as the increased number of people who go insane because of too much color programming is reality. The believe that mental programming is one of the ultimate tools to influence somebody and push him to do things you want like consome more of a product or generally consume (buy) more goods creates another severe issue it makes people to constantly over-consume (eat more than the body needs) and this increases the number of over-consumption evoked diseases …

But color programming doesn't stop with just the material (physical) surrounding world it is a concept highly employed in online based marketing. Online business is seen on so many top used websites, social networks like take for instance (facebook). It is so spread that even the software primary vendors like Microsoft, search engines Google Inc. have already heavily employed the color programming as a basis of their products.

There is another reason why most vendors nowdays issue their physical or 'virtual' products so colorful using all the colors of the rainbow. The reason is the fact that as a kids through animation, cartoons, toys and surrounding environment we have been exposed already even from our very youth age to a kind of color programming through kids toys we've been given by our parents). Hence the young years color programming became a basis for a future time color programming. The colorfulness of our kids years are already sub-consciously stored in our minds, so almost naturally there is a feeling of joy to pop-up once we see something childishly colorful.