It was really steressing day. All started with a lot of calls to NetInfo’s Office then to our Office in Varna to explain what is happening to one of our servers design-bg.net. In the end after 2 hours of stress and even more everything come on it’s place Praise the LORD for this he helped me. Right after design-bg.net was up mail.design.bg almost freeze with God’s help everything came to normal after a simple reboot. In 12:00 to 12:40 I drunk coffee with some friends, after that spent some time in the library. In 14:15 the management test seemed to be in a small room and I was able to copy stuff from my collegues on the test:] Yeash CopyCat :]. Mitko and Habib was my guests today and we ate spinach’s soup with green salad and plant yellow cheese. Thanks to the Lord for being merciful over my sins. Yesterday I got drunk I drunk 200 gr. of ROM and 1 beer. After that I went home singing and listening to Metallica’s songs simultaneously, there was odd movement red eyes and head banging for almost an hour :]. I spend so many things for absolutely useless things, I am ashamed of myself. I acted like an animal. I really wonder why the world still exists If it’s such an awful place to be. I really doubt about the meaning of my life. Things seems to go in a bad way for me and a lot of ppl around me. I really hope the Lord will interfere and everything will come to place but who knows the Paths the Creator has created for us? END—–
Posts Tagged ‘bg’
Blah Blah
Tuesday, February 27th, 2007Tags: awful place, Beer, bg, Blah, coffee, collegues, CopyCat, end, everything, green salad, habib, HEAD, mail design, meaning of my life, Metallica, Mitko, movement, Netinfo, place, ppl, Praise, Reboot, red eyes, ROM, salad, singing, soup, spinach, stress, test, thanks to the lord, time, useless things, varna, Yeash, yellow cheese
Posted in Everyday Life | No Comments »
For the School-examination
Thursday, January 31st, 2008Tell me which ideotic government would create a site based on php and would make the serverunder Windows?
Just Guess ours the Bulgarian ministry of Science and Knowledge has started a new site dedicated to helping graduating school pupils with the Future School-examinationthey have to make.
It’s pretty easy to see that just observe:
jericho% telnet zamaturite.bg 80
Trying 212.122.183.208…
Connected to zamaturite.bg.
Escape character is ‘^]’.
HEAD / HTTP/1.0HTTP/1.1 200 OK
Connection: close
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Date: Wed, 30 Jan 2008 19:10:18 GMT
Content-Type: text/html; charset=UTF-8Server: Apache/2.2.6 (Win32) PHP/5.2.5X-Powered-By: PHP/5.2.5Set-Cookie: PHPSESSID=fn5jtjbet7clrapi0a5e5kgvt7; path=/
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Keep-Alive: timeout=5, max=100
Connection closed by foreign host.
jericho%
Just great our Bulgarian government spend money on buying proprietary software OS to run a Free Software based solution.
This example is pretty examplary of what our country looks like. Sad …
END—–
Tags: Alive, apache 2, bg, bulgarian government, Cache, cache control, charset, content type, Cookie, Date, Expires, Free, free software, future school, government, HEAD, host, HTTP, jtjbet, knowledge, money, php, php 5, proprietary software, school pupils, science, server, Set, software, text, text html, UTF, zamaturite
Posted in Everyday Life, Various | No Comments »
To Lumier with a bike the yesterday “action”
Monday, February 16th, 2009Saturday was quite shaking. The morning start yearly around 8:30.Anton a friend of mine for whom I am working and for whom I am admining twoservers. Called yearly in the morning and informed me that winner.bg is not working for several hours. I logged on the server and tried to see what’s wrong.It seemed that the whole MySQL was quite messy. It even refuses to start.There were corrupted data the system seemed to be restarted twice.I won’t enter into much details here just put some moral mostly.I was desperate things looked like everything was lost. The old sqlbackups made by the automated script I use were completely useless causethey were dumped with characterset latin1 …. So everything which was in cp1251appeared like “?” questionmarks. I thought there was encoding problem and the problem might be solved with iconv, however unfortunately that was not the case.The dumps were completely useless. So as a prescription if you use cp1251 or koi8r or any cyrillic encoding and you’ve explicitly definition in /etc/my.cnfoutlining that be sure not to dump with –default-character-set=latin1 ! Never ever! do this. At a moment I felt completely forgotten by God doubt came along for a second, nevertheless I started praying even though only with hope and without faith enough I screamed “Lord Jesus Christ, Son of the Blessed God, have mercy on me the sinner!”. Eventually until 16:45 most of the problems were fixed. Praise the Lord! Hallelujah! I could see one more time clearly God fixing things for me. To be honest I was so messed at a poing before all came to its place that I was not knowing exactly what I am doing. I followed a couple of steps one of which was completely unsinstall the mysql server and exchange it with 5.0.75 from 5.0.65. I had to switch to innodb recovery mode level 4 and dump some of the databases and import them back. A lot of the databases I simply copied in binary format to the newly created sql server. The sql server started working again ! Blessed be God My helped and refugee! I did some shopping on Saturday 5:30 ’till 18:00. Then I tried to recover the databaess with the screwed cyrillic letters. I had to contact ganchev “shudder” a friend of mine who is pretty good in coding and worked at the same company I did for some years. He couldn’t help however he advised me to check the dumps with hexdump -C and see if the “?” questionmarks are questionmarks. In my case they were so the backups were completely useless. I was lucky that one of the database my friend Tony has backed up and the other one was for a website who was started just a few days before so data there could be recovered with a little effort and it’s not gonna be so fatal I guess. Later on during the evening I updated a couple of services like apache php eaccelerator and so on on the two freebsd servers I take care for. On the Sunday morning I had to fix a little thing a consequence from the nightly update. The php5-gd port didn’t upgraded with the portupgrade -ri cause according to portaudit it has a security flaw. However quite flashy and luckily I fixed the problem. The rest of the Sunday I spend in talks with Paco, then we went to Sali and went to Lumiere the coffee restaurant where Sali managed to arrange work for Papi. The idea of us going there was to negotiate if possible to increase Papi’s daily sallary cause today he receives only 20 EUR per day for 10 hours of work. We went to Lumiere with Bikes that Sali gave us. On our way Papi fall off his bike and hurt his leg badly … 🙁 We went there and drinked coffee, thanks God they didn’t charged me for the coffee because the restaurant owners (Aidyn and Tazira) said the coffee I don’t need to pay for. After that we went back home we had small argue with Papi for which I deeply regret. I should thanks God for granting me from his divine mercy and doing so much for me the sinner. Quite in a few minutes I’ll be praying a bit and going to bed. Let’s hope that the Lord will be blessing me and helping me in my work and studies in the coming week just like he did so far. Just to conclude my post. Glory be to you Almighty and all merciful Lord my stronghold and my refugee! Hallelujah!END—–
Tags: action, bg, cause, characterset, coffee, corrupted data, databases, default character, doubt, dumps, everything, faith, god have mercy, Hallelujah, iconv, jesus christ son, level, lord jesus christ, Lumier, mysql server, php, place, poing, Praise, quot, recovery mode, Sali, second, sinner, time, winner, work, yesterday
Posted in Everyday Life | No Comments »
How to Prevent Server inaccessibility by using a secondary SSH Server access port
Monday, December 12th, 2011One of the Debian servers’s SSH daemon suddenly become inaccessible today. While trying to ssh I experienced the following error:
$ ssh root@my-server.net -v
OpenSSH_5.8p1 Debian-2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to mx.soccerfame.com [83.170.104.169] port 22.
debug1: Connection established.
debug1: identity file /home/hipo/.ssh/id_rsa type -1
debug1: identity file /home/hipo/.ssh/id_rsa-cert type -1
debug1: identity file /home/hipo/.ssh/id_dsa type -1
debug1: identity file /home/hipo/.ssh/id_dsa-cert type -1
...
Connection closed by remote host
Interestingly only the SSH server and sometimes the mail server was failing to respond and therefore any mean to access the server was lost. Anyways some of the services on the server for example Nginx continued working just fine.
Some time ago while still working for design.bg – web development company, I’ve experienced some similar errors with SSH servers, so I already had a clue, on a way to work around the issue and to secure myself against the situation to loose access to remote server because the secure shell daemon has broken up.
My work around is actually very simple, I run a secondary sshd (different sshd instance) listening on a different port number.
To do so I invoke the sshd daemon on port 2207 like so:
debian:~# /usr/sbin/sshd -p 2207
debian:~#
Besides that to ensure my sshd -p 2207 will be running on next boot I add:
/usr/sbin/sshd -p 2207
to /etc/rc.local (before the script end line exit 0 ). I do set the sshd -p 2207 to run via /etc/rc.local on purpose instead of directly adding a Port 2207 line in /etc/ssh/sshd_config. The reason, why I’m not using /etc/ssh/sshd_config is that I’m not sure if using the sshd config to set a secondary port does run the port under a different sshd parent. If using the config doesn’t run the separate ssh port under a different server parent this will mean that once the main parent hangs, the secondary port will become inaccessible as well.
Tags: bg, clue, com, company, config, configuration data, doesn, exit, file, hipo, host, instance, mail server, mx, nginx, number, openssl, parent, port 22, reason, remote server, root, RSA, script, secure shell, server, Shell, shell daemon, soccerfame, ssh port, ssh server, ssh servers, sshd daemon, time, type, usr, web development company, work
Posted in FreeBSD, Linux, System Administration | No Comments »
How to convert UTF-8 encoding files to Windows CP1251 on GNU / Linux
Friday, October 21st, 2011I needed to convert a file which had a Bulgarian text written in UTF-8 encoding to Windows CP1251 in order to fix a website encoding problems after a move of the website from one physical server to another.
I tried first with enca – ( detects and convert encoding of text files from one encoding to another).
The exact way I tried to convert was:
linux:~# enca -L bg /home/site/www/includes/utf8_encoded_file.php
Unfortunately this attempt to conver was unsucesfully, and the second logical guess was to use iconv – Convert encoding of given files from one encoding to another to do the utf8 to cp1251 conversion.
...
I reached for some help in irc.freenode.net, #varnalab channel and Alex Kuklin helped me, giving me an example command line to do the conversion.
iconv winedows to cp1251 conversion line, he pointed to me was:
linux:~# iconv -f utf8 -t cp1251 < in > out
Further on I adapted Alex’s example to convert my utf8_encoded_file.php encoded Bulgarian characted to CP1251 and used the following commands to convert and create backups of my original UTF8 file:
linux:~# cd /home/site/www/includes
linux:/home/site/www/includes# iconv -f utf8 -t cp1251 < utf8_encoded_file.php in > utf8_encoded_file.php.cp1251
linux:/home/site/www/includes# mv utf8_encoded_file.php utf8_encoded_file.php.bak
linux:/home/site/www/includes# mv utf8_encoded_file.php.cp1251 utf8_encoded_file.php
Tags: alex, attempt, bg, bulgarian text, cd home, command, conver, conversion, Convert, enca, file, file linux, freenode, gnu linux, guess, help, home, iconv, includeslinux, line, Linux, lt, move, mv, order, outFurther, php, physical server, UTF, varnalab, way, www
Posted in Linux, System Administration, Various, Web and CMS | No Comments »
How to configure Squirrel webmail to play nice with Bulgarian UTF-8 character encoding
Saturday, August 27th, 2011Yesterday, most of the time I’m playing around with Squirrelmail, finally, time came when I had enough free time to fix the squirrelmail installed on mail.www.pc-freak.net
The installed version there has been broken after upgrade of the Apache webserver on the FreeBSD and failed with some stupid preg_match exception immediately after a user tries to login, anyways I decided to not install the squirrelmail from freebsd ports but rather download it directly from squirrelmail.org .
Installation went smoothly, however after testing to send email typing the email in Bulgarian with a default charset of (UTF-8) set from the Desktop machine from which I’ve written it, suddenly the sent emails encoding ended garbled.
One of my employees complained about receiving emails which are unreadable thus I proceeded immediately to check and fix the webmail letters encoding.
My logical first assumption was that the problem is caused by the FreeBSD missing a correct locale, thus the first thing I did in order to isolate the problem was check the installed locales:
pcfreak# locale -a | grep -i UTF-8|wc -l
56
As the above command output shows an UTF-8 locales was installed so I further checked if a specific locale for Bulgarian UTF-8 – bg_BG.UTF-8 is installed on the system:
pcfreak# locale -a |grep bg_BG.UTF-8
bg_BG.UTF-8
Being sure that the bg_BG.UTF-8 is installed I excluded missing locales as a possible problem cause.
Next I’ve noticed that locale command returns a default setting for my root and users set to:
pcfreak# locale
LANG=en_US.ISO8859-1
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
Obviously the en_US.ISO8859-1 is not compatible with UTF-8, so I had to change a consult with the FreeBSD handbook suggested a way to change the LANG and LC_COLLATE locale set variables by creating a ~/.login_conf inside the user home directory which default locale has to be set.
In my case I assumed that possible the improper LANG is set to the running Apache as Apache is run via the init script /usr/local/etc/rc.d/apache2 , therefore to work it around for apache either I had to add manually:
LANG=bg_BG.UTF-8
somewhere near the beginning of the Apache init script, or alternatively set a proper .login.conf inside the root user home dir, e.g. /root/.login.conf. An example file which sets the default locale for the root user on BSD to LANG=bg_BG.UTF-8 , is shown below:
pcfreak# cat /root/.login_conf
me:
:charset=UTF-8:
:lang=bg_BG.UTF-8:
To fix the default encoding to be set to bg_BG.UTF-8 in all shell user accounts existing on pc-freak, I used a small script which copies the /root/.login_conf to all /home directories and immediately after chowns the user to be owned by the respective user, here is bash one liner script used:
pcfreak# cd /home; for i in $(echo *); do cp -rpf /root/.login_conf $i/; chown $i:$i $i/.login_conf; done;
Now after relogging to all active shells the default LANG character setting and LC_COLLATE were changed and I could see this by issuing again the locale command:
pcfreak# locale
LANG=bg_BG.UTF-8
LC_CTYPE="bg_BG.UTF-8"
LC_COLLATE="bg_BG.UTF-8"
LC_TIME="bg_BG.UTF-8"
LC_NUMERIC="bg_BG.UTF-8"
LC_MONETARY="bg_BG.UTF-8"
LC_MESSAGES="bg_BG.UTF-8"
LC_ALL=
To make sure the apache is reading the new LANG locale settings, further on I forced apache restart:
pcfreak# /usr/local/etc/rc.d/apache2 restart
I opened a browser and sent one more mail typed in cyrillic with squirrelmail addressing my own email to test, if finally the mail char encoding issues are gone. But NOO!! still the same issue.
I was out of ideas as it seems there was no logical reason for the cyrillic letters to break when sent via squirrelmail.
And then the lightbulb was up with the idea to check the squirrelmail configuration encoding itself, thus I launched immediately the squirrel ./configure script and guess what, the encoding there was also imroperly SET to en_US.ISO8859-1!
pcfreak# cd /var/www/webmail; ./configureSquirrelMail Configuration : Read: config.php (1.4.0)
----------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
...
8. Plugins
9. Database
10. Languages
Command >> 10
SquirrelMail Configuration : Read: config.php (1.4.0)
----------------------------------------
Language preferences
1. Default Language : eu_US
2. Default Charset : en_US.ISO8859-1
3. Enable lossy encoding : false
Command >>
To change the encoding to properly play with Bulgarian, cyrillic in UTF-8 I choose:
Command >> 1
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.
[en_US]: bg_BG
Command >> 2
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.
[en_US.ISO8859-1]: bg_BG.UTF-8
Finally to save the new settings into squirrelmail configuration used the S cmd:
Command >> S
...
And Hallelujah! My Bulgarian letters started being properly encoded and sent in squirrelmail 😉 thx God
Tags: apache webserver, assumption, bg, charset, code, collate, config, configure, CTYPE, default locale, Desktop, desktop machine, download, exception, free time, freebsd handbook, freebsd ports, grep, home directory, init, installed version, ISO, lc, login, machine, mail, MONETARY, numeric, pcfreak, php, preg, root, script, Squirrel, thislanguage, time, time c, utf 8, webmail
Posted in Linux, Linux and FreeBSD Desktop, System Administration, Web and CMS | 1 Comment »