Skip to content

Instantly share code, notes, and snippets.

@sturadnidge
sturadnidge / keybase.md
Created October 5, 2014 09:54
keybase.io validation

Keybase proof

I hereby claim:

  • I am sturadnidge on github.
  • I am stu (https://keybase.io/stu) on keybase.
  • I have a public key whose fingerprint is D119 6CCC 1CA6 35C7 ADA2 FB55 1528 858E 6E7D 4E0B

To claim this, I am signing this object:

@sturadnidge
sturadnidge / loungeWatch.js
Last active August 29, 2015 14:07
CSGO Lounge Match Watcher
'use strict';
// npm install cheerio moment optimist
var http = require('http'),
cheerio = require('cheerio'),
moment = require('moment'),
argv = require('optimist')
.usage('\nCheck csgolounge match stats every 30 secs.\n\nUsage: $0')
.demand(['d', 'i', 'm'])
@sturadnidge
sturadnidge / steamMarketWatch.js
Last active January 1, 2016 16:02
Watches an item in the Steam market place and highlights it if price drops below desired value
'use strict';
// npm install colors moment optimist
// builtins
var http = require('http'),
// 3rd party
colors = require('colors/safe'),
moment = require('moment');
@sturadnidge
sturadnidge / hexGen.js
Created October 25, 2014 15:24
Generates a random 6 digit hex
// nice one paul irish + friends
// http://www.paulirish.com/2009/random-hex-color-code-snippets/
function hexGen() {
return Math.floor(Math.random()*16777215).toString(16)
}
@sturadnidge
sturadnidge / uuidGen.js
Created October 25, 2014 15:38
Generate a UUID... use node-uuid if you can though.
function uuidGen() {
var uuid = 'xxxxxxxxxxxxyxxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g,
function(c) {
var r = Math.random() * 16 | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
return uuid;
}
@sturadnidge
sturadnidge / steamSaleWatch.js
Created March 13, 2015 11:07
Watch for discounts on Steam games!
'use strict';
// npm install cheerio colors moment optimist
// builtins
var http = require('http'),
// 3rd party
cheerio = require('cheerio'),
colors = require('colors/safe'),
moment = require('moment'),
@sturadnidge
sturadnidge / steamGetFloatValue.js
Created January 1, 2016 17:28
Gets the float value of a Steam inventory item
'use strict';
/*jshint node:true */
// npm install lodash colors minimist request sync-request
var _ = require('lodash'),
colours = require('colors/safe'),
parseArgs = require('minimist'),
request = require('request'),
requestSync = require('sync-request'),
@sturadnidge
sturadnidge / genCert.md
Last active March 21, 2023 09:38
Generate a self signed certificate in 1 line + a config file

To generate a self-signed cert, do the following:

openssl req -config 12factor.req -new -nodes -x509 -newkey rsa:2048 -sha256 -keyout 12factor.key -out 12factor.cert -days 3650

Where 12factor.req is:

[ req ]
default_bits        = 2048
default_keyfile     = 12factor.key
@sturadnidge
sturadnidge / pivnet_download.sh
Last active April 10, 2017 08:20
Pivnet Download File
wget -O "<filename>" --header="Authorization: Token ${PIVNET_TOKEN}" file/to/download
@sturadnidge
sturadnidge / opsman_upload.sh
Last active August 4, 2017 01:46
Upload File to Ops Manager
#!/bin/bash
# uaac is an alias set in .profile of ops manager user
shopt -s expand_aliases
source ~/.profile
function usage {
printf "Usage: ${0##*/} <file-to-upload.pivotal>\n"
exit 1
}