GMail Server Error 502

February 24, 2009 – 12:01 pm

Right now GMail, GoogleMail etc. is giving me and my friends a 502 error.
We will wait for explanation of this error later.
Check for yourself here: gmail.com

Update: this page explains a lot about the error but still we will wait for the reason of google to show it.

I’ve found of couple of different explanations for the 502 error so I am not sure which one to believe or to believe to all of them.

Seems like there were other broken server connections to gmail.com in the past: here or here

I’m not sure if the post dates are correct to these sites. This error never happened for me before.

KDE on Windows

January 31, 2009 – 6:12 pm

Now you can already install KDE4(QT4) applications under MS Windows and use their full features like you are in Linux!
Check this out!
I’ve just installed Amarok2 and it feels great under Vista!

Good two-way encryption/descryption of strings in PHP

January 30, 2009 – 10:48 am

I’ve found a page here that gives two functions to encrypt/decrypt a string into an not so easy readable one using sha1, ord and some hex. It helped me to hide a sensitive data from the regular users and to calm down the admins that their data will not be stolen so easy now ;)

How to tar gzip a whole directory in Linux

December 8, 2008 – 11:11 am

This is the code you can use to tar.gz a whole directory in Linux. That way you may backup your site dir and then download it through the site’s web/ftp server etc.

this one is executed inside the directory that have to be backed up. It will backup all of the files and dirs recursively.

tar -pczf sitename.tar.gz *

Instead of an asterisk you may use ./* or /home/user/dirname/* if you are not in the backed up dir.

Talking about a backup you can use this command and some other helpers to create a cron job that rotates 3 or more backups. But for the cron backups we will talk later.

GZip whole directory into one file - linux console command

November 21, 2008 – 4:18 pm

With the help of tar we will now archive a whole directory and then compress the produced .tar gile with gzip. There are many ways one can gzip many files into one. I prefer this:

tar czf dirname.tgz dirname/

This will create a tar.gz file in your current dir.

How to install KDE4 on Ubuntu 8.10 Intrepid Ibex

November 21, 2008 – 3:49 pm

My-guides.net suggest you to add this repo first:

deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu intrepid main

Then update all your sources and in a console type:

sudo aptitude update && sudo aptitude install kubuntu-kde4-desktop

Linux and Windows comparison (again)

November 18, 2008 – 3:36 pm

Another interesting article (and comments at the end) that I’ve found here.

Adobe Flash and Linux User Experience

November 18, 2008 – 2:32 pm

It’s just one of those posts I use to make that are so short and need so many comments to make the visiting that page a good choice. Sometimes when I am in a hurry and want to show you something good I’ve found on the web this kind of post is made. However this is the post where I want you Linux users to read some interesting things about Adobre Flash and its Linux behaviour. Read the rest here.

I really like these words: “..when the Flash ends up on a Linux computer, it’s old dominant personality returns and it turns evil again..”.

So the answer is: put your flash object inside an iframe and start using a transparent flash from now on! :P

Here you can see an ordinary way to embed your flash movie into the page: Flash in HTML

And here is how to make a transparent iframe: Transparent iframe tutorial

Random number generation testing

November 14, 2008 – 4:12 pm

I wanted to know how good is the php’s rand() function so I’ve made a simple code which drows hundreds of lines with different colors. The colors are switched between red and white and for every line a rand(0,1) is made so if rand(0,1) == 1 then draw the one color or else draw the other color line. Here is an example of that with 10 100×100 png images created with random line colors.

The following code is used in the example above:

<?php
$x = 100;
$y = 100;
$gd = imagecreatetruecolor($x, $y);
$red = imagecolorallocate($gd, 255, 0, 0);
$white = imagecolorallocate($gd, 255, 255, 255);
$x = $y = 0;
//lines
for ($i = 0; $i < 100; $i++) {
imageline($gd, $x, $y, $x+100, $y, rand(0,1) ? $red : $white);
$y++;
}
header(’Content-Type: image/png’);
imagepng($gd);
?>

Redirect to a mobile version of your site with .htaccess

November 3, 2008 – 11:48 am

Sometimes it is better to create special pages fo mobile phone considering their smaller screens and lack of javascript and html compatibility. You can identify a mobile phone browser by checking its HTTP_ACCEPT var inside the $_SERVER var in php and then use header(”location: …”); to redirect te phones. However if you have a static html page that needs to be redirected and no javascript is expected to load on the phone, you have to use servers capabilities to redirect it. Here is the code that will do the trick:

RewriteEngine On

RewriteCond %{HTTP_ACCEPT} (x-)*(application|text)/(x-)*(vnd[-.])*(wap[-.]|wml)+
RewriteRule ^.*$ http://www.yourmobilesite.com [L]

It may need some tweaking and testing of the regular expression and I’m living it for you to modify it and post results here.

Instead of HTTP_ACCEPT you can use other server vars such as HTTP_USER_AGENT etc.