Skip to content

Instantly share code, notes, and snippets.

View cvonkleist's full-sized avatar

Christian von Kleist cvonkleist

View GitHub Profile
lockdown:
- change passwords for all shell accounts and come up with policy
- remove ssh authorized_keys
- change mysql root password
- grep for any
- restart mysql with query logging -> mysql --log=/var/log/mysql
- change mysql passwords
-
# This is a method I use when working with slow ruby scripts that
# operate on huge datasets.
#
# It caches the return value of a block of extremely slow code
# in a file so that subsequent runs are fast.
#
# It's indispensable to me when doing edit-debug-edit-debug-edit
# cycles on giant datasets.
# loads ruby object from a cache file or (if cache file doesn't exist) runs
#!/usr/bin/env ruby
class Array
def random; self[rand(self.length)]; end
end
# extended by actual player classes
class Player
attr_reader :name
def initialize(name)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
char server[20] = "wwwsearch.bing.com";
int result_count;
char query[20];
char command[100];
char buffer[10000];