This file contains hidden or 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
| GIT_SSH_COMMAND='ssh -i private_key_file' git clone host:repo.git |
This file contains hidden or 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 | |
| command=$2 | |
| sudo="" | |
| case "$1" in | |
| nginx) | |
| service=/Library/LaunchDaemons/homebrew.mxcl.nginx.plist | |
| sudo="sudo " | |
| ;; |
This file contains hidden or 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 'rubygems' | |
| require 'redis' | |
| r = Redis.new(:host => "127.0.0.1", :port => 6379, :db => 5) | |
| r.multi do | |
| r.del 'smtp_servers' | |
| r.del 'smtp_servers_conf' | |
| r.rpush 'smtp_servers', 11 | |
| r.rpush 'smtp_servers', 12 |
This file contains hidden or 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 ruby | |
| # /usr/bin/clean_postfix_queue.rb | |
| # */10 * * * * /usr/bin/clean_postfix_queue.rb | |
| require 'time' | |
| IO.popen("/usr/sbin/postqueue -p") do |readme| | |
| readme.each do |line| | |
| q_id = nil | |
| if line =~ /^(\w+)(\*|\!)?\s/ | |
| q_id = $1 | |
| end |
This file contains hidden or 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 | |
| TIMESTAMP=$(date +%F-%H%M) | |
| MONGODUMP_PATH="/usr/bin/mongodump" | |
| S3CMD_PATH="/usr/bin/s3cmd" | |
| MONGO_DATABASES=$(echo "show dbs" | mongo | cut -d' ' -f1 | tail -n +3 | head -n -1) | |
| S3_BUCKET="backup" | |
| BACKUPS_DIR="/backups" | |
| mkdir -p $BACKUPS_DIR | |
| chmod 777 $BACKUPS_DIR |
This file contains hidden or 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 i in `find . -type d -empty`; do touch $i/.gitignore; done |
This file contains hidden or 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
| UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); |