This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This server will start a bash shell and expose it | |
// over socket.io to a browser. See ./term.html for the | |
// client side. | |
// | |
// You should probably: | |
// | |
// npm install socket.io | |
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir /tmp/curl-ca-bundle | |
cd /tmp/curl-ca-bundle | |
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2 | |
tar xzf curl-7.22.0.tar.bz2 | |
cd curl-7.22.0/lib/ | |
./mk-ca-bundle.pl | |
if [ ! -d /usr/share/curl/ ]; then | |
sudo mkdir -p /usr/share/curl/ | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void spwm(int freq, int pin, int spd) { | |
digitalWrite(pin, HIGH); | |
delayMicroseconds(spd * freq); | |
digitalWrite(pin, LOW); | |
delayMicroseconds(spd * (255 - freq)); | |
} | |
int delay = 15; | |
void loop() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Grab Images from Wikipedia via thier API | |
* | |
* @author http://techslides.com | |
* @link http://techslides.com/grab-wikipedia-pictures-by-api-with-php | |
*/ | |
//curl request returns json output via json_decode php function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reverse words in a string | |
var reverseWords = function(sentence){ | |
var words = sentence.split(" ").reverse(); // Split the sentence into an array of words and reverse it | |
var string = ""; | |
for(word in words) | |
string += (word > 0 ? " " : "") + words[word]; // Concatenate each word to the output and add spaces where required | |
return string; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = require('crypto'); | |
var dns = require('native-dns'); | |
var rest = require('restler'); | |
var server = dns.createServer(); | |
server.on('request', function (request, response) { | |
var domain = request.question[0].name; | |
if(domain == 'webutils.flourishworks.com') { | |
// Don't log this because it can't be uniquely identified and subsequently retrieved |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash +xv | |
declare WGET=/usr/bin/wget | |
declare SED=/bin/sed | |
declare INVOKE=/usr/sbin/invoke-rc.d | |
#declare TORIFY=/usr/bin/torify | |
#declare TORRESOLVE=/usr/bin/tor-resolve | |
declare -i EXIT_VALUE=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple tcp server using netcat | |
# - depending on the netcat version either use nc -l 5555 or nc -l -p 5555 | |
# - verify with `telnet locahhost 5555` | |
# - quit the telnet with `ctrl-]` and then type quit | |
# - the while loop is there so reopen the port after a client has disconnected | |
# - supports only one client at a time | |
PORT=5555; | |
while :; do nc -l -p $PORT | tee output.log; sleep 1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/ | |
#USAGE! | |
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url) | |
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help | |
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!) | |
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!) | |
# 5. Check path/to/my/project/Release/android for your sparkling new apk! | |
# | |
# This worked and was uploadable to the google play store. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Open up the developer console in your browser, paste the script below, press enter and enjoy! | |
*/ | |
var anchors, i; | |
setInterval(function() { | |
anchors = document.getElementsByTagName('a'); | |
for (i = 0; i < anchors.length; i++) { | |
anchors[i].click(); | |
} |
OlderNewer