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
export PS1="\[\e[36;1m\]\u@\[\e[32;1m\]`cat /etc/chef/client.rb | grep node_name |sed 's/node_name "\(.*\)\"/\1/'` \w\a\e[32;1m\]> \[\e[0m\]" |
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
## Knife plugin to generate an OpenSSH config file from a Chef search | |
# From Harvest. www.getharvest.com | |
# | |
# Source: https://github.com/harvesthq/knife-plugins | |
# | |
# See http://wiki.opscode.com/display/chef/Knife+Plugins | |
# See http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5 | |
# | |
## Install | |
# Place in .chef/plugins/knife/sshgen.rb |
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
# (1) copy the newrelic rpm java client into #{RAILS_ROOT}/solr/newrelic | |
# (2) add a newrelic.yml in that directory with you API key | |
# (3) add this monkey patch in an initializer to load newrelic with the solr server | |
Sunspot::Rails::Server.class_eval do | |
def run | |
command = ['java'] | |
command << "-Xms#{min_memory}" if min_memory | |
command << "-Xmx#{max_memory}" if max_memory | |
command << "-Djetty.port=#{port}" if port | |
command << "-Dsolr.data.dir=#{solr_data_dir}" if solr_data_dir |
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
import socket | |
import sys | |
host = sys.argv[1] | |
port = int(sys.argv[2]) | |
sock = socket.socket() | |
sock.connect((host,port)) | |
print sock.recv(4096) | |
sock.close |
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 | |
rm -rf * | |
mv .git/config /tmp/git_config | |
rm -rf .git | |
git init | |
mv -f /tmp/git_config .git/config | |
touch .gitignore | |
git add . | |
git commit -m "Code cleanup" | |
git push -f |
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
site :opscode | |
cookbook 'ntp' |
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
var page = require('webpage').create(), | |
system = require('system'), | |
address; | |
if (system.args.length === 1) { | |
console.log('Usage: phantomjs url_requests.js http://some.url.com'); | |
phantom.exit(1); | |
} else { | |
address = system.args[1]; | |
var logUrl = function (req) { |
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
function git { | |
if [ -d .git ]; then | |
/usr/bin/git $* | |
else | |
for dir in $(find . -maxdepth 2 -name ".git"); do | |
cd ${dir%/*} | |
/usr/bin/git $* | |
cd - | |
done | |
fi |
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 | |
# /etc/init.d/tightvncserver | |
VNCUSER='pi' | |
case "$1" in | |
start) | |
su $VNCUSER -c '/usr/bin/tightvncserver :1' | |
echo "Starting TightVNC Server for $VNCUSER " | |
;; | |
stop) | |
pkill Xtightvnc |
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
#!/usr/bin/env python | |
import sys | |
import json | |
from collections import OrderedDict | |
opts = { | |
'format' : 'txt', | |
'keys' : sys.argv[1:] | |
} |
OlderNewer