Skip to content

Instantly share code, notes, and snippets.

Avatar

aeris aeris

View GitHub Profile
View ssh-delkey.sh
#!/bin/bash
HOST="${1}"
PORT="${2}"
[ "$PORT" ] && PORT=":${PORT}"
revoke() {
local HOST="[${1}]${PORT}"
echo "Revoking ${HOST}"
ssh-keygen -R "${HOST}"
}
View cacert.sh
#!/bin/sh
DIR=/usr/share/ca-certificates/cacert
mkdir $DIR
wget http://www.cacert.org/certs/root.crt -O $DIR/class1.crt
wget http://www.cacert.org/certs/class3.crt -O $DIR/class3.crt
dpkg-reconfigure ca-certificates
# Choose « yes » to add all new certificates automatically
# or « ask » to select manually the CACert certificates to use
@aeris
aeris / keybase.md
Created Apr 2, 2014
Keybase GitHub proof
View keybase.md

Keybase proof

I hereby claim:

  • I am aeris on github.
  • I am aeris (https://keybase.io/aeris) on keybase.
  • I have a public key whose fingerprint is 6A68 B761 2629 7666 ECF4 8F03 EFB7 4277 ECE4 E222

To claim this, I am signing this object:

View rsync-snapshot.rb
#!/usr/bin/env ruby
require 'fileutils'
load '/etc/rsync-snapshot.conf'
def protect
if File.exists? LOCK_FILE
print "#{$0} already running\n"
exit -1
end
View socks5.cpp
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
int main() {
sockaddr_in proxyAddress;
proxyAddress.sin_family = AF_INET;
@aeris
aeris / converter.rb
Created Jun 24, 2015
Automatize video encoding for publication
View converter.rb
#!/usr/bin/env ruby
# Licence : AGPLv3+
require 'nokogiri'
require 'tempfile'
require 'time'
RESOLUTION = :p576
AUDIO_FREQUENCY = 44100
ROOT_DIRECTORY = File.expand_path (ARGV[0] || '.')
@aeris
aeris / firewall.sh
Created Jul 24, 2015
fuck-pjlrenseignement
View firewall.sh
#!/bin/sh
iptables -t nat -N TOR
iptables -t nat -A TOR -p tcp -d 127.0.0.0/8 -j RETURN
iptables -t nat -A TOR -p tcp -d 10.0.0.0/8 -j RETURN
iptables -t nat -A TOR -p tcp -d 172.16.0.0/12 -j RETURN
iptables -t nat -A TOR -p tcp -d 192.168.0.0/16 -j RETURN
iptables -t nat -A TOR -p tcp -j REDIRECT --to-ports 9052
iptables -t nat -A OUTPUT -p tcp --syn -j TOR
iptables -t nat -A OUTPUT -p udp --dport domain -j REDIRECT --to-ports 9053
@aeris
aeris / scoping.js
Created Sep 2, 2015
JS scoping hell
View scoping.js
var val = 1;
function foo() {
print(val);
val = 2;
print(val);
}
function bar() {
var val = 3;
@aeris
aeris / qrcode-backup.rb
Created Mar 10, 2014
Backup file into QR code
View qrcode-backup.rb
#!/usr/bin/env ruby
require 'chunky_png'
require 'rqrcode_png'
CHUNK_SIZE=4096/6 # 5462 bits, QRCode 29 = 5608 bits
IMG_SIZE = 800
IMG_PER_LINE = 2
def chunk(string, size)
string.scan /.{1,#{size}}/om
View gist:1078590
### BEGIN INIT INFO
# Provides: iptables
# Required-Start: $local_fs $network
# Required-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
#!/bin/sh