Skip to content

Instantly share code, notes, and snippets.

@Burgestrand
Burgestrand / download-progress.rb
Created June 27, 2010 13:55
Ruby HTTP file download with progress measurement
require 'net/http'
require 'uri'
def download(url)
Thread.new do
thread = Thread.current
body = thread[:body] = []
url = URI.parse url
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response|
@daurnimator
daurnimator / main.c
Created June 1, 2015 04:17
Linux fork detection using thread specific keyrings.
$ gcc main.c -lkeyutils && ./a.out
15904 1
15904 0
15904 0
15904 0
15905 1
15906 1
15905 0
15906 0
15907 1
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 30, 2024 05:14 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy