Skip to content

Instantly share code, notes, and snippets.

working from home

Postmodern postmodern

working from home
View GitHub Profile
postmodern / resolv_weirdness.rb
Last active Oct 10, 2017
Resolv::DNS weirdness
View resolv_weirdness.rb
require 'resolv'
puts "Normal behavior:"
dns =
p dns.getaddresses('')
# => [#<Resolv::IPv4>, #<Resolv::IPv4>]
puts "With search: option:"
dns = ['.'])
p dns.getaddresses('')
View catted.log
$ cat test.rb | \irb
Switch to inspect mode.
true if 0...1
(irb):1: warning: integer literal in conditional range
(irb):1: warning: integer literal in conditional range
true if 1..2
(irb):2: warning: integer literal in conditional range
(irb):2: warning: integer literal in conditional range
postmodern /
Last active Feb 24, 2021
TCP Client in Rust
use std::env;
use std::process;
use std::thread;
use std::io::{self, Read, Write, Error};
use std::net::TcpStream;
use std::net::TcpListener;
View ili9341.c
#include "ili9341.h"
volatile uint16_t LCD_W=ILI9341_TFTWIDTH;
volatile uint16_t LCD_H=ILI9341_TFTHEIGHT;
void ili9341_hard_init(void)//init hardware
rstddr=0xFF;//output for reset
rstport |=(1<<rst);//pull high for normal operation
controlddr|=(1<<dc);//D/C as output
postmodern / rip_dvd
Last active Dec 27, 2020
Script to automate ripping DVDs using Handbrake-CLI and mkvmerge
View rip_dvd
#!/usr/bin/env bash
# Author: postmodern
# Description:
# Rips a DVD to a H.264 MKV file, with chapters and tags. Ignores any
# bad blocks or sectors on the DVD.
# Dependencies:
# * gddrescue
# * handbrake-cli
# * mkvtoolnix
postmodern /
Last active Mar 5, 2021
A `git filter-branch` script for extracting arbitrary files in a repo.
# usage: git filter-branch --force --prune-empty --index-filter "$(cat" --tag-name-filter cat -- --all
shopt -s globstar
# files and globs go here
postmodern / gist:7939687
Last active Dec 31, 2015
Experiment to see if OptionParser allows options to define other options. Turns out you can!
View gist:7939687
require 'optparse'
options ="usage: #{$0}") do |opts|
opts.on('-f','--file FILE','loads a file') do |file|
puts "loading file #{file}"
opts.separator "#{file} options:"
opts.on('-c','--custom') do
puts "custom option defined by file #{file}"
postmodern / gist:6912812
Last active Dec 25, 2015
Example of using Curses to manage input/output text areas.
View gist:6912812
require 'curses'
output = - 1, Curses.cols, 0, 0)
input =, Curses.cols, Curses.lines - 1, 0)
loop do
postmodern / gist:6877205
Last active Dec 24, 2015
Steps to Reproduce the rubinius 2.0.0 rubysl/bundler issue
View gist:6877205

Steps to Reproduce

  1. mkdir test_rubysl && cd test_rubysl
  2. echo "source ''" > Gemfile
  3. bundle install
  4. echo "p require 'bigdecimal'" > test.rb
  5. bundle exec ruby test.rb

Expected Result

postmodern / exploit.rb
Created Jun 16, 2013
Boilerplate code for the linked challenge, Defcon CTF 2013. Enjoy
View exploit.rb
#!/usr/bin/env ruby
require 'ronin/support'
require 'ronin/asm'
include Ronin::Network::TCP
payload = do
mov 0xaaaaaaaa, eax