Skip to content

Instantly share code, notes, and snippets.

View postmodern's full-sized avatar
🚀
releasing new versions

Postmodern postmodern

🚀
releasing new versions
View GitHub Profile
@postmodern
postmodern / tcp_client.rs
Last active May 20, 2022 16:01
TCP Client in Rust
#![allow(unused_variables)]
#![allow(unused_imports)]
use std::env;
use std::process;
use std::thread;
use std::io::{self, Read, Write, Error};
use std::net::TcpStream;
use std::net::TcpListener;
#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
postmodern / rip_dvd
Last active September 16, 2024 00:09
Script to automate ripping DVDs using Handbrake-CLI and mkvmerge
#!/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
postmodern / git_file_filter.sh
Last active April 1, 2022 23:13
A `git filter-branch` script for extracting arbitrary files in a repo.
#!/bin/bash
#
# usage: git filter-branch --force --prune-empty --index-filter "$(cat git_file_filter.sh)" --tag-name-filter cat -- --all
#
shopt -s globstar
whitelist=(
# files and globs go here
)
@postmodern
postmodern / gist:7939687
Last active December 31, 2015 05:19
Experiment to see if OptionParser allows options to define other options. Turns out you can!
require 'optparse'
options = OptionParser.new("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}"
end
@postmodern
postmodern / gist:6912812
Last active December 25, 2015 03:49
Example of using Curses to manage input/output text areas.
require 'curses'
Curses.init_screen
output = Curses::Window.new(Curses.lines - 1, Curses.cols, 0, 0)
output.setpos(0,0)
input = Curses::Window.new(1, Curses.cols, Curses.lines - 1, 0)
input.setpos(0,0)
loop do
@postmodern
postmodern / gist:6877205
Last active December 24, 2015 22:59
Steps to Reproduce the rubinius 2.0.0 rubysl/bundler issue

Steps to Reproduce

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

Expected Result

@postmodern
postmodern / exploit.rb
Created June 16, 2013 05:35
Boilerplate code for the linked challenge, Defcon CTF 2013. Enjoy
#!/usr/bin/env ruby
require 'ronin/support'
require 'ronin/asm'
include Ronin::Network::TCP
payload = Ronin::ASM::Shellcode.new do
mov 0xaaaaaaaa, eax
ret
@postmodern
postmodern / fuzzer.rb
Last active December 16, 2015 11:08
PlaidCTF misc 100 fuzzer
#!/usr/bin/env ruby
require 'ronin/network/tcp'
require 'ronin/ui/output/helpers'
require 'combinatorics'
include Ronin::Network::TCP,
Ronin::UI::Output::Helpers
hosts = %w[
@postmodern
postmodern / compression.rb
Created April 20, 2013 00:11
Starter code to help you solve PlaidCTF compression 250.
#!/usr/bin/env ruby
#
# $ gem install ronin-support
# $ python compression.py &
# $ ruby compression.rb
#
require 'rubygems'
require 'ronin/formatting/binary'
require 'ronin/network/tcp'
require 'hexdump'