Skip to content

Instantly share code, notes, and snippets.

@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 / 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

Keybase proof

I hereby claim:

  • I am rtlong on github.
  • I am rtlong (https://keybase.io/rtlong) on keybase.
  • I have a public key ASCx_dTGMcFs3w8X5MeiySIjv517t1ZgbfM5kyDv5qROTwo

To claim this, I am signing this object:

@rtlong
rtlong / movie.md
Created July 13, 2018 20:12 — forked from laser/movie.md

Movie Ticket Kata

First, head here to join our Zoom meeting. It will help me following along while you work through the assignment.

What Are We Building?

Write a program that calculates purchase price for movie tickets using any language you like. It should not be a full-blown web app; it can be a simple class or collection of methods invokable by your test suite. We'll provide you with some requirements, test-cases, and even a sample interface - all you have to do is give us some software.

Base Admission Rate

@rtlong
rtlong / get-keys-for-github-user.sh
Last active February 13, 2017 15:50
Put public keys for a github user in ~/.ssh/authorized keys with mucho ease
IFS="$(printf '\n\t')"
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
user=$1
@rtlong
rtlong / Gemfile
Created October 23, 2013 19:48 — forked from sr/Gemfile
source "http://rubygems.org"
gem "janky", "~>0.9"
gem "pg"
gem "thin"
@rtlong
rtlong / console.app_output.
Last active December 20, 2015 01:29
I'm seeing a 'G-Ear Player Failed to Download' error trying to upgrade to 1.4.35 in the App Store
2013-07-21 11:08:37.055 AM App Store[28267]: *** WARNING: Method userSpaceScaleFactor in class NSWindow
is deprecated on 10.7 and later. It should not be used in new applications. Use
convertRectToBacking: instead.
2013-07-21 11:08:38.344 AM storeagent[20851]: *** Assertion failure in
-[SoftwareInstallOperation _startInstall],
/SourceCache/Pisa/Pisa-135.30/iTunes Protocol/Built Into App/SoftwareInstallOperation.m:235
2013-07-21 11:08:38.345 AM storeagent[20851]: error Error Domain=NSURLErrorDomain Code=-1100 "The
installation could not be started." UserInfo=0x7fdd74042b70 {NSLocalizedDescription=The installation
could not be started., NSUnderlyingError=0x7fdd78803550 "The requested URL was not found on this
server."}

Keybase proof

I hereby claim:

  • I am rtlong on github.
  • I am rtlong (https://keybase.io/rtlong) on keybase.
  • I have a public key whose fingerprint is F1F5 CF22 23FF 597B B717 3843 1CDC F361 D874 2295

To claim this, I am signing this object:

@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)
@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,