-
Archives
- May 2012
- April 2012
- February 2012
- January 2012
- December 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- January 2009
- November 2008
- September 2008
- August 2008
- July 2008
- March 2008
- February 2008
- January 2008
-
Meta
Monthly Archives: February 2012
sed one liner: remove closing PHP tag
$ sed -i ‘s/\(.*\)?>/\1/’ your-script.php
sed edit in place deleting matching lines
This command deletes the line that contains “remove-matching-line” in files that matches *.txt wildcard. $ ls -1 *.txt | xargs -I ‘{}’ sed -i ‘/^.*remove-matching-line.*$/d’ ‘{}’ A hacker inserted eval(base64_decode(“obfuscated_code”)) on a client’s PHP files. I used this command to … Continue reading
Remove duplicates from MySQL Table
ALTER IGNORE TABLE categories ADD PRIMARY KEY(categories_id);
Create Linux RAID Level 1 from 4 TB Harddisk
Partition the disk into two equal parts. # parted /dev/sda GNU Parted 2.3 Using /dev/sda Welcome to GNU Parted! Type ‘help’ to view a list of commands. (parted) mklabel gpt (parted) print Model: Areca ARC-1212-VOL#000 (scsi) Disk /dev/sda: 4,00TB Sector … Continue reading
Posted in Uncategorized
Leave a comment