Skip to content

Instantly share code, notes, and snippets.


Filippo Valsorda FiloSottile

View GitHub Profile
View pgp_verbose_mime.patch
--- a/globals.h 2009-08-25 21:08:52.000000000 +0200
+++ b/globals.h 2010-12-11 13:34:36.934682237 +0100
@@ -227,6 +227,9 @@
WHERE char *PgpSignAs;
WHERE short PgpTimeout;
WHERE char *PgpEntryFormat;
+/* custom patch */
+WHERE char *PgpMimeSignatureFilename;
+WHERE char *PgpMimeSignatureDescription;
WHERE char *PgpClearSignCommand;

Keybase proof

I hereby claim:

  • I am FiloSottile on github.
  • I am filippo ( on keybase.
  • I have a public key whose fingerprint is 8CE7 D013 6ABE 132F EC03 D1C9 B8CC 58C5 1CAE A963

To claim this, I am signing this object:

View gist:c002ba7a9855223a795b
rrSets := map[uint16][]dns.RR{}
for _, rr := range r.Response.Answer {
rrtype := rr.Header().Rrtype
set, ok := rrSets[rrtype]
if !ok {
set = []dns.RR{}
rrSets[rrtype] = append(set, rr)
View openssh-6.6p1-hpnssh14v5.diff
diff --git a/HPN-README b/HPN-README
new file mode 100644
index 0000000..7cb3b97
--- /dev/null
@@ -0,0 +1,129 @@
+The AES cipher in CTR mode has been multithreaded (MTR-AES-CTR). This will allow ssh installations
FiloSottile /
Last active Aug 29, 2015
password-store rekey script
#! /bin/bash
set -euo pipefail
readonly PASSWORD_STORE=~/.password-store
relpath() {
python -c "import os.path; print os.path.relpath('$1','${2:-$PWD}')"
FiloSottile /
Created Mar 15, 2012
Download a youtube playlist using rg3/youtube-dl by @orschiro
import shutil
import os
import sys
import subprocess
import re
# Settings
root_folder = 'C:/Users/Robert/Videos/YouTube/Playlists/'
destination_regex = re.compile(r'^\[download\] Destination: (.*)$', re.M)
FiloSottile / gist:2176911
Created Mar 24, 2012
Youtube video URL regex from `youtube-dl` explained
View gist:2176911
# The youtube-dl YouTube URL regex

	(?:https?://)?										# http(s):// (optional)
	(?:youtu\.be/|(?:\w+\.)?youtube(?:-nocookie)?\.com/|tube\.majestyc\.net/) # the various hostnames, with wildcard subdomains
	(?!view_play_list|my_playlists|artist|playlist)		# ignore playlist URLs
	(?:													# the various things that can precede the ID:
		(?:(?:v|embed|e)/)								# v/ or embed/ or e/
FiloSottile / Ubuntu-console.txt
Created Apr 19, 2012
Some testing around OS I/O encodings in python
View Ubuntu-console.txt
*** locale.getpreferredencoding() : UTF-8
u'\xe8' è
repr(sys.argv[1]) u'\xe8'
repr(raw_input()) u'\xe8'
*** sys.stdout.encoding : UTF-8
u'\xe8' è
repr(sys.argv[1]) u'\xe8'
repr(raw_input()) u'\xe8'
FiloSottile / gist:2667279
Created May 12, 2012
Render only an element with PhantomJS
View gist:2667279
page.clipRect = page.evaluate(function() {
return document.getElementById(ELEMENT_ID).getBoundingClientRect();
FiloSottile / rtmpdump.log
Created Jul 6, 2012
RTMP logs for weird YouTube videos
View rtmpdump.log
RTMPDump v2.5 GIT-2012-03-31 (Handshake 10 support by Xeebo)
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: Type mismatch: client sent 6, server answered 10
INFO: Connected...
ERROR: HandleCtrl: SWFVerification Type 2 request not supported, attempting to use SWFVerification Type 1! Patches welcome...
ERROR: RTMP_ReadPacket, failed to read RTMP packet header