Couldn't find the text of this for a while...
View install.bash
#!/bin/bash | |
## README | |
# To run this script | |
# => scp it to the server | |
# => run `sudo bash install.bash` | |
# Preparations | |
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | tee -a /etc/apt/sources.list # MongoDB Prep | |
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 # MongoDB Prep |
View instructions.md
Named Screen
A utility inspired by @ahoward that allows screens to be the name of the directory they were spawned from. This is mainly helpful for Terminal/iTerm tabs.
Executing this should rejoin sessions with the same name if they already exist or otherwise create them.
Usage
- Place or symlink into your path (I symlink as
ns
) - Ensure the script is executable
View screenfetched.rb
#!/usr/bin/env ruby | |
if fetched_file_blank? or fetched_file_expired? | |
fetch! | |
end | |
write_cached_screenfetch! | |
BEGIN { | |
COMMAND = 'screenfetch'.freeze |
View sample_nginx_config.conf
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; |
View a.rb
class Printer | |
attr_reader :printer | |
deftyped :initialize , :printer => [ Proc ] do | |
@printer = printer | |
end | |
deftyped :print , :string => { :splat => true , :type => String } do | |
printer.call string.join( ' ' ) | |
end |
View _requirements.md
Setting up an iPad 1 to be an Ansible Node
- Update the iPad (v5.1.1?) to the latest iOS and make a backup using iTunes
- Install the sshpass program on your laptop. Ansible will need this to connect over ssh using a password.
- Jailbreak the iPad using redsn0w -- you now have Cydia
- Use Cydia to install "MobileTerminal", "OpenSSH", "Python", and "Setup Tools"
- Follow the "MobileTerminal" instructions in Cydia for changing the default passwords
- Locate your iPad's IP address by looking in Settings.app > Wi-Fi and clicking your connected networks detail ">" arrow
- SSH into your iPad and make sure you add IP address to list of known hosts
- Place IP address into an Ansible hosts file
View action.rb
# it's not critical for understanding | |
# but here is the associated server-side action | |
# | |
def version | |
@program = load_program! | |
@version = @program.versions.find(params[:version_id]) | |
if stale?(:last_modified => @version.updated_at, :etag => @version.cache_key) | |
render |
View client.rb
#!/usr/bin/env ruby | |
require 'drb' | |
require 'irb' | |
DRb.start_service | |
$context = DRbObject.new_with_uri('druby://localhost:9876') | |
IRB.start |
NewerOlder