Category Archives: Asides

Can’t connect to local MySQL server through socket…error.

April 21, 2007 by aaron
I recently moved my /home folder to its own partition, but in doing so, I broke MySQL. The full error I got was: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) To fix this you need to create the file and make sure that MySQL has access to it. (All commands need to be run as root) Create the directory (if it doesn’t already exist). sudo mkdir /var/run/mysqld/ Create the file by “touching” it.
Read More ⟶

PHP include ladder to find include path.

April 10, 2007 by aaron
I needed a way to be able to include particular files from files that are themselves included. because the working directory was not necessarily the same, so I needed a way to find what the actual include path should be. The following code snippet finds a specific folder or file and returns the ladder (relative path) to get to it. function find_path($loc,$dir=0){ for($i = 0; $i < 10; $i++){ if($dir){ if(is_dir($ladder.$loc)){ return $ladder; break; } }elseif(is_file($ladder.$loc)){ return $ladder; break; } $ladder .=&#039;../&#039;; } } This code is NOT user-input safe: any checks you do should be hard coded otherwise you might as well just give out your passwords.

I am not me, I am Darren Rowse

April 9, 2007 by aaron
  You are most like Darren Rowse! You are like Darren Rowse. You are relatively mild mannered, confident in how you operate and choose not to “rock the boat”. Your ego does not flair often. Instead, you choose to assist other bloggers as much as possible. In some cases, you may find it to be your mission in life. You do not participate in a large amount of social networking and if you do, you’re not particularly aggressive about “friending” people.
Read More ⟶

Mysql Search and Replace.

April 31, 2007 by aaron
I’ve been getting ready for WordPress 2.3, so in preparation I’ve started cleaning up my database. My first order of business was to clean up the tags database. Over time I’ve used several different methods of separating words: all spaces, hyphens and underscores have all been used which really makes the nice names ugly. Fixing this was easy, I just used the MYSQL replace command: UPDATE table SET field =
Read More ⟶

Ubuntu 7.10 is shipping with xorg.conf gui

April 31, 2007 by aaron
As of an update from a few days ago, users are now able to access a graphical user interface for editing xorg.conf, though only for graphic and display settings. This tool has support for dual monitors at the moment, and with the release of X.org 7.3 it will be possible to add even more. You can turn on and off both (or one) of your monitor(s), change the available resolutions, orientations, and set mirror or exteneded desktops.
Read More ⟶

Cheap and easy way to get a new laptop battery.

April 28, 2007 by aaron
The video shows how to replace the batteries inside your laptop’s battery pack for about a third of the cost of a new battery pack. There have been a few times in the past where I really wish I knew this.

Can’t connect to local MySQL server through socket…error.

April 21, 2007 by aaron
I recently moved my /home folder to its own partition, but in doing so, I broke MySQL. The full error I got was: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) To fix this you need to create the file and make sure that MySQL has access to it. (All commands need to be run as root) Create the directory (if it doesn’t already exist). sudo mkdir /var/run/mysqld/ Create the file by “touching” it.
Read More ⟶

PHP include ladder to find include path.

April 10, 2007 by aaron
I needed a way to be able to include particular files from files that are themselves included. because the working directory was not necessarily the same, so I needed a way to find what the actual include path should be. The following code snippet finds a specific folder or file and returns the ladder (relative path) to get to it. function find_path($loc,$dir=0){ for($i = 0; $i < 10; $i++){ if($dir){ if(is_dir($ladder.$loc)){ return $ladder; break; } }elseif(is_file($ladder.$loc)){ return $ladder; break; } $ladder .=&#039;../&#039;; } } This code is NOT user-input safe: any checks you do should be hard coded otherwise you might as well just give out your passwords.

I am not me, I am Darren Rowse

April 9, 2007 by aaron
  You are most like Darren Rowse! You are like Darren Rowse. You are relatively mild mannered, confident in how you operate and choose not to “rock the boat”. Your ego does not flair often. Instead, you choose to assist other bloggers as much as possible. In some cases, you may find it to be your mission in life. You do not participate in a large amount of social networking and if you do, you’re not particularly aggressive about “friending” people.
Read More ⟶

Mysql Search and Replace.

April 31, 2007 by aaron
I’ve been getting ready for WordPress 2.3, so in preparation I’ve started cleaning up my database. My first order of business was to clean up the tags database. Over time I’ve used several different methods of separating words: all spaces, hyphens and underscores have all been used which really makes the nice names ugly. Fixing this was easy, I just used the MYSQL replace command: UPDATE table SET field =
Read More ⟶

Ubuntu 7.10 is shipping with xorg.conf gui

April 31, 2007 by aaron
As of an update from a few days ago, users are now able to access a graphical user interface for editing xorg.conf, though only for graphic and display settings. This tool has support for dual monitors at the moment, and with the release of X.org 7.3 it will be possible to add even more. You can turn on and off both (or one) of your monitor(s), change the available resolutions, orientations, and set mirror or exteneded desktops.
Read More ⟶

Cheap and easy way to get a new laptop battery.

April 28, 2007 by aaron
The video shows how to replace the batteries inside your laptop’s battery pack for about a third of the cost of a new battery pack. There have been a few times in the past where I really wish I knew this.