Skip to content

Instantly share code, notes, and snippets.

View cvonkleist's full-sized avatar

Christian von Kleist cvonkleist

View GitHub Profile
cvonkleist / net_http_ssl_json_post_request.rb
Created June 14, 2024 08:07
There are too many old references to how to use Ruby's Net::HTTP to do SSL, post JSON, etc., so here is a simple, fairly modern example for future reference, posting a JSON-RPC call.
require "json"
require "net/http"
url = ""
pp JSON.parse(, {"method": "eth_blockNumber", "params": [], "id":1, "jsonrpc":"2.0"}.to_json, "Content-Type" => "application/json").body)
# => {"jsonrpc"=>"2.0", "result"=>"0x22d9d5d", "id"=>1}
cvonkleist / .zshrc
Last active May 13, 2022 16:54
Get IP address of hostname in SSH config, with ZSH completion
# show ip address for ssh host, with zsh completion for hostname
_sship () { ssh -G $1 | awk '/^hostname/ {print $2}' }
compdef _sship=ssh
# Usage
# =====
# Add the above two lines to the bottom of your ~/.zshrc file.
# Use it like this on the commandline:
cvonkleist / archon_regenerate_thumbnails.php
Created November 16, 2016 10:49
Archon regenerate thumbnails
@include_once('patches.php'); // This has some custom patches for our Archon.
$query = "select id, length(FileContents) as fcsize, length(FilePreviewLong) as fplsize, length(FilePreviewShort) as fpssize from tblDigitalLibrary_Files where id=?"; // and (length(FileContents)=length(FilePreviewLong) or length(FileContents)=length(FilePreviewShort))";
$prep = $_ARCHON->mdb2->prepare($query, array('integer'), MDB2_PREPARE_RESULT);
function needsResizing($id) {
global $prep;
cvonkleist / pseudocode.php
Created June 24, 2016 05:39
Archon mixin system pseudocode
// This class has functionality which can be used by many other classes.
class CommonFunctionalityClass {
function doSomethingCommon() {
function supportingFunction() {

Keybase proof

I hereby claim:

  • I am cvonkleist on github.
  • I am 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:

line_starts = []
filename = "/usr/share/dict/words"
# preprocess, "r") do |input|
until input.eof?
pos = input.pos
line_starts << pos
line_starts = []
filename = "/usr/share/dict/words"
# preprocess, "r") do |input|
until input.eof?
pos = input.pos
line_starts << pos
cvonkleist / .screenrc
Created March 22, 2012 20:35
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
cvonkleist / gist:2150731
Created March 21, 2012 18:22
web hacking resources
- the book
- web application hacker's handbook (
- hacking challenges and practice
- hack this site (
- damn vulnerable web app (
- capture-the-flag competitions (
- local groups
- swampsec (
- uf hacking club (
- gainesville hackerspace* (
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