-
Find which directories are the disk hogs
du --max-depth=1 -h | sort -h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- The table | |
CREATE TABLE `my_table` ( | |
field1 varchar(50), | |
.... | |
createdTime datetime NOT NULL, -- NOT NULL is important to trigger the trigger | |
modifiedTime TIMESTAMP -- Timestamps automatically update on insert | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some example paypal response for reference: | |
array ( | |
'test_ipn' => '1', | |
'payment_type' => 'instant', | |
'payment_date' => '03:46:59 Jul 19, 2012 PDT', | |
'payment_status' => 'Completed', | |
'address_status' => 'confirmed', | |
'payer_status' => 'unverified', | |
'first_name' => 'John', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick regexp to remove non-alpha chars from a string. Very handy | |
$string = preg_replace("/[^a-zA-Z0-9\s]/", "", $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick regexp to remove non-alpha chars from a string. Very handy | |
$string = preg_replace("/[^a-zA-Z0-9\s]/", "", $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To correctly set the doc name of a java App in OSX, use.... | |
*/ | |
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Foo"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATE -> SECONDS | |
--------------- | |
(CELL - DATE (1970,1,1))*86400 | |
TIME -> SECONDS | |
--------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prep: | |
- apt-get update && apt-get upgrade && apt-get dist-upgrade | |
- Check for holds | |
dpkg --audit | |
dpkg --get-selections | grep hold | |
aptitude & press "g" | |
- Edit sources.list s/lenny/squeeze | |
- apt-get update NOTE: Debian docs say don't use aptitude to upgrade. | |
- apt-get upgrade to to a safe-upgrade |