Skip to content

Instantly share code, notes, and snippets.

View aeris's full-sized avatar

aeris aeris

View GitHub Profile
@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 / 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 / nuitdebout.rb
Created April 2, 2016 16:11
Calendrier révolutionnaire français 2016
require 'cgi'
require 'date'
cgi = CGI.new 'html5'
cgi.out {
cgi.html {
cgi.head {
cgi.meta(charset: 'utf-8') +
cgi.title { '#NuitDebout' } +
cgi.style { 'body { font-size: 30pt; } p { margin: auto; width: 75%; background-color: #eee; text-align: center; padding: 50px; border-radius: 20px; }'}
} +
@aeris
aeris / dns.rb
Created February 15, 2015 20:42
Fetch NS record from alexa top 100k
#!/usr/bin/env ruby
require 'dnsruby'
require 'set'
require 'thread'
require 'parallel'
def merge(dns, auth)
auth.each do |a|
if dns.include? a
dns[a] += 1
public class Unicode {
public static void main(String[] args) {
if ( true ) {
// \u000A\u007D\u0020\u0065\u006C\u0073\u0065\u0020\u007B
System.out.println("True");
// \u000A\u007D\u0020\u0069\u0066\u0020\u0028\u0020\u0066\u0061\u006C\u0073\u0065\u0020\u0029\u0020\u007B
} else {
System.out.println("False");
}
}
@aeris
aeris / hpkp-tlsa.sh
Created January 17, 2016 21:18
Generate HPKP or TLSA fingerprint
#!/bin/bash
case "$1" in
hpkp)
case "$2" in
key)
openssl rsa -in "$3" -outform der -pubout 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
;;
csr)
openssl req -in "$3" -pubkey -noout | openssl rsa -pubin -outform der 2>/dev/null | openssl dgst -sha256 -binary | openssl enc -base64
@aeris
aeris / discourse-sidekiq.service
Created September 30, 2016 19:13
Discourse SystemD services
[Unit]
Description=Discourse Sidekiq
Requires=redis-server.service
After=redis-server.service
[Service]
User=www-data
WorkingDirectory=/srv/www/discourse
Environment=RBENV_ROOT=/usr/local/rbenv
Environment=RAILS_ENV=production
@aeris
aeris / lxc-backup
Created January 10, 2017 17:07
LXC management
#!/usr/bin/env python
# License : AGPLv3+
import subprocess
import logging
import re
import os.path
import tempfile
from datetime import date, datetime, timedelta
import shutil
@aeris
aeris / privacy.sieve
Last active March 6, 2017 19:49
Sieve filter for privacy
# Licence : AGPLv3+
# rule:[Privacy]
if anyof (
address :is :domain "From" "gmail.com",
address :is :domain "From" "live.com",
address :is :domain "From" "msn.com",
address :is :domain "From" "hotmail.com",
address :is :domain "From" "hotmail.fr",
address :is :domain "From" "yahoo.com",
address :is :domain "From" "yahoo.fr"
@aeris
aeris / remark2pdf.js
Created June 3, 2017 16:10
Export your remarkjs slides to PDF (require phantomjs and imagemagick)
// Licence : AGPLv3+
"use strict";
var page = require('webpage').create(),
system = require('system'),
address, output, size, pageWidth, pageHeight;
String.prototype.padLeft = function (length, character) {
return new Array(length - this.length + 1).join(character || '0') + this;
}