Skip to content

Instantly share code, notes, and snippets.

View hagope's full-sized avatar

Omar Al-Jadda hagope

  • Sunnyvale, CA
View GitHub Profile
timestamp temp_f
2017-04-30 13:05:01 71.375
2017-04-30 13:10:01 71.487
2017-04-30 13:15:01 71.487
2017-04-30 13:20:01 71.600
2017-04-30 13:25:01 71.600
2017-04-30 13:30:01 71.600
2017-04-30 13:35:01 71.713
2017-04-30 13:40:01 71.825
2017-04-30 13:45:01 71.825
@hagope
hagope / fix_exif_dates.sh
Created January 19, 2016 17:31
There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+
# There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+
# The following is fix using exiftool (brew install exiftool) to set these fields
# Run these in the terminal in sequence
# First fix DateTimeOriginal
exiftool "-datetimeoriginal<filemodifydate" -r -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg
# Then fix CreateDate
exiftool "-createdate<datetimeoriginal" -r -if '(not $createdate or ($createdate eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg
@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 / dash-listen-3.py
Last active November 21, 2015 20:26 — forked from courtsimas/dash-listen-3.py
listen on network for push of Amazon dash button; this version uses arp-scan instead of scapy
import subprocess
import requests
import time
import os,sys
MAGIC_FORM_URL = 'http://api.cloudstitch.io/...your_url'
def record_wake():
data = {
"Timestamp": time.strftime("%Y-%m-%d %H:%M"),
@hagope
hagope / rename-pictures-for-dropbox.sh
Created November 20, 2015 04:52
renames jpg files using exif creation date as filename in the same format as Dropbox Camera Uploads folder YYYY-MM-DD HH.MM.SS.jpg
#!/bin/bash
# requires exif command line utility
shopt -s nocaseglob #find both *.jpg and *.JPG
for i in *.JPG; do
j=`exif -t 0x9003 "$i" | grep Value: | sed 's/Value://' | sed s/:/-/g | sed s/-/./3 | sed s/-/./3`.jpg
mv -i "$i" "$j"
done
@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
@hagope
hagope / windows-power-commands.txt
Created August 3, 2015 04:36
useful command line hacks for windows command prompt and powershell
# Get hard drive info
wmic logicaldisk get
# Quicky create a system image backup
wbAdmin start backup -backupTarget:E: -include:C: -allCritical -quiet