Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am powdahound on github.
  • I am garret (https://keybase.io/garret) on keybase.
  • I have a public key ASCxh69DoZg4wmKJw4vTpdG7avcneGhUfESiFmc_7qpezAo

To claim this, I am signing this object:

@powdahound
powdahound / duplicate-hipchat.sh
Created July 16, 2014 19:45
Create a copy of the HipChat OS X app. Download the script and run it, or paste lines 2 and 3 into your terminal
#!/bin/bash
cp -r /Applications/HipChat.app/ /Applications/HipChatTwo.app/
/usr/libexec/PlistBuddy -c "Set CFBundleIdentifier com.hipchat.HipChatTwo" /Applications/HipChatTwo.app/Contents/Info.plist
# Note that when you install an update to the HipChatTwo app it will overwrite the Info.plist
# file and you'll need to run the second command above once again, or run this script.
<!-- send to the user's JID -->
<iq type="get" to=1_1@chat.hipchat.com" id="123">
<query xmlns="http://hipchat.com/protocol/history" maxstanzas="50" type="chat" />
</iq>
<!-- results come back as normal <message> stanzas like they do when joining a room.
the iq response may come back before the messages do. its just a confirmation that we got the request. -->
@powdahound
powdahound / gist:5250837
Created March 27, 2013 01:30
Script powering Twisted mirror on github.com/powdahound/twisted
#!/bin/sh
cd /srv/misc/twisted_github_fork/repo
git svn rebase
git push origin master
@powdahound
powdahound / install_air.sh
Created January 21, 2013 15:55
Installing Adobe AIR on Ubuntu.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get install lib32asound2 lib32gcc1 lib32ncurses5 lib32stdc++6 lib32z1 libc6 libc6-i386 ia32-libs-gtk lib32nss-mdns
curl http://usablesoftware.files.wordpress.com/2011/02/getlibs-all-deb.pdf > getlibs-all.deb
<?php
$image_urls = array(
'http://b.thumbs.redditmedia.com/crFh5ZpigMuuO68U.png',
'http://i.imgur.com/Boqat.png',
'http://i.imgur.com/gwfE3.png',
'http://i.imgur.com/WRBMg.png',
'http://i.imgur.com/C1fqv.png',
'http://i.imgur.com/Ycc5g.png',
'http://i.imgur.com/wsow1.png'
dev:~ redis-cli
redis 127.0.0.1:6379> get foo
(nil)
redis 127.0.0.1:6379> set foo bar
OK
redis 127.0.0.1:6379> get foo
"bar"
redis 127.0.0.1:6379> expire foo 5
(integer) 1
redis 127.0.0.1:6379> ttl foo
@powdahound
powdahound / default.rb
Created September 13, 2011 17:11
hosts cookbook
# Find all other nodes
nodes = {}
search(:node, "chef_environment:#{node.chef_environment}") do |n|
# skip current node
if n[:fqdn] and n[:fqdn] != node[:fqdn]
nodes[n[:fqdn]] = n
end
end
Chef::Log.info "Other hosts: #{nodes.keys.sort.join(', ')}"
2011-09-06T00:33:34.743416+00:00
2011-09-06T00:54:22.163846+00:00
2011-09-06T01:33:37.769745+00:00
2011-09-06T01:54:29.956684+00:00
2011-09-06T02:33:39.601303+00:00
2011-09-06T02:54:31.254695+00:00
2011-09-06T03:33:42.972409+00:00
2011-09-06T03:54:34.945778+00:00
2011-09-06T04:33:44.081260+00:00
2011-09-06T04:54:36.898843+00:00
Module Foo
Module Bar
def Bar.get_blah
# in my case, get_blah actually does a bunch of databag fetching and generates a nice Hash, but access to the node object is what matters here
return node[:blah]
end
end
end