Skip to content

Instantly share code, notes, and snippets.

View milesrichardson's full-sized avatar
👁️
Miles Richardson

Miles Richardson milesrichardson

👁️
Miles Richardson
View GitHub Profile
anonymous
anonymous / IRC client in pure bash 4
Created March 28, 2016 16:57
IRC client written in pure bash using only bash builtin commands and no other binaries.
#!/bin/bash
#no PATH, no way to accidently run any programs
PATH=''
#useful variables
term_height=0
term_width=0
term_scroll_height=0
status_line_row=0
@JosephLenton
JosephLenton / spider.pl
Created July 28, 2012 03:49
prolog text adventure game
/* SPIDER -- a sample adventure game, by David Matuszek.
Consult this file and issue the command: start. */
:- dynamic at/2, i_am_at/1, alive/1. /* Needed by SWI-Prolog. */
:- retractall(at(_, _)), retractall(i_am_at(_)), retractall(alive(_)).
/* This defines my current location. */
i_am_at(meadow).
@dannvix
dannvix / intercept-https-with-python-mitmproxy.md
Last active February 16, 2023 02:43
Intercept and manipulate HTTPs traffic with Python and mitmproxy

Intercepts HTTPs Traffic with Python & mitmproxy

Warning

This Gist is created in 2014, and it's highliy outdated now, according to one of mitmproxy's manjor contributor (check his comment below). Thanks for letting us know, @mhils!

Introduction

Modern applications usually make use of back-end API servers to provide their services. With a non-transparent HTTPs proxy, which intercepts the communication between clients and servers (aka the man-in-the-middle scheme), you can easily manipulate both API requests and responses.

@iddoeldor
iddoeldor / ios_ssh_over_usb_and_ipa_extractor.md
Last active October 16, 2022 05:01
and iOS related tips&tricks

extract db

PASS=alpine; PORT=2222; sshpass -p $PASS ssh -p $PORT root@localhost -t "cp \$(find /var/mobile/Containers/Data/Application/ -name s4l*db) /private/var/tmp/skype.db" && sshpass -p $PASS scp -P $PORT root@localhost:/private/var/tmp/skype.db .

pull & read plist

/tmp$ scp -P 2222 root@localhost:/private/var/mobile/Containers/Data/Application/F8C7294C-2B60-48EC-A987-D46B9FE4DEAE/Library/Preferences/com.skype.skype.plist .
/tmp$ sudo apt-get install libplist-utils
/tmp$ plistutil -i com.skype.skype.plist | less
@corbinbs
corbinbs / json_required_demo.py
Created September 26, 2012 22:57
Flask JSON required decorator
"""
Demo of json_required decorator for API input validation/error handling
"""
import inspect
import functools
import json
from traceback import format_exception
from flask import jsonify, request
import sys
@vsergeev
vsergeev / beagle_elfs.md
Created April 15, 2012 09:45
Minimalist "Embedded Linux from Scratch" Beaglebone Distribution Build

Busybox "Embedded Linux from Scratch" Distribution for the Beaglebone

Prepare your Build Sandbox

$ mkdir -p beaglelfs/{sources,rootfs_install,boot_mnt,rootfs_mnt}

Acquire an ARM Toolchain

Download the latest i686 Binary TAR of the ARM GNU/Linux (glibc-based) Lite Toolchain:

@overplumbum
overplumbum / gist:4473076
Last active March 15, 2022 12:03
OpenVPN server as an LXC container
#!/bin/bash
set -ve
lxc-create -n vpn -t ubuntu
# ln -s /var/lib/lxc/vpn/config /etc/lxc/auto/vpn.conf
perl -i -ple 's/#lxc.aa_profile = unconfined/lxc.aa_profile = unconfined/' /etc/lxc/auto/vpn.conf
perl -i -ple 's/^exit 0/# exit 0/' /etc/rc.local
cat >>/etc/rc.local <<hello
mkdir -p /var/lib/lxc/vpn/rootfs/dev/net/
@olavmrk
olavmrk / removeexcept.sh
Last active August 23, 2021 21:33
git filter-branch command to remove all files except those of interest
# Remove every file except "./somefile.txt" and the directory "./somedir".
# --prune-empty to remove empty commits.
git filter-branch --tree-filter "find . -not -path './.git' -not -path './.git/*' -not -path './somefile.txt' -not -path './somedir/*' -not -path './somedir' -delete" --prune-empty
@noteed
noteed / docker-tinc.md
Last active April 17, 2019 06:22
Docker - Tinc setup
@amberj
amberj / setup-headless-selenium-xvfb.sh
Created September 25, 2013 05:06
Bash script to install/setup headless Selenium (uses Xvfb and Chrome)
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)