GZip whole directory into one file - linux console command
Posted on November 21, 2008
Filed Under Compression, Output, Ubuntu | Leave a Comment
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
Posted on November 21, 2008
Filed Under Internet, Linux, Ubuntu | Leave a Comment
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)
Posted on November 18, 2008
Filed Under Apache, Browsers, Linux, Output, PHP, Ubuntu | Leave a Comment
Another interesting article (and comments at the end) that I’ve found here.
Adobe Flash and Linux User Experience
Posted on November 18, 2008
Filed Under Browsers, HTML, Internet, Linux, Output, Ubuntu | Leave a Comment
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!
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
Posted on November 14, 2008
Filed Under Browsers, HTML, Internet, Output, PHP | Leave a Comment
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
Posted on November 3, 2008
Filed Under Apache, Browsers, HTML, Internet, Output, PHP, javascript | Leave a Comment
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.
The day an antivirus software is used on a Linux desktop machine will be the last day of the “Freedom”
Posted on October 31, 2008
Filed Under Internet, Linux, Ubuntu | 1 Comment
Tell me if I’m not right.
A switch from svn to git?
Posted on October 28, 2008
Filed Under Internet, Linux, Output, PHP | Leave a Comment
Recently a friend of mine sent me a link to an article that says “3 reasons to switch from svn to git”. It’s interesting to read and know how the things are moving with new look on the main picture about multiuser programming environments like svn & friends. I’ve had some troubles working simultaneously with other people on svn - conflicts, broken diffs etc. but it’s up to the programmer to choose his environment so let’s read on.
Install Fedora 9 / 10 on a usb flash drive. And some Linux thoughts
Posted on October 20, 2008
Filed Under Linux, Ubuntu | Leave a Comment
If you want or need to test a new Linux distribution but do not want to format your hard drives or just want to see how an OS acts on a NAND memory stick (usb flash/thumb drive) this will be the start for you.
I wanted to test a couple of distributions to see how the software is installed on them, what type of package manager they use, what versions of the KDE4 packages/programs they have and how the ATI driver is managed.
KDE4 is the same on all distros but acts different and sometimes I feel I don’t use the latest and greatest versions fo my favorite programs under different distros.
I have ATI Radeon 9600 on my Linux pc. It is very old indeed but still one developer like me can play his favorite games on such a machine. Unfortunately ATI decided to leave its old drivers’ support and even they say it’s for the very old video cards, it conflicts with my card too. I’ve troubles installing a proper driver and getting fast OpenGL right after I’ve upgraded my openSuSe 10.2 to 10.3 then. OSuSe11 resolved the problem to some point but still have troubles. As I remembre Mandriva 2008 have no troubles with my videocard’s driver. But the best until now is Linux Mint 5 which politely notified me that I have and option to install a proprietary ATI driver and asked me if I want to. The driver installed and then I’ve had a full 3D again!
Now I’ve installed the new Ubuntu 8.10 on my usb flash drive and I’m going to test it later.
Anyway the only Linux that installed from its live installer CD and ran immediately after restart from my usb drive was Fedora 9 and then 10.
I have a better success with my video card on Fedora10 but the needed mplayer and other software is not in the Rawhide in the time of this writing so I’ll wait a month or two and test it again.
It’s very simple to install F10 on a usb drive. Just boot from the F10 LiveCD, start the install and choose /dev/sdX for your installation where X is a,b,c etc. whichever is your usb drive. Be sure to unmount all of the mounted partitions of the flash drive if any.
In the installation, when you’re asked to create and format partitions, choose your usb drive and make a couple of partitions like if it will be on your hard drive. I’ve tested with the following configuration:
First partition is FAT16 bootable active and ~300MB to use it under windows or others like a normal usb flash drive. I’ve choose to mount it like /windows
I’ve made a swap partition as a second one but you can miss this point as it was just for testing the speed os a flash drive. Anyway my swap was 512MB.
The third partition was ext3 and took the whole free space left. I used it to mount it like root: /
The next screen should show you how your system will be installed - on which HDD etc. There is an advanced or modify button where you can select the drives order - use your flash drive as the first drive and then reorder the other drives the way you like.
Continue the installation and after it’s finished, take out your CD from the drive, restart and set your BIOS to boot from USB-HDD or if not working from a similar ‘USB-..’ option.
You should have a running Fedora10 from your USB drive!
If you prefer other distros check out this great site http://pendrivelinux.com - it’s all about installing linux on a usb drive!
For stats I have tested my flash drive by copying/moving/writing small and big files to and from it and looking at the GKrellM’s monitors. It showed 18-24MB/s reading and 4-8MB/s writing speed. IT’s not enought for an everyday usage but still you can watch movies, compile programs, update software, test networks, play small games etc. on it.
There is a good but a bit expensive USB flash drive called OCZ Rally2 TURBO that has amazing read/write speeds and is higly recommended!
You should use at least a 4GB thumb drive or card reader with inserted fast SD or similar card to have enough space and speed.
Be aware that the usb drive has limited read/write cycles and may be damaged after some time so don’t keep life saving information on it if it’s too old already.
That’s it. If you have some troubles post them here and I will try to solve it because it’s very funky to have a Linux OS on a flash drive!
Why restart?
Posted on October 6, 2008
Filed Under Linux | Leave a Comment
Why Firefox asks everytime I install a new extension to restart?
Why my Linux asks me to restart to load the new kernel isnted of reloading it dinnamically?
Why Windows asks to restart after a driver install?
Why the Linux Desktop environment is so Windows-like and asks me to restart from time to time to reload the new settings?
Why is this “reload again” thing everywhere?!
By reloading again you spend much more time just waiting instead of doing something good on your machine. Multiplied by the number of all the computer users all over the world that means a LOT of time spend just to..wait reloading!
keep looking »