Skip to content

Instantly share code, notes, and snippets.

View cvonkleist's full-sized avatar

Christian von Kleist cvonkleist

View GitHub Profile
@cvonkleist
cvonkleist / categorizer.rb
Created January 20, 2011 16:37
a spec from categorizer_spec.rb
describe 'categorizer command-line stuff' do
it 'should write entity ids to case files' do
fake_suggestions = {
:jp2 => ['/foo/XX00000011.xml', '/bar/YY00000022.xml'],
:tiff => ['/bar/zz.xml', '/foo/abc.xml']
}
mock_jp2_output = mock('file')
mock_tiff_output = mock('file')
#!/usr/bin/env ruby
ALPHABET = ['a'..'z', 'A'..'Z', '0'..'9'].collect { |range| range.to_a }.flatten
class Array; def random; self[rand(self.length)]; end; end
length = (ARGV.shift || 10).to_i
puts Array.new(length) { ALPHABET.random }.join
class MyModel
attribute :complex_object_store
def complex_object=(object)
self.complex_object_store = Base64.encode64(Marshal.dump(object))
end
def complex_object
Marshal.load(Base64.decode64(self.complex_object_store))
end
@cvonkleist
cvonkleist / binary keys
Created March 16, 2011 15:21
can redis use binary keys?
>> @r=Redis.new
#<Redis client v2.1.1 connected to redis://localhost:6379/0 (Redis v2.1.12)>
>> @r.set Digest::SHA1.digest('foo'), 'bar'
=> "OK"
>> @r.get Digest::SHA1.digest('foo')
=> "bar"
@cvonkleist
cvonkleist / gist:1636312
Created January 18, 2012 22:48
possible club names
UF Hacking Club
Gator Hacking Group
Computer Hacking Gators
UF Student Information Security Team
Computer Security Club
@cvonkleist
cvonkleist / gist:2150731
Created March 21, 2012 18:22
web hacking resources
- the book
- web application hacker's handbook (http://amzn.com/1118026470)
- hacking challenges and practice
- hack this site (http://hackthissite.org)
- damn vulnerable web app (http://dvwa.co.uk)
- capture-the-flag competitions (http://capture.thefl.ag)
- local groups
- swampsec (http://swampsec.org)
- uf hacking club (http://ufhack.org)
- gainesville hackerspace* (http://skillhouse.org)
@cvonkleist
cvonkleist / .screenrc
Created March 22, 2012 20:35
screenrc
startup_message off
defflow auto
defscrollback 5000
altscreen on
autodetach on
msgwait 3
#change the hardstatus settings to give an window list at the bottom of the
#screen, with the time and date and with the current window highlighted
defutf8 on
line_starts = []
filename = "/usr/share/dict/words"
# preprocess
File.open(filename, "r") do |input|
until input.eof?
pos = input.pos
input.readline
line_starts << pos
line_starts = []
filename = "/usr/share/dict/words"
# preprocess
File.open(filename, "r") do |input|
until input.eof?
pos = input.pos
input.readline
line_starts << pos

Keybase proof

I hereby claim:

  • I am cvonkleist on github.
  • I am cvk (https://keybase.io/cvk) on keybase.
  • I have a public key whose fingerprint is E35D 9C97 586E 0A26 C1A3 E1E2 6C35 1436 B89F AE48

To claim this, I am signing this object: