Skip to content

Instantly share code, notes, and snippets.

View astro's full-sized avatar

Astro astro

View GitHub Profile
@steven2358
steven2358 / ffmpeg.md
Last active May 5, 2024 12:45
FFmpeg cheat sheet
@astro
astro / flash-arduboy.sh
Created February 19, 2017 23:22
Flash .hex on Arduboy
PORT=/dev/ttyACM1
HEX=hollow_v0.31.hex
ard-reset-arduino --caterina $PORT --verbose
avrdude -P /dev/ttyACM1 -p atmega32u4 -c avr109 -b 57600 -D -Uflash:w:$HEX:i
@renchap
renchap / README.md
Last active October 12, 2022 17:14
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {
@prauscher
prauscher / generate-fastd.sh
Last active December 31, 2020 05:40
Script to generate peerings in dn42
#!/bin/bash
[ $# -ge 6 ] || {
echo "Usage: $0 <NICK> <MAIL> <GPG> <AS> <ENDPOINT> <IPV4> [PORT] [FASTD-PUBKEY]" >&2
exit 1
}
# You may want to change variables below and check if "/etc/bird/bird-dn42.conf"
# is included in your bird-config (same for bird6 with bird6-dn42.conf)
@feross
feross / WebTorrent Roadmap.md
Last active August 29, 2017 12:08
WebTorrent Roadmap

WebTorrent Roadmap

v1.0.0 Prove the vision

WebTorrent.tv. YouTube for public domain content

  • Make website
  • Find public domain content
  • Host content to ensure it’s always available
  • Need web seed support
@creationix
creationix / app.js
Created August 1, 2013 20:02
Git ls-remote as a mozilla app.
var socket = navigator.mozTCPSocket.open('github.com', 9418, {
binaryType: "arraybuffer"
});
socket.onopen = function () {
send("git-upload-pack /creationix/conquest.git\0host=github.com\0");
};
function send(string) {
var line;
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

From slide 22 of http://www.fischmarkt.de/2010/05/very_high_performance_websites_the_next.html Many of these can be checked with the YSlow Firebug extension.
* Make fewer HTTP requests
* Use a Content Delivery Network (CDN)
* Add Expires headers
* Compress components with gzip
* Put CSS at top
* Put JavaScript at bottom
* Avoid CSS expressions
* Make JavaScript and CSS external
Quad core Q6600, 4GB ram, WD 10k RPM raptor disc
Wrote 104857800 bytes in 6915ms using 1024 byte buffers: 14.461315979754156 mB/s
Wrote 104857800 bytes in 5430ms using 4096 byte buffers: 18.41620626151013 mB/s
Wrote 104857800 bytes in 3722ms using 8192 byte buffers: 26.867275658248253 mB/s
Wrote 104857800 bytes in 2919ms using 16384 byte buffers: 34.258307639602606 mB/s
Wrote 104857800 bytes in 3016ms using 32768 byte buffers: 33.15649867374005 mB/s
Wrote 104857800 bytes in 7362ms using 65536 byte buffers: 13.583265417006247 mB/s
----