Skip to content

Instantly share code, notes, and snippets.

View arturopie's full-sized avatar
:shipit:
shipping

Arturo Pie arturopie

:shipit:
shipping
View GitHub Profile
@arturopie
arturopie / remote_commands.rb
Created September 26, 2012 01:55
Using EventMachine to execute commands in several host at once
require 'eventmachine'
require 'colorize'
class RemoteCommands < EM::Connection
attr_reader :queue
def initialize(q)
@queue = q
cb = Proc.new do |msg|
@arturopie
arturopie / _rake
Created April 9, 2012 18:31
rake fast autocomplition
# rake autocompletion from:
_rake_does_task_list_need_generating () {
if [ ! -f .rake_tasks~ ]; then return 0;
else
accurate=$(stat -c=%y .rake_tasks~)
changed=$(stat -c=%y Rakefile)
return $(expr $accurate '>=' $changed)
fi
}
@arturopie
arturopie / 0-readme.md
Created March 8, 2012 03:39
ruby-1.9.3-p125 cumulative performance patch.

Patched ruby 1.9.3-p0 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p0 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84).

Huge thanks to funny-falcon for the performance patches.

@arturopie
arturopie / .zsh
Created March 6, 2012 00:53
.zsh
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gnzh"
@arturopie
arturopie / bash-functions.zsh
Created March 5, 2012 04:30
some bash/zsh useful functions
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low --hint int:transient:1 -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# to use no fast-forward by deafult
function git() {
if [[ $@ == merge* ]]; then
if [[ $@ == *--no-ff* ]]; then
command git "$@"
@arturopie
arturopie / sy2.rb
Created October 3, 2011 19:44
scripts to run sy2 and sy3 severak times and check if they pass
#!/usr/bin/ruby
require 'open3'
failed = false
for i in 1..20
puts i
stdin, stdout, stderr = Open3.popen3("sys161 kernel-ASST1 'sy2; q'")
if ((str = stderr.gets) =~ /sys161: Cannot/)