This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am mathyourlife on github. | |
* I am mathyourlife (https://keybase.io/mathyourlife) on keybase. | |
* I have a public key ASD9_w22c6-SmbGeJpZDew5hQlBy-HuFO-Wdzr7CYKwRqQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"log" | |
"net" | |
"net/http" | |
"strings" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add iptable blocks for CIDR blocks associated with the ASN | |
// Each run, the custom chain is flushed and repopulated by the new set of CIDR blocks | |
// | |
// Usage: | |
// asn-block --asn 32934 --asn-name facebook | |
// | |
package main | |
import ( | |
"bytes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample script for generating a tarball from a source directory | |
package main | |
import ( | |
"archive/tar" | |
"bytes" | |
"compress/gzip" | |
"io" | |
"os" | |
"path/filepath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"image/color" | |
"math" | |
"gonum.org/v1/plot" | |
"gonum.org/v1/plot/plotter" | |
"gonum.org/v1/plot/vg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
import unh698 | |
class FlaskrTestCase(unittest.TestCase): | |
def setUp(self): | |
self.app = unh698.app.test_client() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on | |
// https://raw.githubusercontent.com/bmorton/dnswatch/0eec21738a7f9b3786c43e6c13c2d6c32cc60f73/dnswatch.go | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"time" | |
"github.com/google/gopacket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CACHE_FILE=~/tmp/pic-list | |
PID=$(pgrep xfce4-session) | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
USE_CACHE=false | |
if [ -e $CACHE_FILE ]; then | |
if [ $(date -r $CACHE_FILE +%Y/%m/%d) == $(date +%Y/%m/%d) ]; then | |
USE_CACHE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Lexicographic Permutations | |
source: http://en.wikipedia.org/wiki/Permutation#Generation_in_lexicographic_order | |
The following algorithm generates the next permutation lexicographically | |
after a given permutation. It changes the given permutation in-place. | |
1) Find the largest index k such that a[k] < a[k + 1]. | |
If no such index exists, the permutation is the last permutation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
# cat First500000.lst | |
# 0,a | |
# 1,a | |
# 2,a | |
# 3,a | |
# 4,a | |
# 5,a | |
# 6,a |
NewerOlder