Skip to content

Instantly share code, notes, and snippets.

View 0xcaff's full-sized avatar

Martin Charles 0xcaff

  • ring0
  • 10:15 (UTC -05:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am 0xcaff on github.
  • I am 0xcaff (https://keybase.io/0xcaff) on keybase.
  • I have a public key ASBDE1Ux37T9hHxR2knTPd34UknOGIbgC9zXm0SLnNsf0go

To claim this, I am signing this object:

/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@0xcaff
0xcaff / 0_README.md
Last active May 13, 2023 23:35
OpenVPN, rTorrent and Flood Docker Compose Configuration

The Setup

This is a docker-compose file for a simple, secure torrent setup. It includes [rTorrent] (a torrent client), [flood] (a web interface for rTorrent), [OpenVPN] (to tunnel traffic through your ISP) and a simple iptables firewall to allow rTorrent to only access the internet through a VPN.

To run everything, put your open vpn configuration file in ./vpn.ovpn and the other configuration files from this gist in a directory then go to that

@0xcaff
0xcaff / echo_args.py
Created June 10, 2017 05:00
A quick python script which prints arguments passed to it. This is useful to figure out how arguments are being passed.
#!/usr/bin/env python
import sys
print(sys.argv)
@0xcaff
0xcaff / main.go
Created June 9, 2017 13:35
A prime number generator using an incremental sieve of Eratosthenes. It's fast but memory bound.
package main
import (
"fmt"
)
func main() {
// The number of primes to display before stopping.
maxPrimes := 1000000
@0xcaff
0xcaff / public-key.asc
Created May 26, 2017 01:37
PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFkmG8UBEADMbPOiNZ68lPA8kaEdb6Llvqwz0bPqtM9iZ7j8XSVF96GTk1b4
LHntqgMGrJZ/pe8HzmUIVUaiv2TPaE99wy0E4F4YVsjEXi8MkauKnCrlwPmK6yIc
WPcN+NQiQHYhmKAE3ykq1GAp84M7Ex11cWWLIXveMouo1HMHa2+hcdkCVro/Oq8x
vYZfTL/0RzowgP+WmhcDDe/KG39I+wDQXD+a+VzA+xqtIJSmH9o4rlH3NLOS6bDG
EnTRh97C0m2e/vJHy0HjySY4xz4fGmsqV6JF0EL40DXLyTIDb3lfgxAWCixxUbSF
PSguBve/3INHJ1lXYUY0gkAAjJWXiR1DXMDOC6UhUmFbnPv/nT4f8Oaz/BgChDi4
2WOfZ+Hj6JsqwdKDwjbr1HtB8lhDjtxr4ANbNrEqWIV0XFyLaJoiIcCnEtJXh9tu
s3tv2t9+pr3H4m7TrSd8mr2qQzC1NCTte6kmENKa8AS3/2s4FWUgcK48xBQkYwbP
$ # on a chromebook in developer mode
$ sudo su
# stop shill
# start shill BLACKLISTED_DEVICES=tun0
# openvpn your-vpn.ovpn
# # set the dns in chrome settings, by default network dns is taken over openvpn dns
@0xcaff
0xcaff / answers.txt
Last active February 20, 2017 21:59
Calculus III Project I
==> question2a.txt <==
Distance: 89/sqrt(1635)
==> question2b.txt <==
Distance: 40/sqrt(104)
==> question2c.txt <==
Distance: 64/sqrt(222)
==> question3.txt <==
@0xcaff
0xcaff / prefs.js
Last active December 20, 2015 05:49 — forked from johnbender/prefs.js
Set up Chrome Secure Shell to handle base16 terminal colors
// Disable bold.
term_.prefs_.set('enable-bold', false)
// Use this for Base16 Dark
term_.prefs_.set('background-color', "#002b36");
term_.prefs_.set('foreground-color', "#839496");
base03 = "#181818";
base02 = "#282828";
base01 = "#383838";
@0xcaff
0xcaff / grab.sh
Created March 23, 2015 01:29
This script is used to grab images from a slide share containing the Modern Biology textbook.
#!/bin/bash
for i in {1..1154}
do
wget "https://image.slidesharecdn.com/studentedition-130307085310-phpapp01/95/biology-text-book-$i-638.jpg" -O "$i.jpg" &
while (( $(jobs | wc -l) >= 10 )); do
sleep 0.1
jobs > /dev/null
done
done