Archive for February, 2010

Complete guide to fix PulseAudio and video/audio VLC Media Player issues (F11_VLC_and_PulseAudio_Guide.pdf)

Tuesday, February 9th, 2010

I’ve found a nice guide discussing some major common problem with pulseaudio and VLC,
sound and video streaming annoyances.
The guide was available only through fedoraforum.org
and in order to fetch it the user needs account in fedoraforum, that is incredibly annoying.
Originally the guide targetted Fedora and other RedHat based distributions, however most
of the information in the tutorial is pretty accurate on other distributions as well.
For instance I use Debian and almost everything described in the tutor is equivalent;
So, Here is download link to the F11_VLC_and_PulseAudio_Guide.pdf
I hope this mirror of F11_VLC_and_PulseAudio_Guide.pdf
would save some time and nerves needed for registration in fedoraforum.org in order to download the file

Fixing video playback issues with VLC Media Player

Tuesday, February 9th, 2010

We are going to fix the chopping, skipping and stutter of the audio with VLC Media Player that sometimes is experienced.
First, open VLC and go to Tools > Preferences. (CTRL+P for those who cant find it)
Hit the Audio tab and change Output: Type to Pulseaudio audio output;
As shown in the picture below:

vlc preferences

Now, change the Show settings option to All and go to Input / Codecs > Access Modules > File ;
Change the caching value to 1500 (there are 1000 milliseconds in a second), 1200 should be okay as well.

vlc preferences

You can adjust this a little higher or lower later. As long as it’s 1000 or above, it should be fine.

phpMyAdmin – Error “Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.”

Monday, February 8th, 2010

I’ve encountered a shitty problem while trying to access my phpmyadmin.
Here is the error:
phpMyAdmin - Error "Cannot start session without errors, please check errors given
in your PHP and/or webserver log file and configure your PHP installation properly.

After some time spend in investigation I’ve figured out something wrong is happening with my
php sessions, therefore I had to spend some time assuring myself php sessions are working correctly.
To achieve that I used a php code taken from the Internet.

Here is a link to the PHP code which checks, if sessions are correctly configured on a server .
Executing the code proove my sessions, are working okay, however still the problem remained.
Everytime I tried accessing phpMyAdmin I was unpleasently suprised by by:

phpmyadmin session error picture
After reconsidering the whole situation I remembered that since some time I’m using varnishd
therefore the problem could have something to do with the varnish-cache.
After checking my default.vcl file and recognizing a problem there I had to remove the following piece
of code from the default.vcl file:

#sub vcl_fetch {
# if( req.request != "POST" )
# {
# unset obj.http.set-cookie;
# }

# set obj.ttl = 600s;
# set obj.prefetch = -30s;
# deliver;
#}

Now after restarting varnishd with:

/usr/local/etc/rc.d/varnishd restart

All is back to normal I can login to PhpMyAdmin and everything is fine!
Thanks God.

Download scanned electronic version of The way of the Rat: A Survival Guide to Office Politics by Joep P. M. Schrijvers

Monday, February 8th, 2010

The way of the rat cover

We were obliged in Arnhem Business School to read the book, The way of the rat: A Survival Guide to Office Politics
I looked for the book everywhere online in Torrents, all kind of download areas etc. and I couldn’t find the book
anywhere. I finally surrendered and decided to purchase the book via ebay
It took it a month or so to come to my address, anyways in the meantime I met a friend, who borrowed the book
from a friend and scanned the entire book.
I asked if I can own the copy so he was generous and shared it, so I thought many other students like me
would be looking for the book in a desperate attempt to save some approximately $10 EUR (that’s the book costs).

That is why I copied the scanned version of the Way of the Rat to my personal apache web server and decided to
share it here.

Follow the link below to download:
Download here The way of the Rat: A Survival Guide to OfficePolitics
I have to warn you the scanning quality is terrible, though the text is readable.
Hope the book would be of use to some students out there who are studying business management.

Fix to annoying reoccuring problem “Enter password for default keyring to unlock”

Monday, February 8th, 2010

About a week and a half, everytime I do start my epiphany browser a really annoying prompt
occurs. Here is a screenshot of the gnome default keyring to unlock I was required to fill in,
everytime I started epiphany.
keyring prompt picture

I know one possible solution was to completely eradicate gnome-keyring package, however
that is definitely not a wise idea.
To fix this mimor though annoying issue I did the following:

1. Opened gnome-control-center (e.g. pressed alt+f2 and issued the gnome-control-center command)
2. Next find the "Encryption and Keyrings" menu and click on it
3. On the "Encryption and Keyrings" submenu "PGP Passphrases" I had to select
"Always remember passphrases whenever logged in
This is it, the annoying prompt won’t bother you anymore!
🙂

Howto to detect file encoding and convert default encoding of given files from one encoding to another on GNU/Linux and FreeBSD

Sunday, February 7th, 2010

I wanted to convert an html document character encoding to UTF-8, to achieve that of
course it was first needed to determine what kind of character encoding was used in
creation time of the file.
First thing I tried was:

hipo@noah:~/Desktop/test$ file File-Whole.htm
File-Whole.htm: HTML document text

as you can see that’s shit cause for some reason mime encoding is not printed by the file
command.
Next what I tried was:
hipo@noah:~/Desktop/test$ file --mime File-Whole.htm1File-Whole.htm1: text/html; charset=unknown-8bit

Here you see that character encoding is reported as charset=unknown-8bit which
ain’t cool at all and is of no use and prompts an error if I try it in iconv
Here is why I needed concretely to determine what kind of character set my file uses to later
be able to convert it using iconv .
To achieve my goal after consulting with Mr. Google , I found
out about enca — detect and convert encoding of text files
It’s obviously my lucky day because good guys from Debian has packaged enca so, everything came to the point of
apt-getting it.
# apt-get install enca

On FreeBSD enca port is available, so installing it cames simply to installing it from port tree.
Here is how:
pcfreak# cd /usr/ports/converters/enca;pcfreak# make install clean

Now I tried launching enca directly without any program parameters, but I was unlucky:

hipo@noah:~/Desktop/test$ enca file-Whole.htm
enca: Cannot determine (or understand) your language preferences.
Please use `-L language', or `-L none' if your language is not supported
(only a few multibyte encodings can be recognized then).
Run `enca --list languages' to get a list of supported languages.

I gave it another try, following prescribed usage parameters though I first checked my possibility
as a languages I can pass by to enca’s -L parameter.
Preliminary knowing that my text contains text in Bulgarian language, it wasn’t such a big deal
for me to determine the required language:

hipo@noah:~/Desktop/test$ enca -L bulgarian File-Whole.htm
transformation format 8 bits; CP1251

Knowing my character set all left for me was to do do the convert to UTF-8 to make text,
much more accessible.

hipo@noah:~/Desktop/test$ iconv --from-code=unknown-8bit --to=UTF-8 File-Whole.htm > File-Whole.htm.new
hipo@noah:~/Desktop/test$ mv File-Whole.htm.new File-Whole.htm

Well here we are conversion mission accomplished 🙂

What is Sufism (An interesting Muslim Sect, combining teachings from both Islam and Christianity)

Sunday, February 7th, 2010

I decided to blog about Sufism , cause I found it really interesting. I first heard about Sufism, as areligious stream as a reference following some readings about Rumi Mevlana after
I’ve been shown a video about his attained great wisdom by an ex-student
Turkish colleague of mine (Burdji).
Mevlana (or Mowlana) as he is also known is famous for a couple of major things
among Muslims.

1. He used to be a great Persian Poet of his time
2. A great Persian Theologian
3. He was a Major figure in Sufism
5. He was a notable musician of his time
4. His Life inspired the creation of Sufi Dances (Whirling Dervishes).

Here is a nice video with quotes from various Sufi teachers including
Rumi Mevlana himself:

It’s interesting that even though from Christian perspective Rumi Mevlana
and Sufism in general is a Heretical teaching it’s teachings, are closer
and more closer to Christianity than Islam is.
Happy Watching.

Orthodoxy Around the World (Orthodox Churches arond the world)

Sunday, February 7th, 2010

Dear reader, I thought it’s a nice idea to link that nice video
It’s compiled by some Orthodox Brother with God’s mercy.
The scale of Orthodox Christianity is really amazing. Almost 600 000+
people around the world are orthodox christians.
As Orthodoxy claims to be a direct descendant of original christianity,
faith and traditions.
Well Enough talk, Enjoy the wonderful video!

Disabling php execution for a VirtualHost

Saturday, February 6th, 2010

Disabling php execution for a certain virtual domain is incredibly simple:
All you need to do is add:

php_value engine off

That could be anywhere in your VirtualHost directives.
Another possible approach is through enabling .htaccess for a domain, e.g.:

Adding:
AllowOverride All to your domain of choice.

After which you had to put:
php_flag engine off to htaccess file
Now there you go! php scripts won’t execute anymore.

How to fix logging issues with Varnish configured to log client IP Addresses in Apache log

Friday, February 5th, 2010

Since a couple of days, I’ve noticed that client IP addresses are logged twice in my Apache log file
httpd-access.log. That’s definetely shit. Here is how I solved the issue:

I modified my:
/usr/local/etc/varnish/default.vcl that after the modification the file looked like:
backend default {.host = "127.0.0.1";.port = "8080";}sub vcl_recv { if (req.url ~ ".(jpg|jpeg|gif|png|tiff|tif|svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$") { lookup; } if (req.url ~ ".(css|js)$") { lookup; } } sub vcl_fetch { if( req.request != "POST" ) { unset obj.http.set-cookie; } set obj.ttl = 600s; set obj.prefetch = -30s; deliver; }
Well that’s it after restarting varnishd with:
/usr/local/etc/rc.d/varnishd restart
Client ip is now logged only once in Apache’s log file, Cheers! 🙂