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
scutil --dns shows: | |
resolver #1 | |
domain : comcast.net. | |
nameserver\[0] : 208.67.222.222 | |
nameserver\[1] : 208.67.220.220 | |
order : 200000 | |
Indeed, /etc/resolv.conf was generated as: |
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 | |
# add the -DisableSleepProxyClient flag to mDNSResponder.plist | |
sudo sed -i -e \ | |
's#\(<string>-launchd\)\(</string>\)#\1 -DisableSleepProxyClient\2#' \ | |
/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist |
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
# http://projecteuler.net/problem=4 | |
def palindrome? s | |
s.to_s == s.to_s.reverse | |
end | |
products = [] | |
nums = (100..999).to_a | |
nums.each do |n| | |
nums.each do |x| | |
products << product if palindrome? n*x |
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
# | |
# for use on linux systems with kerio-connect installed via rpm | |
# | |
check process kerio-connect with pidfile /var/run/kms.pid | |
group mail | |
start program = "/etc/init.d/kerio-connect start" | |
stop program = "/etc/init.d/kerio-connect stop" | |
if failed host 127.0.0.1 port 25 protocol smtp then restart | |
if 5 restarts within 5 cycles then timeout | |
depends on kerio_mailserver_bin |
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
# NAME: authinabox | |
# VERSION: 1.01 (Dec 27, 2008) | |
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ] | |
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication | |
# system for both session-based logins OR HTTP Basic auth (for APIs, etc). | |
# This is an "all in one" system so you will probably need to heavily tailor | |
# it to your own ideas, but it will work "out of the box" as-is. | |
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though) | |
# - NEEDS DataMapper! | |
# - Less work needed if you use initializer library -- http://gist.github.com/40238 |
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 | |
set -v | |
function usage() { | |
echo "" | |
echo "usage: ./$0 deployment_username [deployment_group]" | |
echo "" | |
echo "Examples:" | |
echo " ./$0 marshmallow deployers" | |
exit 1 |
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 | |
set -v # verbose output | |
# | |
# Migrate a list of existing subversion repositories to git using svn2git. Assumes | |
# the following repository layouts: | |
# svn://example.com/<repository>/ | |
# assets/ | |
# branches/ | |
# trunk/ |
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 http://snippets.aktagon.com/snippets/329-Simple-script-for-adding-existing-project-to-git-gitosis | |
GIT_USER=git | |
SERVER=xxx.com | |
APP=xxx | |
touch tmp/.gitignore log/.gitignore vendor/.gitignore | |
find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore | |
cat <<EOF<<EOF >>.gitignore |
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
echo "exists db/migrate | |
create db/migrate/20110506220427_add_shared_column_to_resources.rb | |
"| head -n 2 | tail -n 1 | sed -e 's/.*create[[:space:]]*\(db\/migrate\)/\1/' |
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 generate_new_ssl_cert() { | |
if [ -z $1 ]; then | |
echo "" | |
echo "usage: generate_new_ssl_cert example.com" | |
exit 1 | |
fi | |
keydir=/etc/httpd/conf/ssl.key | |
csrdir=/etc/httpd/conf/ssl.csr | |
domain=${1} |