Skip to content

Instantly share code, notes, and snippets.

View spangenberg's full-sized avatar
🦄

Daniel Spangenberg spangenberg

🦄
View GitHub Profile
We couldn’t find that file to show.
DAEMONS=(syslog-ng network netfs crond znc)
@spangenberg
spangenberg / gist:934647
Created April 21, 2011 14:36
Change fist stylesheets name from screen to canvas if the website is rendered in a iframe.
jQuery ->
if window is not window.top
link = $("link:first")
href = link.attr("href").replace /screen/, "canvas"
link.attr "href", href
dspangenberg@san-francisco:~$ euca-describe-availability-zones verbose
AVAILABILITYZONE dev_fog 192.168.1.100
AVAILABILITYZONE |- vm types free / max cpu ram disk
AVAILABILITYZONE |- m1.small 0002 / 0002 1 192 2
AVAILABILITYZONE |- c1.medium 0002 / 0002 1 256 5
AVAILABILITYZONE |- m1.large 0001 / 0001 2 512 10
AVAILABILITYZONE |- m1.xlarge 0001 / 0001 2 1024 20
AVAILABILITYZONE |- c1.xlarge 0000 / 0000 4 2048 20
@spangenberg
spangenberg / hash.rb
Created August 18, 2011 22:59
Hash methods
require 'ostruct'
class Hash
def key_strings_to_symbols!
r = Hash.new
self.each_pair do |k, v|
if k.kind_of?(String) && k =~ /^:/
v.key_strings_to_symbols! if v.kind_of?(Hash) && v.respond_to?(:key_strings_to_symbols!)
r[k.slice(1..-1).to_sym] = v
else
dhcp-host=d0:0d:*:*:*:*,ignore
/usr/lib/python2.7/dist-packages/imagestore/lib/fetch.py
add after the line 142
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
[Wed Oct 19 13:17:43 2011][002921][EUCAINFO ] doAttachVolume() invoked (id=i-3B34084E vol=vol-B692093E remote=//,192.168.2.21,iqn.2009-06.com.eucalyptus.cluster1:store2,PcH8fhzukhw8xEfE6gFcVQtF9VCg5IMJQ0F/Er4oS4R3JXUiSTUrk7vNMWdlUOPTeOZh49BIQlQx7p/mlYfBLj1u1BibSLG2diGYwJ23g2SaBePclNxYswcaSYbhR34KG8aTDEdElRgnhBbxxLnLOSqc2Seq7StPQlqc+7xy9tr8SjihE4cF3feMnNPa5oHEvy1aV/LRyowlhtSBZ1P9QRtUbdqK6Ga61v1xhPQdtVjjquTnh9nrkHmbgPnHTGGNWqrWOqeuvK6Yt6rWcW/YxtFc/dDXK/TYGq5SQgl5MoEIDaFnno/MPCa2fAvVQAi+jZjWn+E0U75GWeFFmbrAcQ== local=/dev/vda)
[Wed Oct 19 13:17:43 2011][002921][EUCAINFO ] connect_iscsi_target invoked (dev_string=//,192.168.2.21,iqn.2009-06.com.eucalyptus.cluster1:store2,PcH8fhzukhw8xEfE6gFcVQtF9VCg5IMJQ0F/Er4oS4R3JXUiSTUrk7vNMWdlUOPTeOZh49BIQlQx7p/mlYfBLj1u1BibSLG2diGYwJ23g2SaBePclNxYswcaSYbhR34KG8aTDEdElRgnhBbxxLnLOSqc2Seq7StPQlqc+7xy9tr8SjihE4cF3feMnNPa5oHEvy1aV/LRyowlhtSBZ1P9QRtUbdqK6Ga61v1xhPQdtVjjquTnh9nrkHmbgPnHTGGNWqrWOqeuvK6Yt6rWcW/YxtFc/dDXK/TYGq5SQgl5MoEIDaFnno/MPCa2fAvVQAi+jZjWn+E0U75GWeFFmbrAcQ==)
function mmc(){eval "osascript -e 'tell application \"MultiMarkdown Composer\" to open \"$PWD/$1\"'"}
file = File.open('links.txt', 'rb')
contents = file.read
links = {}
contents.scan(/(http.*); (\d{1,2}.\d{1,2}.\d{4})/).each do |pattern|
links[pattern[0]] = pattern[1]
end
links.sort.each do |k, v|