Skip to content

Instantly share code, notes, and snippets.

View aeris's full-sized avatar

aeris aeris

View GitHub Profile
@aeris
aeris / keybase.md
Created April 2, 2014 17:20
Keybase GitHub proof

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:

#!/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 / qrcode-backup.rb
Created March 10, 2014 22:57
Backup file into QR code
#!/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
#!/bin/bash
HOST="${1}"
PORT="${2}"
[ "$PORT" ] && PORT=":${PORT}"
revoke() {
local HOST="[${1}]${PORT}"
echo "Revoking ${HOST}"
ssh-keygen -R "${HOST}"
}
@aeris
aeris / bistromathematique.g4
Created January 27, 2014 21:40
Bistromathématique : calculatrice en base quelconque et précision infinie
grammar bistromathematique;
@header {
import java.math.BigInteger;
}
DIGIT: ('0'..'9') | ('a'..'z') | ('A'..'Z') ;
WS: [ \t\r\n]+ -> skip;
expression: a=addition { System.out.println($a.r); } EOF!;
@aeris
aeris / tbb.sh
Last active January 3, 2016 15:29
Tor Browser Bundle auto updater
#!/bin/bash
# Copyright (C) 2014 aeris
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@aeris
aeris / gpgit.py
Last active April 11, 2018 12:11
Automatically GPG encrypt all possible incoming email.Don't encrypt plain-text or clear-sign GPG sign to avoid breaking the sign
#!/usr/bin/env python
# GPGIt : Automatically GPG-encrypt incoming email
# Aeris <aeris@imirhil.fr>
# Licensed under AGPLv3 or later
import email
import sys, os
import re
from pyme.core import Data, Context
from email.mime.base import MIMEBase
@aeris
aeris / NpeWithoutMethodCall.java
Created May 22, 2013 11:08
Java silly code…
public class NpeWithoutMethodCall {
public static void main(String[] args) {
Integer defaultValue = null;
Integer value = true ? defaultValue : 0;
}
}
// javac NpeWithoutMethodCall.java && NpeWithoutMethodCall Foo
// Exception in thread "main" java.lang.NullPointerException
// at NpeWithoutMethodCall.main(NpeWithoutMethodCall.java:4)
@aeris
aeris / pools.rb
Last active December 17, 2015 00:00
Bitcoin mining pools monitoring
#!/usr/bin/env ruby
$: << '/usr/lib/ruby/1.9.1/x86_64-linux'
require 'RRD'
require 'json'
require 'httparty'
COLORS = {
:dark => {
:red => '#CC3118',
:orange => '#CC7016',
@aeris
aeris / firewall.sh
Created March 10, 2013 13:17
rc.d firewall for iptables with IPv6
### BEGIN INIT INFO
# Provides: firewall
# 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