Squeeze: Installing VirtualBox 3.2_3.2.12-68302~Debian~squeeze_amd64

First we install some required packages

sudo aptitude install libqt4-network libqt4-opengl libqtcore4 libqtgui4

Then we install VirtualBox download from VirtualBox.org :

sudo dpkg -i virtualbox-3.2_3.2.12-68302~Debian~squeeze_amd64.deb

Include your user in the group “vboxusers”

Linux:: settings shortcuts for your ssh connections to hosts

If you wish you could use friendly names to access your servers, here’s how to do it:

Edit your ~/.ssh/config and add the following:

Host myserver
    HostName 123.123.123.123
    Port 12345
    User bob
Host other_server
    HostName test.something.org
    User alice
    CheckHostIP no
    Cipher blowfish

Please, remember to customize “HostName” and “User” values to your needs. 🙂

Google Talk freezes when selecting “Show Current Music Track” and Winamp 5 is running

I have been a fan on Winamp since version 1.0 and I like Google talk too.

Sometimes I want to show people what music is playing on my box and wish that Google Talk would not freeze when I do it. That’s not the case by default unfortunately.

So here’s what needs to be done:

Step 1: Go to the root folder of your Winamp installation. Usually C:Program FilesWinamp (C:Program Files (x86)Winamp, if you’re on a 64-bit Windows).

Step 2: Select Tools -> Folder Options -> View (tab) and uncheck “Hide Extension for know file types” and confirm hitting Ok

Step 3: Create a new empty file (Right Click -> New -> Text Document).

Step 4: Rename the newly created file to “winamp.m3u” and confirm.

Step 5: Close both Winamp and Google Talk.

From now on when you open both and select “Show Current Music Track”, Google Talk will not freeze.

Great way to integrate SwiftMailer and Kohana 3

Just found this post:

http://www.flynsarmy.com/2010/06/integrating-swift-mailer-into-kohana-3/

by Flynsarmy

showing the simplest way to integrate SwiftMailer and Kohana 3

Create the following files/folders:
/modules/swiftmailer
/modules/swiftmailer/init.php
/modules/swiftmailer/classes

Inside /modules/swiftmailer/classes/ drop the official latest build of Swift Mailer.

Enter the following into init.php.

<?php
require Kohana::find_file('classes', 'Swift-4.0.6/lib/swift_required');

There. Wasn’t that easy? Remember to enable the module by adding it to your bootstrap.php file!

Windows 7: Enabling auto-logon

Here’s what you do to enable automatic log on to your Windows 7 user account

Hit WindowsKey+R and execute

control userpasswords2

On the dialog that opens, click on the username that you wish to enable automatic log on and uncheck the “Users must enter a user name and password to use this computer” checkbox.

When you click OK, Windows will ask the password for that user.

Type it twice to confirm and hit Ok.

From now on, the user account you selected will be automatically logged on when booting.

WRT160n v3 flawed 3.0.02 firmware: DHCP can’t keep track of leases: IP conflicts all over the place

Very often here at the office we have loss of internet connection even though it seems the local network connection never goes down.

Besides losing the internet connection, my laptop frequently displays a message saying there’s an IP conflict, which doesn’t make much sense as the only DHCP server running on our network is the router’s

This screen shows that my computer has IP address 192.168.1.104 and it’s not listed under DHCP client list. Anyone care to help understand why?

Update 2010-11-11:  I decided to start using DD-WRT on this router.

Firmware: Firmware: DD-WRT v24-sp2 (08/07/10) mini
Time: 14:54:41 up 2 days, 5:27, load average: 0.13, 0.11, 0.05
So far, no more of those crazy problems the default firmware has. You may want to do yourself a favor and check if your router is supported.

How Gullible Are We?

This was found on the newsgroup: rec.humor.funny / found using StumbleUpon

H2O: Dangerous Chemical!

A student at Eagle Rock Junior High won first prize at the Greater Idaho Falls Science Fair, April 26. He was attempting to show how conditioned we have become to alarmists practicing junk science and spreading fear of everything in our environment. In his project he urged people to sign a petition demanding strict control or total elimination of the chemical “dihydrogen monoxide.”

And for plenty of good reasons, since:

  1. it can cause excessive sweating and vomiting
  2. it is a major component in acid rain
  3. it can cause severe burns in its gaseous state
  4. accidental inhalation can kill you
  5. it contributes to erosion
  6. it decreases effectiveness of automobile brakes
  7. it has been found in tumors of terminal cancer patients

He asked 50 people if they supported a ban of the chemical.

  • Forty-three (43) said yes,
  • six (6) were undecided,
  • and only one (1) knew that the chemical was water.

The title of his prize winning project was, “How Gullible Are We?”

He feels the conclusion is obvious.

Organize your DropBox shared folders the right way

When someone shares a DropBox folder with you, it goes to the root folder of your DropBox, which most of the times will not be good enough and ends up messing the very well planned structure that you wanted 🙂

If you simply drag and drop the shared folder somewhere else (within your DropBox, of course) the sharing information somehow gets lost.

The solution is to move the folder using the web interface!

NGINX with Kohana 3.x friendly URLs

I really enjoy working with Kohana and since I got a server from one of the hosting companies listed at LowEndBox, I decided to ditch Apache and go with Nginx, thing is… I also like pretty URLs 🙂

As a backup from the comment located here: http://forum.kohanaframework.org/discussion/comment/11553/#Comment_11553

I’m copying and pasting it in my blog for easier reference, plus it’s modified to fit my servers configuration:

location / {
    index    index.php index.html;

    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php/$1 last;
    }

    include  /home/httpd/domains/example.com/htaccess;
}

location ~ .php$ {
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /home/httpd/domains/example.com/html$fastcgi_script_name;

    include /etc/nginx/fastcgi_params;
}

# kohana
set  $path_info "";
location /index.php {
    if ($uri ~ "^/index.php(/.+)$") {
        set  $path_info  $1;
    }
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /home/httpd/domains/example.com/html/index.php;

    fastcgi_param  PATH_INFO $path_info;
    include /etc/nginx/fastcgi_params;
}

php:// function to clean string for SEO usage

If you need a good function to clean strings to use them as URLs for SEO purposes, here’s a suggestion:

function chunk_special_chars($string) {
  $normalizeChars = array(
    'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',
    'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',
    'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',
    'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a',
    'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',
    'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u',
    'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'f'
  );
  $string = strtr($string, $normalizeChars);
  $string = str_replace('&', '-and-', $string);
  $string = trim(preg_replace('/[^wd_ -]/si', '', $string));//remove all illegal chars
  $string = str_replace(' ', '-', $string);
  $clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string);
  $clean = preg_replace("/[^a-zA-Z0-9/_| -]/", '_', $clean);
  $clean = strtolower(trim($clean, '-'));
  $clean = preg_replace("/[/_| -]+/", '_', $clean);

  return $clean;
} //function

thanks to: sales at mk2solutions dot com for posting their solution @http://us2.php.net/strtr notes