Skip to content

Instantly share code, notes, and snippets.

View vitaminmoo's full-sized avatar
🕶️
H͓̼͛ͥ͆͒̂͋E̴ ̌͆C̥̥͙͈̗͛̀͞O͙̗͔͔̞͕͘M̡̙̙̈́ͣ̓Ḛ̯̗̱ͨͨS̤̲̉͌

Graham Forest vitaminmoo

🕶️
H͓̼͛ͥ͆͒̂͋E̴ ̌͆C̥̥͙͈̗͛̀͞O͙̗͔͔̞͕͘M̡̙̙̈́ͣ̓Ḛ̯̗̱ͨͨS̤̲̉͌
View GitHub Profile
#!/bin/bash
set -e
TMP=$(mktemp -d)
UPDATES_URL="http://updates.jenkins-ci.org/download/plugins/"
if [ $# -lt 2 ]; then
echo "USAGE: $0 plugin-list-file destination-directory"
@vitaminmoo
vitaminmoo / rdiofavorites.js
Created November 18, 2015 05:53
Slightly modified https://gist.github.com/sunahsuh/33fccd416a33bbdea466 - Bookmarklet to convert rdio favorites to csv. Songs will be in doublequotes. Use control-minus until all items are visible before clicking
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
$(".GridItem:visible")
.children(".lower_content")
.children(".grid_description")
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1

owGbwMvMwMF4zGrb+qPuD3sYTx94l8QQrHLyY7VSUn5KpZJVtVJ2KphKy8xLTy0q
KMrMK1GyUkoxNTQxTzZNSzYztjBJTTWzSDRJNU5MMk0yMjQ2N0pJNjNLS05KMzFV
0lHKyC8G6QAak5RYnKqXmQ8UA3LiM1OAok5g9S7OZmZuzk5uYPWlYAkDg7RkUwuT
FIuUZFMzo2QLU0NzE8PERGPTJMvERBMDA5DC4tSivMTcVKDqssySxNzMvNz8fKVa
HSWgeFlmcirI1VD59MySjNIkfHpKKgtAguWpSfFQ7fFJmXkpQE8DdZWlFhVn5ucp
WRkCVSaXZIL0GxpbmlgaWloaGeoopVYUZBalxmeCVJiam1kYAIGOUkFRahnQyGTD
@vitaminmoo
vitaminmoo / ghu.sh
Created August 3, 2012 00:53
Bash sub to return the github url the current git working tree, or a specific file if specified. Currently links to HEAD of the default branch.
ghu() {
if [ $(git rev-parse --is-inside-work-tree) = 'true' ]
then
test ! -z "$1" && file=$(readlink -f "$1")
url=$(git remote -v | sed '/fetch/d; s/.*\@//; s/ .*//; s/:/\//; s/^/https:\/\//')
top=$(git rev-parse --show-toplevel)
echo $url/tree/master$(echo $file | sed "s.^$top..")
else
echo "not inside a git working directory"
fi
@vitaminmoo
vitaminmoo / gist:1847137
Created February 16, 2012 19:24
func it
# old:
type = 'default'
m = re.search(r'(?<=type=)([^,]*)', key)
if m:
type = re.sub(r'\s+', '_', m.group())
name = 'default'
m = re.search(r'(?<=name=)([^,]*)', key)
if m:
name = re.sub(r'\s+', '_', m.group())
Chef::Exceptions::FileNotFound: remote_directory[/mnt/services/helium/helium-1.3.9] (helium::default line 43) had an error: cookbook helium has no directory files/helium/helium-1.3.9
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/cookbook_version.rb:678:in `relative_filenames_in_preferred_directory'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/remote_directory.rb:74:in `files_to_transfer'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/remote_directory.rb:41:in `action_create'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `each'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `conver
Generated at Thu Feb 02 19:23:52 -0500 2012
Chef::Exceptions::FileNotFound: remote_directory[/mnt/services/helium2/helium-1.3.9] (helium::helium2 line 43) had an error: cookbook helium has no directory files/helium2/helium-1.3.9
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/cookbook_version.rb:678:in `relative_filenames_in_preferred_directory'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/remote_directory.rb:74:in `files_to_transfer'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider/remote_directory.rb:41:in `action_create'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `send'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:437:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in `run_action'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `converge'
/usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in `each'
@vitaminmoo
vitaminmoo / gist:1684009
Created January 26, 2012 17:48
deleted files
delete mode 100644 cookbooks/hbasemaster/files/default/hbasemaster/hbase-0.90.4/src
delete mode 100644 cookbooks/hbaseregion/files/default/hbaseregion/hbase-0.90.4/src
delete mode 100755 cookbooks/datanode/files/default/datanode/hadoop-0.20.2-cdh3u0/doc
delete mode 100755 cookbooks/datanode/files/default/datanode/hadoop-0.20.2-cdh3u0/src
delete mode 100755 cookbooks/hbasemaster/files/default/hbasemaster/hbase-0.90.3/doc
delete mode 100755 cookbooks/hbasemaster/files/default/hbasemaster/hbase-0.90.3/src
delete mode 100755 cookbooks/hbasemaster/files/default/hbasemaster/hbase-0.90.4/doc
delete mode 100755 cookbooks/hbasemaster/files/default/hbasemaster/hbase-0.90.4/src
delete mode 100755 cookbooks/hbaseregion/files/default/hbaseregion/hbase-0.90.3/doc
delete mode 100755 cookbooks/hbaseregion/files/default/hbaseregion/hbase-0.90.3/src
#!/usr/bin/perl
use Benchmark qw(:all);
$a = "foo[bar]moo";
cmpthese(
10000000, {
capture => sub {
$a =~ /\[(\w)\]/;
$1;
[root@dmz20 haproxy]# cat /etc/sysctl.conf
# Auto generated by Chef at Wed Jan 18 23:39:37 +0000 2012
# default, imported from main cookbook
net.ipv4.tcp_wmem = 4096 4096 16777216
# default, imported from main cookbook
net.unix.max_dgram_qlen = 65535
# default, imported from main cookbook