Skip to content

Instantly share code, notes, and snippets.

View keybase.md

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:

View AudioPlayerService.java
/*
* 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 Oct 27, 2021
OpenVPN, rTorrent and Flood Docker Compose Configuration
View 0_README.md

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 Jun 10, 2017
A quick python script which prints arguments passed to it. This is useful to figure out how arguments are being passed.
View echo_args.py
#!/usr/bin/env python
import sys
print(sys.argv)
@0xcaff
0xcaff / main.go
Created Jun 9, 2017
A prime number generator using an incremental sieve of Eratosthenes. It's fast but memory bound.
View main.go
package main
import (
"fmt"
)
func main() {
// The number of primes to display before stopping.
maxPrimes := 1000000
View public-key.asc
-----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
View Using OpenVPN on ChromeOS.md
$ # 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 Feb 20, 2017
Calculus III Project I
View answers.txt
==> 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 Dec 20, 2015 — forked from johnbender/prefs.js
Set up Chrome Secure Shell to handle base16 terminal colors
View prefs.js
// 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 Mar 23, 2015
This script is used to grab images from a slide share containing the Modern Biology textbook.
View grab.sh
#!/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