Skip to content

Instantly share code, notes, and snippets.

@moondev
moondev / install.sh
Created February 20, 2012 23:03
install.sh
sudo apt-get install xvfb git build-essential gtk2-engines-pixbuf xfonts-100dpi x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
sudo apt-get install libqt4-dev libqtwebkit-dev qt4-qmake python-qt4
cd ~/
git clone git://github.com/ariya/phantomjs.git && cd phantomjs
qmake-qt4 && make
sudo cp bin/phantomjs /usr/local/bin/
@moondev
moondev / shotty.js
Created February 20, 2012 23:28
shotty.js
//create new webpage object
var page = new WebPage();
//load the page
page.open('http://espn.go.com/nfl', function (status) {
//fire callback to take screenshot after load complete
page.render('espn.png');
//finish
phantom.exit();
});
@moondev
moondev / shotty2.js
Created February 21, 2012 17:46
shotty2.js
var page = new WebPage();
page.open('http://espn.go.com/nfl/', function (status) {
//once page loaded, include jQuery from cdn
page.includeJs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() {
//once jQuery loaded, run some code
//inserts our custom text into the page
page.evaluate(function(){$("h2").html('Many NFL Players Scared that Chad Moon Will Enter League');});
//take screenshot and exit
page.render('espn.png');
@moondev
moondev / browserstuff.sh
Created February 21, 2012 17:57
browserstuff
sudo apt-get install flashplugin-nonfree msttcorefonts
echo Y2hlY2sgeW91cnNlbGYgYmVmb3JlIHlvdSB3cmVjayB5b3Vyc2VsZg== | base64 -D | say
import flash.events.MouseEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequestMethod;
import flash.events.Event;
submitbtn.addEventListener(MouseEvent.CLICK, sendData)
parts decoded from string:
<textarea style="width:600px;height:600px;">
<?php
//print_r($_POST);
print_r(json_decode($_POST['parts']));
@moondev
moondev / packer
Last active August 2, 2016 18:40
Packer wrapper for spinnaker rosco multi region baking
#!/usr/bin/env bash
#This shell script goes in /usr/local/bin/packer
#
#The real packer binary is at /opt/packer
#
#The script looks for region in the params and then adds that to the end of aws-ebs.json and calls it with the real packer /opt/packer
#
#So Rosco goes:
#!/usr/bin/env bash
#install packa-wrappa
cd /usr/local/bin
wget https://gist.githubusercontent.com/moondev/5ea8fa608d1cd1d0006d4962061a4b66/raw/59db9706e27a132e1f7bbf31b0839a6bc5b7c120/packer
chmod +x packer
#install packer
cd /opt
wget https://releases.hashicorp.com/packer/0.10.1/packer_0.10.1_linux_amd64.zip