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 | |
# Nasty, intentionally verbose script to start/stop mongod | |
# Mark Woods - March 2010 | |
RUNTIME_USER='nobody' # only applicable on Linux, otherwise runs as current user | |
LOGPATH='/var/log/mongodb/mongod.log' | |
CONFIGFILE='/etc/mongod.conf' | |
DBPATH='/opt/mongodb/data/db' | |
BINPATH='/opt/mongodb/bin/mongod' |
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 "mysql_big_table_migration_helper" | |
class AddIndexOnSomeColumnToSomeTable < ActiveRecord::Migration | |
extend MySQLBigTableMigrationHelper | |
def self.up | |
add_index_using_tmp_table :some_table, :some_column | |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'term/ansicolor' | |
require 'net/ping' | |
String.send(:include, Term::ANSIColor) | |
url = ARGV[0] |
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 ruby | |
require 'rubygems' | |
require 'autotest' | |
require 'optparse' | |
# exit if we're not in a git repository | |
exit $?.exitstatus unless system('git diff --name-only > /dev/null') | |
# make sure we're in the root path for the repository |
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 ruby | |
# When committing directly to master, look for lighthouse ticket number in commit msg and, if necessary, append in format recognised by github | |
# When committing to a topic/feature branch, barf if the branch name doesn't include a ticket number that can be parsed by the post-merge hook | |
# Note: this hook only applies when -m option used and can also be skipped by using --no-verify option | |
COMMIT_MASTER_STATE = 'coding-done' | |
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 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
/* save this file to ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
/* | |
Prefixes for modifier keys... | |
------------------------------ | |
~ Option key (⌥) | |
$ Shift key (⇧) | |
^ Control key (⌃) | |
@ Command key (⌘) | |
# keys on number pad |
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 ruby | |
# this simple script takes two arguments, the rails environment we're deploying to and a commit range to be passed to git-log | |
# The commit range MUST be in the format <full sha of previous revision>..<full sha of current revision>, otherwise the world will end | |
# It looks at git commit messages between the previous and current revision, extracts lighthouse ticket numbers where they are provided | |
# in the commit message; updates the ticket in lighthouse, changing the state to 'resolved' for deploys to production, both changing | |
# state to 'uat' and re-assigning the ticket to the creator for deploys to stage; then sends an email listing the deployed tickets. | |
# Note: if rails environment is edge, does a dummy run as if it was deploying to stage, but doesn't save updates to tickets or send the email |
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 ruby | |
# Dumb-ass Daily Backup - Better than no backup, and so simple it can't fail! | |
# | |
# A backup directory will be created within the destination directory for each key of the sources hash. | |
# Values can be files, directories or glob patterns. | |
# Directories will be backed up as gzipped tar archives, text files are gzipped, binary files are copied. | |
# Create a /etc/dumb_ass_daily_backup.yml config file to override the default sources and destination. | |
# Nothing fancy, no incremental backups, no syncing to remote servers, just a dumb backup script. |
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 ruby | |
# Dumb-ass Remote Copy - Copy dumb-ass daily backups to remote servers using scp, genius! | |
# | |
# Copies today's sub-directory of local source directory to remote destination directory. | |
# Uses only ssh and scp, but requires batch mode / authorized keys. | |
# Does not "sync" files, today's destination directory is trashed and everything is copied. | |
# Copies recursively, maintaining directory structure on remote host, but does so by creating | |
# directories as required and executing scp once for each file to copy - slow, but robust. | |
# Create a /etc/dumb_ass_remote_copy.yml config file to override default configuration options. |
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
# Allow pseudo long options based on naming convention. | |
# Long opts are converted to short opts by simply discarding all but | |
# the first character, which does nothing more than allow for more | |
# readable argument lists. | |
set -- `echo " $@ " | sed s/\ "-\{1,\}\([a-zA-Z]\)[-a-z]\{1,\}[=\ ]/\ -\1\ /g"` |
OlderNewer