This file contains hidden or 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
$ dig soa juan.gg | |
; <<>> DiG 9.4.2-P2 <<>> soa juan.gg | |
;; global options: printcmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31209 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;juan.gg. IN SOA |
This file contains hidden or 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
$ sudo chef-solo -j /tmp/dna.json -l debug | |
INFO: Starting Chef Solo Run | |
DEBUG: Loading plugin os | |
DEBUG: Loading plugin ruby | |
DEBUG: Loading plugin languages | |
DEBUG: Loading plugin kernel | |
DEBUG: ---- Begin uname -s STDOUT ---- | |
DEBUG: Linux | |
DEBUG: ---- End uname -s STDOUT ---- | |
DEBUG: Ran (uname -s) returned 0 |
This file contains hidden or 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
# Monitor HTTP requests being made from your machine with a one-liner.. | |
# Replace "en1" below with your network interface's name (usually en0 or en1) | |
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" | |
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile: | |
# (again replace "en1" with correct network interface name) | |
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"" | |
# All the above tested only on OS X. |
This file contains hidden or 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
# 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/ | |
break if `ifconfig #{iface}` =~ /inet (0|1|2)/ |
This file contains hidden or 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 'rubygems' | |
require 'sinatra' | |
require 'redis' | |
# To use, simply start your Redis server and boot this | |
# example app with: | |
# ruby example_note_keeping_app.rb | |
# | |
# Point your browser to http://localhost:4567 and enjoy! | |
# |
This file contains hidden or 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
# JSON | |
{ | |
"applications": [ | |
{ | |
"foobar": { | |
"migration_command": "rake db:migrate", | |
"branch": "HEAD", | |
"deploy_action": "deploy", | |
"framework_env": "production", |
This file contains hidden or 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 'rubygems' | |
require 'couchrest' | |
SERVER = CouchRest.new | |
DB = SERVER.database!('contact-manager') | |
class Contact < CouchRest::ExtendedDocument | |
use_database DB | |
property :first_name |
This file contains hidden or 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 'prawn' | |
require 'prawn/layout' | |
Prawn::Document.generate("table-test2.pdf") do | |
headers = ["Course", "Grade", "Comments"] | |
data = [] | |
10.times { |i| data << ["Home Room", "A+", "Great work!"]} | |
def make_table(headers, data) | |
table( |
This file contains hidden or 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
class GitosisCofigGenerator | |
def initialize | |
@config = {} | |
end | |
def add_group(name, options = {}) | |
@config.store(name, {:writable => options[:writable], :readonly => options[:readonly], :members => options[:members]}) | |
end | |
OlderNewer