Skip to content

Instantly share code, notes, and snippets.

Avatar

Tom King mobilemind

View GitHub Profile
@mobilemind
mobilemind / curlcheck.sh
Created Sep 5, 2018
quickly check headers & TLS negotiation using curl
View curlcheck.sh
#!/usr/bin/env bash
curl -sv --connect-timeout 15 --head -i 'https://www.google.com' > /dev/null
View ffmpeg_examples.sh
# strip audio from a video and save as m4a
ffmpeg -i input.mp4 -vn -c:a copy output.m4a
# replace audio track with audio track in identical (m4a) format
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -acodec copy -map 0:0 -map 1:0 output.mp4
# replace audio, matching file's audio codec (encodes only audio)
ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -map 0:0 -map 1:0 output.mp4
View keybase.md

Keybase proof

I hereby claim:

  • I am mobilemind on github.
  • I am mobilemind (https://keybase.io/mobilemind) on keybase.
  • I have a public key whose fingerprint is CFA6 8D4C DC83 0020 6373 2E79 59A6 4A93 6EB1 D9B3

To claim this, I am signing this object:

@mobilemind
mobilemind / rtm-add.js
Created Apr 11, 2016
Remember the Milk bookmarklet to add current selected text & web page as a task due tomorrow using RTM Mobile web app
View rtm-add.js
// javascript:%28function%28%29%7Bvar%20n%2Cw%3Bif%28window.getSelection%29n%3Dwindow.getSelection%28%29%3Belse%20if%28document.getSelection%29n%3Ddocument.getSelection%28%29%3Belse%20if%28document.selection%29n%3Ddocument.selection.createRange%28%29.text%3Bw%3Dwindow.open%28%27https%3A%2F%2Fm.rememberthemilk.com%2Fadd%3Fname%3D%27%2BencodeURIComponent%28null%3D%3D%3Dn%7C%7Cundefined%3D%3D%3Dn%7C%7C%27%27%3D%3Dn%3Fdocument.title%3An%29%2B%27%26due%3Dtomorrow%26url%3D%27%2BencodeURIComponent%28location.href%29%2C%27addwindow%27%2C%27status%3Dno%2Ctoolbar%3Dno%2Cwidth%3D475%2Cheight%3D260%2Cresizable%3Dyes%27%29%3BsetTimeout%28function%28%29%7Bw.focus%28%29%7D%2C475%29%7D%29%28%29%3B
// (function(){var n,w;if(window.getSelection)n=window.getSelection();else if(document.getSelection)n=document.getSelection();else if(document.selection)n=document.selection.createRange().text;w=window.open('https://m.rememberthemilk.com/add?name='+encodeURIComponent(null===n||undefined===n||''==n?document.title:n)+'&due=tomorrow&u
@mobilemind
mobilemind / remove_exif_orientation.sh
Created May 15, 2015
remove orientation information from iPhone JPEG image using exif on jpg file
View remove_exif_orientation.sh
for PHOFILE in Photo*.jpg ; do exiftool -Orientation='' "$PHOFILE" ; done
@mobilemind
mobilemind / setFileDateToEXIFDate
Created May 10, 2014
set file date to EXIF date
View setFileDateToEXIFDate
# depends on exiftool
for TKJF in photo\(?\).jpg
do touch -t "$(exiftool -DateTimeOriginal -S "$TKJF" | awk '{gsub(":","",$0); print $2 substr($3, 1, 4) "." substr($3, 5, 6) }')" "$TKJF"
done
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active Oct 23, 2020
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@mobilemind
mobilemind / unnstall-java.sh
Created Jul 7, 2013
uninstall Java on OS X
View unnstall-java.sh
#!/bin/sh
# Java VM sym link
sudo ln -s /Library/Java/JavaVirtualMachines /System/Library/Java/JavaVirtualMachines
# Java browser plugin
sudo rm -f /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
View node-proxy.sh
npm config set proxy http://proxy_host:port
View parallel-adverts-off.sh
#!/usr/bin/env bash
defaults write com.parallels.Parallels\ Desktop ProductPromo.ForcePromoOff -bool YES
You can’t perform that action at this time.