Skip to content

Instantly share code, notes, and snippets.

View hagope's full-sized avatar

Omar Al-Jadda hagope

  • Sunnyvale, CA
View GitHub Profile
@hagope
hagope / pt_stalk replication delay
Last active December 27, 2015 10:28 — forked from silviabotros/pt_stalk replication delay
Getting the Seconds_Behind_Master status from MySQL
mysql -h localhost -u root -e "show slave status\G" | grep "Seconds_Behind_Master" | awk '{print $2}'
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@hagope
hagope / rename.sh
Created July 9, 2012 07:19
bash script to deleting leading chars of file names in directory
#!/bin/bash
a=1
for i in *.jpg; do
new=${i:9}
mv "${i}" "${new}"
let a=a+1
done
@hagope
hagope / dirTree.js
Created June 26, 2012 17:37
Output the file system as a JSON using node.js
var fs = require('fs'),
path = require('path')
function dirTree(filename) {
var stats = fs.lstatSync(filename),
info = {
path: filename,
name: path.basename(filename)
};
@hagope
hagope / monitor-mysql.sh
Created June 6, 2012 19:52
Shell command to monitor a MySQL process
while true; do mysql -uroot -e "show processlist" | grep 29357; sleep 10; done