Category: Linux
-
Extract Memory Usage As Integer
Use that and feed memory usage into a graphite server every minute from a cron script:
-
WordPress Trackback Maintenance
Sometimes you just need to get rid of all that trackback data from your WordPress database. Here’s how to do it manually from your MySQL command line: Great, but now your comments counts are all out of whack, since that integer is stored in the wp_posts table. Here’s how to check that: And here’s how…
-

Making A Bootable CentOS 6.4 x86_64 USB Key
Download the PenDriveLinux “Univerals USB Installer” from http://www.pendrivelinux.com/downloads/Universal-USB-Installer/Universal-USB-Installer-1.9.3.9.exe. Download the Centos 6.4 Live DVD from http://holmes.umflint.edu/centos/6.4/isos/x86_64/CentOS-6.4-x86_64-LiveDVD.iso (or any other mirror). Run the Universal USB Installer utility and click “I Agree” on the license agreement screen. Insert your USB drive into an open USB port on your computer. Installer Step 1 – Select CentOS from the…
-

Using Samba on CentOS With Windows 7/8
Go ahead and install the samba packages: sudo yum install samba samba-client samba-common smbd –version sudo chkconfig smb on sudo chkconfig nmb on sudo nano /etc/selinux/config Disable SELINUX by editing /etc/selinux/config and make one small change: SELINUX=disabled Make some additions to iptables: sudo iptables -I INPUT 4 -m state –state NEW -m udp -p udp…
-
Batch optimize images in bash
find . -type f -exec convert {} -resize 700×700> {} ;
-
Relating a MySQL Process to Server Process
All of this assumes LAMP (specifically CentOS 6, MySQL server 5.5, Apache 2+ with mod-status enabled) On mysql server: watch -n 1 “mysql -e ‘show processlist’;” Look for sleeping connections that are staying open for a while. Watch for a trend. When you see a connection that you think will stay open for long enough,…
-
Find all files recursively and give them a different extension
find . -name “*.mp3” -exec rename .mp3 .mp3srbad {} ;
-
Watch mysql processlist in (almost) real time
watch -n 1 “mysql -h 10.0.0.1 -u username -pPASSWORD -e ‘SHOW PROCESSLIST;’”
