Skip to content

Instantly share code, notes, and snippets.

View cmhobbs's full-sized avatar
🍩
Waiting between the walls.

Christopher M. Hobbs cmhobbs

🍩
Waiting between the walls.
View GitHub Profile
@mubix
mubix / infosec_newbie.md
Last active April 7, 2024 22:35
How to start in Infosec
@telyn
telyn / Install-UT2004.md
Last active April 13, 2024 02:06
Installing UT2004 on a linux

So you want to install UT2004 on some Linux? Because 10 year old games are the best games.

You will need:

  • UT2004 (The GOG copy or the original DVD will both work, as will presumably any other copy of UT2004)
  • The latest (3369) linux patch for UT2004
  • A CD key. If you want to run a dedicated server, generate yourself a server key at https://forums.unrealtournament.com/utserver/cdkey.php?2004
  • libstdc++.so.5 (could also end .so.5.X.Y where X and Y are numbers, this is also fine) built for i386 linux. the 64-bit build of UT2004 is sadly broken (can't rebind ports on map changes, making the web interface useless after the first map), so i386 is the way forward.

The steps:

@obfusk
obfusk / break.py
Last active May 1, 2024 20:32
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@cmhobbs
cmhobbs / uploader.go
Created August 3, 2012 04:21
Handling multipart file uploads with goweb
package main
import (
"code.google.com/p/goweb/goweb"
"io/ioutil"
)
// dummy error struct for pretty json export
type ControllerError struct {
Error error
class ActiveRecord::Base
attr_accessible nil
def update_attributes *args
raise "Don't call #{self.class.name}#update_attributes. " +
"Mass assignment is pure evil."
end
end
# Sort lexicographically, but sorting numbers into their proper position.
# Ruby 1.9 only as the zero-width lookbehind assertions require Oniguruma.
#
class Array
def sort_preserving_numbers
sort_by { |x|
x.split(%r{(?<=\D)(?=\d)|(?<=\d)(?=\D)}).
map { |piece| (piece =~ /\A\d+\z/) ? piece.to_i : piece }
}
end
@cmhobbs
cmhobbs / kvminst.sh
Created March 18, 2011 01:17
hack script to install/setup kvm
#!/usr/bin/env bash
# Quick and dirty KVM setup script.
cat << EOT
THIS SCRIPT SHOULD GET YOU UP AND RUNNING WITH KVM.
HERE'S THE PROCESS:
- UPDATE YOUR SYSTEM
- INSTALL KVM'S REQUIRED PACKAGES
- ADD YOUR USER TO THE NECESSARY GROUPS
[05:21][hobbsc@arrakis:~/dev/billing(codereview)]$ bundle install
/usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:56:in `<class:UI>': uninitialized constant Gem::SilentUI (NameError)
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:2:in `<module:Bundler>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/ui.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/cli.rb:16:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `new'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/local/rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.9/bin/bundle:13:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.2-p136/b
@addamh
addamh / gist:708372
Created November 21, 2010 02:12
ssh debug output for addamh on libernil
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to libernil.org [69.164.201.146] port 1001.
debug1: Connection established.
debug1: identity file /Users/addam/.ssh/identity type -1
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug2: key_type_from_name: unknown key type '-----END'
@vangberg
vangberg / DWM-ON-OS-X.md
Created February 22, 2010 19:24
dwm on os x [work in progress!]

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true