Things I hate: Why Me Websites.
I hate whiny little bitches that cry about their life on anonymous
"why me" websites. Get over it!
Quick Tip: apt-get
Ever needed to add a package by command line but not been able to remember what its called.
start typing your apt-get line
sudo apt-get install mysql
once you have typed as much as you know, push tab twice.
This will give a list of all the packages available.
Be sure you type as much as you can before pushing tab twice or you may get a lot of results.
The system will warn you first though eg.
user@example:~$ sudo apt-get install my
Display all 259 possibilities? (y or n)
Code Snippet: Photo Randomiser
This was something I quickly threw together to randomise a folder of photos.
Basically you put all your photos in one folder, it then randomly copies them to an output folder with a new file name.
This was used for randomising photos for a photo DVD at a party.
Its fine for basic things. If you plan on using it for a website or something I would suggest tweaking the code a bit.
Also note that it was only written to handle .jpg files. It wouldn't be too hard to modify it though.
Feel free to use the code as you wish.
// Make sure the user has passed in values via the command line
if( !isset($argv[0]) || !isset($argv[1]) || $argv[0] == "" || $argv[1] == "")
{
// If there are no values then display a usage message and exit
echo "\n**** Photo Randomiser ****\n\nUsage:\n\tphp photo_rand.php [SOURCE_PATH] [DEST_PATH]\n\n";
exit;
}
// Get the in and out dir
$in_dir = $argv[0];
$out_dir = $argv[1];
// Create an array for storing the file list
$file_list = array();
echo "/nreading files";
// Make sure the directory is valid
if (is_dir($in_dir)) {
// Open the directory
if ($dh = opendir($in_dir)) {
// Loop through all the files in the directory
while (($file = readdir($dh)) !== false)
{
// Make sure we don't include . and ..
if( $file != "." && $file != ".." )
{
// Add the current file to the file list
$file_list[] = $file;
}
}
closedir($dh);
}
}
echo "
shuffling";
// Shuffle the array
shuffle($file_list);
echo "
copying";
$file_count = 1;
// Loop through the file array list
foreach($file_list as $value) {
// Copy the file to the output dir with its new name. I use a number for the output file to keep the files in their shuffled order.
copy($in_dir . $value, $out_dir . $file_count . ".jpg");
$file_count++;
}
echo "
finished";
?>
Opinion: Windows and Linux
Linux will gain market share in coming years. Why? because what more can Microsoft add to Windows?
For most of us Windows XP worked fine. The only reason most people upgrade seemed to be because Vista looked nicer and it has better security.
But really what additional features do you get?
After 20 years Windows has come a long way. It has become a very polished Operating System which does what most people want.
Linux is I feel in its 'almost there' stage in the desktop world. I feel comfortable using Linux on all my computers ( except for my Mac ), and I use it on all my servers.
Linux on servers I feel is pretty much almost the only way to go.
For desktops though I can see that Windows for most 'mum and dad' type users is still the way to go at this stage.
But it won't be long until Linux catches up. Windows just isn't evolving at the same rate anymore as it used to, and Linux is evolving faster than Windows ever did.
Windows can no longer command the top dollars that it once did when you can compare it to products like Linux.
I don't even think Windows 7 is enough to save Windows. I think Windows needs to take on an revolution rather than an evolution. Microsoft needs to take drastic steps
like Apple did with its Mac OS X.
Nokia: Customer Service - Update
This isn't really an update on Nokia's customer service, more an update of my girlfriends phone.
Anyone that has read my previous article would see that Nokia provided awesome customer service and fixed the phone nicely Nokia: Customer Service
Well, a few days later my girlfriend decided to drop her FULL Beam and Coke on the table, spilling it all over herself.
There are a number of points to be made here.
1. It was a FULL glass of beam!! Sacrilegious! ![]()
2. I thought spilling the drink on the girl was the guys job ![]()
3. The phone was only just fixed
4. It was a FULL glass of beam!!
But anyway. The phone is mostly fine. There just appears to be water under the 9 and # key so at random times it starts pushing the buttons.
20/10/09 01:00:00 am, 