This template script was retrieved from BigSmoke's Blog on 18 February 2011. It was originally authored by [Wiebe Cazemier](mailto:Wiebe Cazemier ) and he deserves the credit. I am putting it on gist.github.com so I don't lose it, mostly, although I hope someone else is able to find it as useful as I do.
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 | |
# | |
# Author: Ryan Long ([email protected]) | |
# | |
# This script requires two arguments, akin to the `mv` command, and it automates the following process: | |
# - mv $1 $2 | |
# - ln -s $2 $1 | |
# | |
# More info is below in the dohelp() function; or call the script with the `--help' option. | |
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
This is meant to supplement the question on StackOverflow, here: | |
http://stackoverflow.com/questions/7137985/git-rebase-i-head7-showing-only-noop-in-editor |
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
# Make sure you can use mpc from your command line before running this. | |
soma = { "Groove Salad (ambient/electronica)" => 'groovesalad', | |
"Suburbs of Goa (world)" => 'suburbsofgoa', | |
"Lush (electronica)" => 'lush', | |
'Digitalis (electronica/alternative)' => 'digitalis', | |
'480 Minutes (alternative)' => '480min', | |
'Indie Pop Rocks! (alternative)' => 'indiepop', | |
'PopTron (alternative)' => 'poptron', | |
'Black Rock FM (eclectic)' => 'brfm', |
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/ruby | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
module Tty extend self | |
def blue; bold 34; end | |
def white; bold 39; end | |
def red; underline 31; end | |
def reset; escape 0; end | |
def bold n; escape "1;#{n}" 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
# usage: | |
# bundle exec rake locale:file RAILS_ENV=production | |
# if you want to export a different locale (not en.yml), provide locale option, as follows: | |
# bundle exec rake locale:file RAILS_ENV=production locale=ru | |
require 'mongo-i18n' | |
def write_to_database(sc, path, value) | |
key = path.join('.') | |
sc[key] = value.to_json |
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
##################### ElasticSearch Configuration Example ##################### | |
# This file contains an overview of various configuration settings, | |
# targeted at operations staff. Application developers should | |
# consult the guide at <http://elasticsearch.org/guide>. | |
# | |
# The installation procedure is covered at | |
# <http://elasticsearch.org/guide/reference/setup/installation.html>. | |
# | |
# ElasticSearch comes with reasonable defaults for most settings, |
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
finished = [] | |
ips = [] | |
range = 1..254 | |
range.each do |i| | |
ip_address = "192.168.111.#{i}" | |
Thread.new do | |
`ping -q -c1 -W1 #{ip_address}`.split(/\n+/)[2].split(/,\s*/)[1].to_i > 0 and ips << ip_address | |
finished << i | |
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
<fields> | |
<!-- Valid attributes for fields: | |
name: mandatory - the name for the field | |
type: mandatory - the name of a previously defined type from the | |
<types> section | |
indexed: true if this field should be indexed (searchable or sortable) | |
stored: true if this field should be retrievable | |
compressed: [false] if this field should be stored using gzip compression | |
(this will only apply if the field type is compressable; among | |
the standard field types, only TextField and StrField are) |
OlderNewer