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 nopt = require('nopt'), | |
parse = require('url').parse, | |
WebSocket = require('faye-websocket'); | |
// | |
// All based and derived on: http://www.igvita.com/2012/04/09/driving-google-chrome-via-websocket-api | |
// | |
// The remote debugging protocol is... I don't have words right now. | |
// Other than thanks thanks thanks thanks x10e901920 |
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 Chrome = require('chrome-remote-interface'); | |
Chrome(function (chrome) { | |
with | |
(chrome) { | |
var url = 'http://example.com'; | |
var params = { | |
'expression': 'for (var i = 0; i < 10; i++)' + | |
'window.open("' + url + '", "_blank");' | |
}; | |
Runtime.evaluate(params, function (error, response) { |
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
--- | |
- name: Stop all running logspout containers | |
shell: "docker ps | sed -e '1d' | grep logspout | awk {'print $1'} | xargs docker stop || :" | |
ignore_errors: yes | |
when: force_pull | |
- name: delete all Logspout containers | |
shell: "docker ps -a | grep logspout | awk '{print $1}' | xargs docker rm -f || :" | |
ignore_errors: yes | |
when: force_pull |
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
[root@shinystorage tank]# zpool iostat tank | |
capacity operations bandwidth | |
pool alloc free read write read write | |
---------- ----- ----- ----- ----- ----- ----- | |
tank 14.2G 18.1T 0 126 0 15.4M | |
[root@shinystorage tank]# zpool status tank -v | |
pool: tank |
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
body { | |
background: black !important; | |
color: white !important; | |
} | |
span { | |
background: black; | |
color: white !important; | |
} |
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
require 'sinatra' | |
require 'redis' | |
require 'json' | |
require 'securerandom' | |
get '/l/:token' do | |
redis = Redis.new | |
token_contents = redis.get(params[:token]) | |
if token_contents | |
redirect token_contents |
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
class FileCache(dict): | |
def __init__(self, *args, **kwargs): | |
self._filename = kwargs.pop('filename', None) | |
dict.__init__(self, *args, **kwargs) | |
def __missing__(self, key): | |
if self._filename: | |
with open(self._filename, 'r') as f: | |
self.update(json.load(f)) |
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
# Find ALL the port users. _o/ | |
findbyport() { | |
lsof -nP | grep ":$@" | awk '{print "Program: " $1 "\n" "PID: "$2 "\n" "User: " $3 "\n" "Address: "$9 "\n" "Action: " $10}' | |
} | |
portsinuse() { | |
lsof -nP | grep "IPv" | while read line; do echo $line | awk '{print "Program: " $1 "\n" "PID: "$2 "\n" "User: " $3 "\n" "Address: "$9 "\n" "Action: " $10}'; echo; 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
function getProgress() { | |
$.ajax({ | |
dataType: "json", | |
url: '/progress' | |
}) | |
.done(function (data) { | |
var total = data.total; | |
var current = data.current; | |
var percentage = (current / total * 100); | |
$('.progress .progress-bar').width(percentage + '%'); |
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
RACKSPACE_CONFIG = { | |
'production' => { | |
path: '', | |
storage: :fog, | |
fog_credentials: { | |
provider: 'Rackspace', | |
rackspace_username: ENV['RACKSPACE_USERNAME'], | |
rackspace_api_key: ENV['RACKSPACE_API_KEY'], | |
persistent: false | |
}, |