This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source accepts the protocol s3:// with the host as the bucket | |
# access_key_id and secret_access_key are just that | |
s3_file "/var/bulk/the_file.tar.gz" do | |
source "s3://your.bucket/the_file.tar.gz" | |
access_key_id your_key | |
secret_access_key your_secret | |
owner "root" | |
group "root" | |
mode 0644 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fabric.api import local, run | |
from pyquery import PyQuery as pq | |
BASE_URL = "http://hackermonthly.com/" | |
HACKER_URL = "http://hackermonthly.com/issues.html" | |
d = pq(url=HACKER_URL) | |
issue_list = d("#issues li a") | |
def get_issue(inex, node): | |
d = pq(node) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z $OS_TOKEN ] ; then | |
export OS_TOKEN=$(python -c 'from fuelclient.client import Client | |
print Client().auth_token') | |
echo got my own OS_TOKEN=${OS_TOKEN} | |
fi | |
curl -H "X-Auth-Token: $OS_TOKEN" $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dockerctl shell nailgun | |
manage.py drobdb | |
manage.py syncdb | |
manage.py loaddefault | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ask for a password only once | |
sudo true | |
export CONFIG_FOR="16GB" | |
source ./config.sh | |
source ./functions/vm.sh | |
source ./functions/network.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://winhelp2002.mvps.org/hosts.txt -qO - |\ | |
sudo bash -c "sed 's/^\(.*\).$/\1/' >>/etc/hosts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'psych' | |
module SafeYAML | |
def self.dump obj, io = nil, options = {} | |
visitor = Psych::Visitors::YAMLTree.new(options) | |
visitor << obj | |
ast = visitor.tree | |
ast.grep(Psych::Nodes::Scalar).each do |node| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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"); |
OlderNewer