Skip to content

Instantly share code, notes, and snippets.

How fast is bgpq3?
6:28:31 [dotwaffle@engelbert:~/go/src/github.com/dotwaffle/prefixlister] master* ± time bgpq3 AS-SET-LONAP-CONNECTED | wc
1100231 5501154 44853809
bgpq3 AS-SET-LONAP-CONNECTED 2.74s user 0.26s system 46% cpu 6.489 total
wc 0.95s user 0.03s system 15% cpu 6.489 total
6.489s is the time to beat it seems. Let's try mine:
6:28:42 [dotwaffle@engelbert:~/go/src/github.com/dotwaffle/prefixlister] master* ± time prefixlister AS-SET-LONAP-CONNECTED | wc
5:43:56 [dotwaffle@engelbert:~/go/src/github.com/dotwaffle/prefixlister] % time prefixlister AS-LONAP-CONNECTED | sed '/^$/d' | wc
29342 29342 457816
prefixlister AS-LONAP-CONNECTED 0.13s user 0.04s system 15% cpu 1.090 total
5:44:02 [dotwaffle@engelbert:~/go/src/github.com/dotwaffle/prefixlister] % time bgpq3 -F '%n/%l\n' AS-LONAP-CONNECTED | sed '/^$/d' | wc
29342 29342 457816
bgpq3 -F '%n/%l\n' AS-LONAP-CONNECTED 0.04s user 0.00s system 3% cpu 1.216 total
5:44:08 [dotwaffle@engelbert:~/go/src/github.com/dotwaffle/prefixlister] %
@dotwaffle
dotwaffle / gpg-agent.conf
Created April 18, 2016 17:00
GPG Configuration
allow-mark-trusted
debug-level basic
log-file /home/dotwaffle/.gnupg/log-socket
default-cache-ttl 1800
enable-ssh-support

Keybase proof

I hereby claim:

  • I am dotwaffle on github.
  • I am dotwaffle (https://keybase.io/dotwaffle) on keybase.
  • I have a public key whose fingerprint is D09B 05DB D075 BA72 5845 D371 8783 A4A6 1841 56BE

To claim this, I am signing this object:

@dotwaffle
dotwaffle / conndata
Last active February 8, 2016 20:42
Put an "ss" expression in the parameters to filter, i.e. dst 1.0.0.0/8
#!/bin/bash
ss -tine $@ \
| tr '\t' ' ' \
| sed -e '1d' \
-e ': # first line is for humans' \
-e 's/sk:ffff[0-9a-fA-F]\+//g' \
-e ': # remove the skbuf stuff' \
-e 's/\s\+ino:[0-9]\{,8\}//g' \
-e ': # remove the ino stuff' \
-e 'N;s/\n/ /g' \
@dotwaffle
dotwaffle / connectiondata.sh
Created April 10, 2015 11:07
List all the TCP connections on a box, and get the TCP_INFO for analysis
#!/bin/bash
ss -tine \
| tr '\t' ' ' \
| sed \
-e ': # first line is for humans' \
-e '1d' \
-e ': # remove the skbuf stuff' \
-e 's/sk:ffff[0-9a-fA-F]\+//g' \
-e ': # remove the ino stuff' \
-e 's/\s\+ino:[0-9]\+//g' \
@dotwaffle
dotwaffle / gist:11210812
Created April 23, 2014 10:59
Keybase Proof Of Ownership
### Keybase proof
I hereby claim:
* I am dotwaffle on github.
* I am dotwaffle (https://keybase.io/dotwaffle) on keybase.
* I have a public key whose fingerprint is F2FA 24FB F4B0 9809 7970 3970 70B2 0321 3AF5 9D16
To claim this, I am signing this object:
@dotwaffle
dotwaffle / sort.sh
Created December 4, 2013 15:49
I'd done the following in weechat: /set logger.file.mask "%Y/%m/$plugin.$name.weechatlog" I was looking for a way of moving my old logs into this new format -- some of them were huge, and it was a pain backing them up. Having been asked on more than one occasion for a copy of the script I wrote to do this for me, I decided to publish it here. Tada.
#!/bin/bash
# place in .weechat/logs and run it.
for file in *.weechatlog
do
while read line
do
if [[ ! -d ${line:0:4}/${line:5:2} ]]
then