Skip to content

Instantly share code, notes, and snippets.

@rtlong
rtlong / programmers_dvorak.menu.lst
Created April 3, 2010 07:41
GRUB programmers dvorak keymap. Utilize your DVORAK layout within GRUB consoles and editing/debugging
# GRUB programmers dvorak keymap - Ryan T Long <ryan@rtlong.com>
# paste this in the top of your menu.lst (above any menu items)
# row 1
setkey dollar backquote
# setkey tilde tilde
setkey ampersand 1
setkey percent exclam
setkey bracketleft 2
setkey 7 at
@rtlong
rtlong / README.md
Created February 18, 2011 21:59
Template bash script, for when you need something over-engineered.

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.

@rtlong
rtlong / move-then-link-to.sh
Created February 19, 2011 00:10
This script automates the process of moving a file or directory, then creating a link from it's new location to it's old location. I am using it to add application config files to my Dropbox folder.
@rtlong
rtlong / README
Created August 22, 2011 18:33
issue with git rebase -i
This is meant to supplement the question on StackOverflow, here:
http://stackoverflow.com/questions/7137985/git-rebase-i-head7-showing-only-noop-in-editor
@rtlong
rtlong / AutoTune_SomaFM_MPD.rb
Created August 27, 2011 08:09
Use this simple ruby script to automate grabbing all the SomaFM stations and saving each as a playlist into MPD.
# 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',
@rtlong
rtlong / install_homebrew.rb
Created February 5, 2012 04:38 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to /usr/local so you don't need sudo to `brew install`
#!/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
@rtlong
rtlong / locale.rb
Created March 5, 2012 02:56 — forked from aulizko/locale.rb
Exports $app/config/locale/$locale.yml contents to mongodb database
# 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
@rtlong
rtlong / elasticsearch.yml
Created April 2, 2012 02:32
ElasticSearch #1514 - config file
##################### 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,
@rtlong
rtlong / expanded.rb
Created June 10, 2012 23:05
Ruby ping scan
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
@rtlong
rtlong / schema.xml
Created October 29, 2012 18:21
Sunspot Solr Schema.xml
<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)