This file contains 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
ftp = Net::FTP::new(site) | |
ftp.login(user, password) | |
y_combinator {|callback| | |
lambda {|entry| | |
if FileTest.directory?(entry) | |
entries = ftp.nlst | |
ftp.mkdir(File.basename(entry)) unless entries.include?(File.basename(entry)) | |
ftp.chdir(File.basename(entry)) | |
puts 'cd ' + File.basename(entry) |
This file contains 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
cat access.log | sed 's/^\([0-9\.]\+\) \([^ ]\+\) \([^ ]\+\) \[\(.*\)\] \("[^"]*"\) \([^ ]*\) \([^ ]*\) \("[^"]*"\) \("[^"]*"\).*/"\1"\t"\2"\t"\3"\t"\4"\t\5\t"\6"\t"\7"\t\8\t\9/' |
This file contains 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
# Some notes on my Arch Linux install... not quite complete but something to go on | |
# I needed rEFInd? | |
# After booting from arch ISO image (from CD) | |
# Partition disk etc | |
fdisk /dev/sda | |
n # new partition | |
t # set type, 1 is EFI partition | |
# Install EFI bootloader |
This file contains 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
urxvt*inheritPixmap:true | |
urxvt*transparent:true | |
urxvt*shading:50 | |
urxvt*font: 9x15 | |
urxvt*font:xft:Terminus-12 | |
urxvt*font:xft:Tamsyn-12 | |
urxvt*loginShell: true | |
urxvt*vt100*geometry: 80x50 | |
urxvt*saveLines: 2000 | |
urxvt*charClass: 33:48,35:48,37:48,43:48,45-47:48,64:48,95:48,126:48 |
This file contains 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
void _pstack_init(void *stack) { | |
*(void **)stack = (char *)stack + sizeof (char *); | |
} | |
void _pstack_push(void *stack, void *data) { | |
*(void **)stack = (char *)*(void **)stack + sizeof (char *); | |
**(void ***)stack = data; | |
} | |
void _pstack_pop (void *stack) { |
This file contains 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
:filetype plugin on | |
set softtabstop=2 | |
set shiftwidth=2 | |
set tabstop=8 | |
set expandtab | |
set autoindent | |
set lisp | |
set showmatch | |
set matchtime=5 | |
set smartcase |
This file contains 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
-- reference Karwin | |
drop table closure; | |
drop table nodes; | |
create table nodes ( | |
node serial primary key, | |
label varchar(32) not null | |
); |
This file contains 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
How to get a Rails console when script/rails won't work - particularly when you don't have readline | |
$ bundle exec script/console | |
Loading production environment (Rails 2.3.18) | |
/opt/rubyenterprise/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError) | |
from /opt/rubyenterprise/lib/ruby/1.8/irb/completion.rb:10 | |
from /opt/rubyenterprise/lib/ruby/1.8/irb/init.rb:254:in `require' | |
from /opt/rubyenterprise/lib/ruby/1.8/irb/init.rb:254:in `load_modules' | |
from /opt/rubyenterprise/lib/ruby/1.8/irb/init.rb:252:in `each' |
This file contains 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
HOSTS=( host1 host2 ) | |
USER=me | |
while read -e -p "-> " CMD </dev/tty | |
do | |
for host in "${HOSTS[@]}"; do | |
echo $host | |
ssh $USER@$host -C $CMD | |
done | |
done |
This file contains 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 'base64' | |
require 'cgi' | |
def show_session(cookie) | |
Marshal.load(Base64.decode64(CGI.unescape(cookie.split("\n").join).split('--').first)) | |
end |
OlderNewer