Skip to content

Instantly share code, notes, and snippets.

View btisdall's full-sized avatar

Ben Tisdall btisdall

View GitHub Profile
stop)
log_daemon_msg "Stopping $DESC" "$NAME"
set +e
if [ -f "$CATALINA_PID" ]; then
start-stop-daemon --stop --pidfile "$CATALINA_PID" \
--user "$TOMCAT7_USER" \
--retry=TERM/20/KILL/5 >/dev/null
if [ $? -eq 1 ]; then
log_progress_msg "$DESC is not running but pid file exists, cleaning up"
ubuntu@ip-10-56-74-62:~/node-v0.10.26$ make test
make -C out BUILDTYPE=Release V=1
make[1]: Entering directory `/home/ubuntu/node-v0.10.26/out'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/ubuntu/node-v0.10.26/out'
ln -fs out/Release/node node
/usr/bin/python tools/test.py --mode=release simple message
=== release test-child-process-fork-dgram ===
Path: simple/test-child-process-fork-dgram
assert.js:92
for i in $(git ls-files '*.json'); do echo -n "Checking $i..."; if ruby -rjson -e 'JSON.parse(ARGF.read)' $i; then echo "OK"; else echo "$i failed validation"; break; fi; done
foo
var http = require('http'),
url = require('url');
var server = http.createServer().listen(8080, 'localhost');
server.on('request', function(req, res) {
var _url = url.parse(req.url, true);
console.log(_url);
res.end();
});
bentis@wormhole:~
$ sudo mtr --report -c100 bbc.co.uk
Start: Tue Mar 11 14:31:40 2014
HOST: wormhole.local Loss% Snt Last Avg Best Wrst StDev
1.|-- 192.168.1.1 0.0% 100 2.7 2.5 1.7 7.5 0.9
2.|-- 213.191.64.208 11.0% 100 33.8 45.0 22.0 237.8 35.6
3.|-- 62.53.10.230 10.0% 100 29.0 38.8 20.9 127.0 21.7
4.|-- ae0-0.pr01.asham.de.hanse 14.0% 100 41.6 39.5 20.9 100.4 19.4
5.|-- rmwc-hmbg-de03-chan-0-0.n 9.0% 100 50.8 44.2 20.9 179.6 29.9
6.|-- rmwc-hmbg-de04-xe-0-0-2-0 9.0% 100 22.4 44.1 21.2 144.7 24.3
# vi:syntax=ruby
module Ben
class Test < Thor
desc "example", "an example task"
def example
puts "I'm a thor task!"
end
#!/bin/bash
#
# Runs the 'Duplicate iTerm tab' AppleScript, enabling iTerm 2 to run this AppleScript when a
# given keyboard shortcut is triggered.
get_tty_cwd(){
TTY=$1
PID=`ps -f | grep $TTY | head -n 1 | awk '{ print $2; }'`
lsof -a -d cwd -F n -p $PID | egrep -v 'p[0-9]+' | awk '{ sub(/^n/, ""); print; }'
}
export -f get_tty_cwd
vagrant@vagrant-ubuntu-precise-64:~$ curl -XGET localhost:9200/_cluster/nodes?pretty
{
"ok" : true,
"cluster_name" : "elasticsearch",
"nodes" : {
"-Luem-G4QN6TZ8uO8uE5xA" : {
"name" : "Monica Rappaccini",
"transport_address" : "inet[/10.0.2.15:9300]",
"hostname" : "vagrant-ubuntu-precise-64",
"version" : "0.90.11",
include_recipe "apt"
apt_repository 'brightbox-ruby' do
uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu'
distribution node['lsb']['codename']
components ['main']
keyserver 'keyserver.ubuntu.com'
key 'C3173AA6'
notifies :run, "execute[apt-get update]", :immediately
end