Skip to content

Instantly share code, notes, and snippets.

View missinglink's full-sized avatar

Peter Johnson missinglink

View GitHub Profile
@missinglink
missinglink / elasticfilter.sh
Created June 20, 2013 16:43
Example of mapping field names during a river update
$ curl -XPUT "localhost:9200/_river/mongoscriptfilter/_meta" -d'
{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "documents",
"script": "ctx.document.title = ctx.document.title_from_mongo; delete ctx.document.title_from_mongo;"
},
"index": {
"name": "testmongo",
@missinglink
missinglink / teco-cats.md
Created June 10, 2013 13:36
Tesco - List Product Categories

List Product Categories

Generated: Mon Mar 18 2013 16:44:39 GMT+0000 (GMT)

Request

{
  "protocol": "https:",
  "host": "www.techfortesco.com",
  "method": "GET",
  "port": 443,
@missinglink
missinglink / tradeboubler-product.js
Created May 29, 2013 16:07
Tradedoubler Product
{
"products":[
{
"sourceProductId":"12-113-4917",
"name":"Tradedoubler Concert Ukulele",
"description":"This Concert Size Ukulele is part of the exciting range of premium-uniquely featured high grade series Ukuleles designed for the most professional and aspiring of musicians.",
"productUrl":"http://www.tradedoubler.com/products/12-113-4917/",
"productImage":{
"url":"http://www.tradedoubler.com/products/12-113-4917/images/main.jpg",
"width":500,
@missinglink
missinglink / skimlinks-product.js
Created May 29, 2013 16:07
Skimlinks Product
var child = require('child_process'),
util = require('util'),
netstat = child.spawn('netstat', ['-nb']),
out = ''
netstat.stdout.on('data', function(data) {
out += data
})
netstat.stderr.on('data', function(data) {
console.log('err: ' + data)
@missinglink
missinglink / lscron.sh
Created May 3, 2013 13:54
List all users' crontab (run as root) Note: This does not include scripts in /etc/cron.hourly, /etc/cron.daily, etc
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
#!/bin/bash
cd /scripts/
sudo ./wifi.sh mon
sudo ./hack.sh kick 00:1B:11:EF:49:94 00:24:36:b5:e7:3d 20
sudo ./wifi.sh man
sudo ./wifi.sh scan
sudo ./wifi.sh scan
sudo ./wifi.sh scan
sudo ./wifi.sh scan
#!/bin/bash
DIVIDER="--------------------------------------------------------------"
EOL=""
if [ -z "$1" ]; then
echo $DIVIDER
echo " Wifi 0.01 (Jan 17th 2008)."
echo " Usage: " $0 "[-action]"
echo " Choose which action to perform:"
#!/bin/bash
DIVIDER="--------------------------------------------------------------"
EOL=""
if [ -z "$1" ]; then
echo $DIVIDER
echo " Hack 0.01 (Jan 18th 2008)."
echo " Usage: " $0 "[-action]"
echo " Choose which action to perform:"
@missinglink
missinglink / zmq-install.sh
Created March 5, 2013 13:12
Install ZeroMq 3.x on Ubuntu / OSX
#!/bin/bash
if [[ `uname -s` == 'Darwin' ]]; then
brew update
brew install libtool autoconf automake
else
sudo apt-get update
sudo apt-get install -y libtool autoconf automake uuid-dev git-core
fi