Archive for the ‘Tips & Tricks’ Category

Mac menu on Ubuntu

If you are looking for a nice mac menu for your Ubuntu system I suggest you to download and install: Avant Windows Navigator (AWM)
Both easy to use and add new themes. Please take a look at the pic to see my example of this program.

If you are looking for some other theme then the original [...]


Print days from date 1 to date 2

This function created by me will show the days and dates between two dates. Enjoy!
<form method=”post” action=”date.php”>
Date 1 (ex 20090101 = Y = 2009 M = 01 D = 01):<br />
<input type=”text” name=”date1″ style=”width:300px;” /><br />
Date 2 (ex 20090101 = Y = 2009 M = 01 D = 01):<br />
<input type=”text” name=”date2″ style=”width:300px;” /><br />
<input [...]


Random letters with PHP

Since it was no already function for random letters in PHP i was google on it and found this one some where i do not remeber but works exemplary.
function randomletters() {
$chars = “abcdefghijkmnopqrstuvwxyz023456789″;
srand((double)microtime()*1000000);
$i = 0;
$pass = ” ;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($chars, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
If [...]


Center div with CSS

Simple example how to center a div with css.
Open your CSS file and write:
body { text-align: center; }
.centerdiv {
margin: 0 auto;
width: 200px;
text-align: left;
}
Now open your index or what ever you want to put your div and create it:
<div class=”centerdiv”>text</div>


Spotify on Ubuntu

Since I am a Spotify user I just had to have it on my Ubuntu desktop. After few seconds of google i find it very easy to install Spotify on Ubuntu. You can follow thier official how to on their home page:
http://www.spotify.com/en/help/faq/wine/


PNG-fix for IE6

Here is a very good png-fix for IE6. Still it do not work on Ubuntu if you have IE6 installed on your Ubuntu.
http://labs.unitinteractive.com/unitpngfix.php


Footer position bottom with css

After some hours i finally found this tutorial how to make a footer stick to bottom with css. I put it here if someone of you ever need.
http://ryanfait.com/resources/footer-stick-to-bottom-of-page/
Many thanks to ryanfait.com!


Common Ubuntu Commands

Here comes a list with some commands I often use on Ubuntu. I will update this list when I get more time, so do not expect a new post with new commands, it will appear here!
Window with root access
gksudo nautilus
Copy hole disk to another
sudo dd if=/dev/disk-you-will-copy of=/dev/disk-you-will-copy-too
Format disk
sudo mkfs.Filesystem /dev/you-disk
Install program
sudo apt-get install Program
Remove program
sudo [...]


Print PHP version

Since alot of friends ask me how to print out which PHP version they are using I decide to write how to do it here on my blog. It is very simple and will just take a few seconds.
Start with creating a new PHP document, for example: phpinfo.php
In the document you simply write:
<?PHP
phpinfo();
?>
And save. Only [...]