Linux cheat sheet by FOSSwire

unix-linux-command-reference-fosswire

Here’s a good Linux cheat sheet to get you started in Linux. Thanks to FOSSwire for coming up with it.

Download it from here or here.

Update: There is also a Ubuntu cheatsheet available for download.

WordPress 2.7.1 is out

WordPress

WordPress 2.7.1 is out. The release comes with 68 fixes.

For more info on the changes you look at the list for fixed tickets and the full change log.

Upgrade’s a breeze with the new auto upgrade function. If you get a timeout issue, try this fix. Increased my timeout to 120 and the upgrade completed successfully.

Alternatively, you could still upgrade the manual way by downloading WordPress and upgrading over ftp. If you need help refer to the manuals to install or upgrade.

Follow the Dalai Lama on Twitter

dalailama

You can now follow “His Holiness, The 14th Dalai Lama Of Tibet” on twitter.

The twitter account is managed by “OHHDL” ,The Office of His Holiness the Dalai Lama.

If you are like me then peace is the only thing you wish. To me, religion, color, race, status in society don’t mean anything. They are just reasons that fuel hatred today and are being leveraged but those in power to stay in power or gain more power. NO GOD WILL ASK TO KILL!! HE WHO CREATES WILL NOT DESTROY, HE WHO IS FILLED WITH HATRED WHO DESTROYS.

Well, before I get carried away again by my emotions. If you wish, you can follow the Dalai Lama on twitter at @OHHDL or visit him at http://www.dalailama.com.

Update: Sigh…. looks like @OHHDL could be fake. It’s currently  suspended.

What does dirname(__FILE__) and basename(dirname(__FILE__)) do?

Was helping a friend fix his php script today. He was not too sure about what “dirname(__FILE__)” did.

dirname() is a PHP function which returns the directory name of a file. For example if file abc.txt was in “/tmp/abc.txt” then the dirname() function would return “/tmp” .

Example Usage;

<?php

$file = “/tmp/abc.txt”;

$path = dirname($file); // $path will now contain /tmp

?>

What does dirname(__FILE__) and basename(dirname(__FILE__)) do then?

The __FILE__ constant  represents the running script. It will return the full path and file name of the running script. For example, the  __FILE__ constant  on my server would return “/var/www/html/index.php” for my index.php file which is in the “/var/www/html/” directory.

The basename() command is normally used in conjunction with the dirname() function to strip the parent directory from a full file name. For example “/var/www/html/abc.txt” when passed through basename() would return abc.txt. basename() also works on directories. So, basename() on “/var/www/html” would return “html” since in Linux directories are files.

Example Usage;

Imagine __FILE__ represents /var/www/html/index.php

<?php

echo dirname(__FILE__); // returns /var/www/html

echo basename(__FILE__); //returns index.php

echo basename(dirname(__FILE__)); //returns html

?>

Free computer eBooks from Computer-Books.us

computer-booksus-free-computer-books

Computer-Books.us provides free computer eBooks for download. All books are legal as the authors / publisher have been kind enough to allow the eBooks to be published online for free.

Books are broken down into categories and each hosted on it’s own domain.

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox