Skip to content

Instantly share code, notes, and snippets.

View jcsalterego's full-sized avatar

Jerry Chen jcsalterego

View GitHub Profile
@jcsalterego
jcsalterego / script.sh
Last active August 29, 2015 14:16
sadhax
$ cat script.sh | bash -c 'cat - >/tmp/$$.sh; bash /tmp/$$.sh $@; rm -f /tmp/$$.sh' -- -v foobar
args are -v foobar
DEBUG:libcloud.compute.ssh:Connecting to server
DEBUG:libcloud.compute.ssh:Closing server connection
DEBUG:libcloud.compute.ssh:Connecting to server
DEBUG:libcloud.compute.ssh:Closing server connection
DEBUG:libcloud.compute.ssh:Connecting to server
DEBUG:libcloud.compute.ssh:Closing server connection
DEBUG:libcloud.compute.ssh:Connecting to server
DEBUG:libcloud.compute.ssh:Closing server connection
DEBUG:libcloud.compute.ssh:Connecting to server
DEBUG:libcloud.compute.ssh:Closing server connection
@jcsalterego
jcsalterego / gist:7789998
Last active December 30, 2015 06:29
sslv2 alert handshake failure
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise
$ curl --version
curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtmp rtsp smtp smtps telnet tftp
#!/bin/bash
files=""
for arg in $@; do
files="$files $(find test/ -name ${arg}_test.rb)"
done
echo "Testing: $files"
/Users/cicero/.rvm/rubies/ruby-1.8.6-p420/bin/ruby -I"lib:test" "/Users/cicero/.rvm/gems/ruby-1.8.6-p420@global/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" $files
#!/bin/bash
clear
echo -ne " \n\n\n\n"
echo -ne " a fantastic shrimp voyage\r"
sleep 2
echo -ne " * ( \r"
sleep 1
echo -ne " 9 ( \r"
sleep 1
class Employee < Person
include SalaryUtils
attr_accessor :annual_salary
def weekly_salary
hourly_rate(annual_salary) * 40
end
for (anItem in hudson.model.Hudson.instance.getQueue().getItems()) {
anItem.doCancelQueue()
}
@jcsalterego
jcsalterego / book.rb
Last active December 15, 2015 15:29 — forked from zachgersh/book.rb
class Book
attr_reader :title
DONT_CAPITALIZE = %w(and or the an of in a)
def title=(title)
@title = title.capitalize.split.map do |word|
if DONT_CAPITALIZE.include?(word.downcase)
word
else
def translate(phrase)
phrase.split.inject([]) do |final_pigs, word|
char = word.split(//)
if char[0].match(/[aeiou]/)
final_pigs << "#{word}ay"
else
new_string = char
until new_string[0].match(/[aeio]/)
new_string << new_string.shift
end