Skip to content

Instantly share code, notes, and snippets.

View nomaster's full-sized avatar
🏳️‍🌈
Chaos Penguin

Mik Szillat nomaster

🏳️‍🌈
Chaos Penguin
View GitHub Profile
@nomaster
nomaster / gist:8ec640bc585f5a5a64156cddf01b85dd
Created August 4, 2016 16:12
Traceroute GarageBilk 185.66.193.0
Start: Thu Aug 4 18:11:51 2016
HOST: garageserver Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.1.0.2 0.0% 10 0.3 0.5 0.3 0.8 0.0
2.|-- umcowo.garagebilk.net 0.0% 10 1.1 1.7 1.1 2.7 0.0
3.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
4.|-- 1411J-MX960-01-ae10-1100. 0.0% 10 14.5 14.9 9.9 26.8 4.8
5.|-- 84.116.196.102 0.0% 10 18.2 28.4 16.6 97.8 24.5
6.|-- 84.116.196.29 0.0% 10 26.3 37.5 22.5 66.2 14.5
7.|-- de-fra01b-ri1-ae1-0.aorta 0.0% 10 15.0 20.5 14.1 31.9 5.0
8.|-- 213.46.179.62.aorta.net 0.0% 10 16.3 21.3 15.9 40.6 7.4
@nomaster
nomaster / gist:f98881a23ce08898e3b366068de80313
Created August 4, 2016 14:55
Traceroute GarageBilk / Freifunk Düsseldorf
Start: Thu Aug 4 16:55:11 2016
HOST: garageserver Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.1.0.2 0.0% 10 0.3 0.5 0.2 0.8 0.0
2.|-- umcowo.garagebilk.net 0.0% 10 2.1 2.3 1.4 3.8 0.7
3.|-- ??? 100.0 10 0.0 0.0 0.0 0.0 0.0
4.|-- 1411J-MX960-01-ae10-1100. 0.0% 10 9.9 19.8 9.0 78.0 20.6
5.|-- b2b-5-147-248-82.unitymed 0.0% 10 20.2 23.8 16.4 36.0 6.1
6.|-- r1fra2.core.init7.net 0.0% 10 21.5 28.0 13.8 90.9 22.7
7.|-- r1fra3.core.init7.net 0.0% 10 16.7 27.9 14.0 52.6 12.6
8.|-- r1lon1.core.init7.net 0.0% 10 40.1 35.9 25.8 79.9 16.6
@nomaster
nomaster / ddorf-diagram.txt
Created February 15, 2016 23:34
Freifunk Düsseldorf AS
+--------------------------+
| Rheinland Backbone |
+----+----------------+----+
| |
+----+---+ +---+----+
| Edge01 | | Edge02 |
+--+-+---+ +-+---+--+
| | | |
| +----------------+ |
| | | |
@nomaster
nomaster / ethtool.fact
Last active June 26, 2023 10:51
Ansible facts script for ethtool
#!/usr/bin/env python
import json
import subprocess
result = {}
interface_stats = subprocess.check_output("/usr/sbin/ethtool -i eth0", shell=True)
for line in interface_stats.strip().split("\n"):
PING google-public-dns-a.google.com (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=54 time=13.8 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=8.63 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=7.99 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=54 time=8.23 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=54 time=8.86 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=54 time=8.77 ms
64 bytes from 8.8.8.8: icmp_seq=6 ttl=54 time=9.09 ms
64 bytes from 8.8.8.8: icmp_seq=7 ttl=54 time=8.94 ms
64 bytes from 8.8.8.8: icmp_seq=8 ttl=54 time=9.34 ms

Keybase proof

I hereby claim:

  • I am nomaster on github.
  • I am nomaster (https://keybase.io/nomaster) on keybase.
  • I have a public key whose fingerprint is 3A89 632F 26CD 19CA 4A1A 9C30 1348 A0EF 87C3 D99A

To claim this, I am signing this object:

Normalise your URLs!
Bad
/opt/db/functions.php&session=5698136136
/forum.php?user=21515&group=134&mode=table
Good
@nomaster
nomaster / nginx.conf
Last active August 29, 2015 14:02
Nginx configuration for X-accel
http {
server {
listen 80;
server_name example.com;
location / {
rewrite ^/download/(.*) /sendfile.php?path=$1 last;
}
location /files {
@nomaster
nomaster / streamfile.php
Last active August 29, 2015 14:02
Stream file in PHP
<?php
streamfile() {
header( 'Content-Length: '.filesize($file) );
header( 'Content-Type: application/octet-stream' );
header( 'Content-Disposition: attachment; filename='.$filename );
readfile( $file );
exit;
}
@nomaster
nomaster / sendfile.php
Last active August 29, 2015 14:02
X-Sendfile in PHP
<?php
sendfile() {
header( 'X-Sendfile: '.$file ); // Apache webserver
header( 'X-Accel-Redirect: '.$file ); // Nginx webserver
header( 'Content-Type: application/octet-stream' ); // set correct mime type here
header( 'Content-Disposition: attachment; filename='.$filename );
exit;
}