Skip to content

Instantly share code, notes, and snippets.

@nas
nas / ssl_puma.sh
Last active August 29, 2015 14:22 — forked from tadast/ssl_puma.sh
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@nas
nas / gitio
Created July 28, 2013 08:19 — forked from defunkt/gitio
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@nas
nas / gist:3148888
Created July 20, 2012 05:37 — forked from igrigorik/gist:3148848
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > brew install ffprobe
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
@nas
nas / roman_numeral_calculator.rb
Created July 20, 2011 17:40 — forked from jimweirich/analysis.rb
Results from Roman Numeral Calculator Kata at @cincinnatirb
class RomanNumeralCalculator
def calculate(numeral)
if numeral =~ /^\d+$/
arabic_to_roman(numeral)
else
roman_to_arabic(numeral)
end
end
private
@nas
nas / urlmonitor.rb
Created November 24, 2009 15:59 — forked from isaacs/urlmonitor.rb
urlmonitor.rb
#!/usr/bin/env ruby
# urlmonitor - print out the URLs requested system wide on the main network interface
# Accept a network interface name as an optional argument
iface = ARGV.first
# No interface specified? Try to guess which one is king..
unless iface
`ifconfig -l`.split.each do |iface|
next if iface =~ /^lo/