Skip to content

Instantly share code, notes, and snippets.

View jadaradix's full-sized avatar
🙂
existing

James Garner jadaradix

🙂
existing
View GitHub Profile
@jadaradix
jadaradix / install-node.sh
Last active December 29, 2017 03:48
One step install of node.js 5.1.0 for Linux/Mac (OS X - use "darwin" for THIS_PLATFORM)
THIS_VERSION="9.3.0";
THIS_PLATFORM="linux";
echo "Downloading node.js tar...";
wget https://nodejs.org/dist/v$THIS_VERSION/node-v$THIS_VERSION-$THIS_PLATFORM-x64.tar.xz -O node;
echo "Untarring node.js tar 'node'...";
tar xf node;
echo "Deleting node.js tar 'node'...";
@jadaradix
jadaradix / rename-github-org-remotes.sh
Last active September 23, 2015 11:18
Renaming a GitHub organisation with a folder of repos referencing the old remote.
for i in $(/usr/bin/find $(pwd) -maxdepth 1 -type d); do
if [ $(pwd) != $i ]
then
cd "${i##*/}";
git remote set-url origin "git@github.com:OrganisationName/${i##*/}.git"
git remote -v;
cd ..;
fi
done
@jadaradix
jadaradix / iMessage-sql.sh
Last active June 20, 2017 21:29
Create an SQL file (dump) of OS X iMessage messages.
echo ".dump" | sqlite3 ~/Library/Messages/chat.db > $(date +"%y-%m-%d").sql
@jadaradix
jadaradix / wk-get.sh
Last active September 19, 2015 20:59
Install wkhtmltopdf and wkhtmltoimage on Ubuntu/apt-get tasty flavours.
mkdir tmp
cd tmp
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb -O x.deb
ar vx x.deb
tar xf data.tar.xz
mv usr/local/bin/* ../
cd ..
rm -rf tmp
@jadaradix
jadaradix / deploy-aws.sh
Last active August 29, 2015 14:15
"One step" deployment for AWS. As close as it gets.
apt-get update
apt-get install nodejs -y
apt-get install npm -y
ln -s /usr/bin/nodejs /usr/bin/node
npm install
npm install -g grunt-cli
npm install forever -g
apt-get install ruby -y
gem install sass --no-ri --no-rdoc
grunt
@jadaradix
jadaradix / facebook-stalk-continuously.js
Created December 30, 2014 03:15
Facebook Stalk continuously. Console this!
var as = ""; var s = false; var t; var c = function() { var f = $("#f").contentWindow; var ts = ($(".fbLastActiveTimestamp", f.document).childNodes[0].data == "active now"); var cd = new Date(); var st = cd.getHours() + ":" + cd.getMinutes() + "," + (s ? "online" : "offline"); console.log(st); as += st + "\n"; f.location.reload(); }; var stop = function() { clearInterval(t); }; var start = function() { $("body").insertAdjacentHTML('afterbegin', '<iframe id="f" src="https://m.facebook.com/messages/read/?tid=id.289725077795063"></iframe>'); t = setInterval(c, 60 * 1000); }; start();
@jadaradix
jadaradix / facebook-stalk.js
Last active August 29, 2015 14:12
Stalk people on Facebook. Console this!
var as = ""; var s = false; var t; var f; var c = function() { f = $("#f").contentWindow; var ts = ($(".fbLastActiveTimestamp", f.document).childNodes[0].data == "active now"); if (s != ts) { s = ts; var cd = new Date(); var st = (s ? "online" : "offline") + "," + cd.getHours() + ":" + cd.getMinutes(); console.log(st); as += st + "\n"; } f.location.reload(); }; var stop = function() { clearInterval(t); }; var start = function() { $("body").insertAdjacentHTML('afterbegin', '<iframe id="f" src="https://m.facebook.com/messages/read/?tid=id.289725077795063"></iframe>'); t = setInterval(c, 30 * 1000); }; start();
@jadaradix
jadaradix / do-ubuntu-node.sh
Last active September 19, 2015 21:00
Make a DigitalOcean Ubuntu Node.js HTTP Server from scratch. Handy.
apt-get update
apt-get install nodejs -y
apt-get install npm -y
npm install http-server -g
ln -s /usr/bin/nodejs /usr/bin/node
echo "Hello, World" > index.html
http-server -p 80
@jadaradix
jadaradix / yosemite-subl
Last active January 25, 2022 05:22
Fix Sublime's "subl" command on OS X Yosemite.
rm /usr/local/bin/subl;
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl;