Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/bash | |
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
rulefile="rules.tmp" | |
echo "" > $rulefile | |
sudo pfctl -a com.apple/tun -F nat | |
for i in "${interfaces[@]}" | |
do | |
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
echo $RULE >> $rulefile | |
done |
#!/usr/bin/env python | |
import virtinst.util | |
print "UUID:\t", virtinst.util.uuidToString(virtinst.util.randomUUID()) | |
print "MAC:\t", virtinst.util.randomMAC(type="qemu") | |
# for one-liner | |
# python -c 'from virtinst.util import *; print uuidToString(randomUUID())' | |
# python -c 'from virtinst.util import *; print randomMAC(type="qemu")' |
#!/usr/bin/env ruby | |
require 'yaml' | |
# fuel rel --rel X --deployment-tasks --download | |
tasks_file = ARGV[0] | |
role = ARGV[1] | |
tasks = YAML.load_file(tasks_file) | |
def info(task) |
#!/usr/bin/env python | |
import itertools | |
import socket | |
import time | |
from launchpadlib import uris | |
from launchpadlib.launchpad import Launchpad | |
#!/usr/bin/env python | |
from launchpadlib import uris | |
from launchpadlib.launchpad import Launchpad | |
def get_abandoned_bugs(projects=None): | |
if projects is None: | |
projects = [ | |
'nova' |
#!/usr/bin/env python | |
import itertools | |
from launchpadlib import uris | |
from launchpadlib.launchpad import Launchpad | |
if __name__ == "__main__": | |
projects = [ | |
'nova', |
# | |
# exists.rb | |
# | |
# James Fellows 8/8/12: cloned from git://gist.github.com/1160472.git then | |
# modified to resolve puppet:/// paths | |
# | |
# Copyright 2011 Puppet Labs Inc. | |
# Copyright 2011 Krzysztof Wilczynski | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); |
grep -q "[base]" /etc/yum.repos.d/extra.repo 2>/dev/null || cat <<EOF >>/etc/yum.repos.d/extra.repo | |
##### | |
[base] | |
name=CentOS-\$releasever - Base | |
mirrorlist=http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=os | |
gpgcheck=0 | |
##### | |
EOF |
def safe_yaml_dump(obj) | |
visitor = Psych::Visitors::YAMLTree.new({}) | |
visitor << obj | |
visitor.tree.grep(Psych::Nodes::Scalar).each do |node| | |
node.style = Psych::Nodes::Scalar::DOUBLE_QUOTED if | |
node.value =~ /^0[xbod]+/i && node.plain && node.quoted | |
end | |
visitor.tree.yaml(nil, {}) | |
end |