Skip to content

Instantly share code, notes, and snippets.

View aeris's full-sized avatar

aeris aeris

View GitHub Profile
@aeris
aeris / clip.py
Created August 9, 2012 23:21
Copy/paste from command line with Klipper
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# 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.
import argparse, dbus, sys
bus = dbus.SessionBus()
klipper = bus.get_object('org.kde.klipper', '/klipper')
@aeris
aeris / death-letter-en.txt
Last active October 4, 2023 10:19
GDPR death letter
Dear Sir/Madam:
I am writing to you in your capacity as data protection officer for your
company. In light of recent spam received on this email address,
I am making this request for access to personal data
pursuant to Article 15 of the General Data Protection Regulation.
I am concerned that your company’s information practices may be putting my
personal information at undue risk of exposure or in fact has breached its
obligation to safeguard my personal information.
@aeris
aeris / mastodon-sidekiq-log-parser.rb
Created June 10, 2023 15:15
Mastodon Sidekiq parse error
#!/usr/bin/env ruby
require 'amazing_print'
ignores = [
/:in `/,
/Job raised exception/,
/WARN: Your Redis network connection is performing extremely poorly/,
/WARN: Mastodon::RaceConditionError/,
/Last RTT readings were/,
/If these values are close to/,
@aeris
aeris / preseed.cfg
Created March 19, 2020 15:31
Automated installer from ISO image for Debian
# Licence: GPLv3
d-i debian-installer/locale string fr_FR
d-i localechooser/supported-locales string fr_FR.UTF-8
d-i keyboard-configuration/xkb-keymap select fr(latin9)
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string dev
d-i netcfg/get_domain example.org
d-i netcfg/hostname string dev
@aeris
aeris / build-rpi-sd-card.sh
Created October 1, 2012 20:03
Build custom Raspberry Pi Debian
#!/bin/bash
# apt-get install binfmt-support qemu qemu-user-static debootstrap kpartx lvm2 dosfstools
deb_mirror="http://ftp.fr.debian.org/debian"
#deb_local_mirror="http://debian.kmp.or.at:3142/debian"
bootsize="64M"
deb_release="wheezy"
device=$1
@aeris
aeris / pinentry-kwallet
Created September 29, 2017 22:46
pinentry proxy between kwallet and pinentry-qt
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# AGPLv3 license
import dbus, logging, os, re, subprocess, sys, threading
LOGGER = logging.getLogger("kwallet")
hdlr = logging.FileHandler("/tmp/pinentry-kwallet.log")
formatter = logging.Formatter("%(levelname)s %(message)s")
hdlr.setFormatter(formatter)
#LOGGER.addHandler(hdlr)
@aeris
aeris / main.js
Created July 16, 2015 12:38
DI.fm & Sky.fm
function Station(name, url, description, image) {
this.name = name;
this.url = url;
this.description = description;
this.image = image;
}
var channels = {
'di': {
'name': 'DI.fm',
@aeris
aeris / gist:1872233
Created February 20, 2012 23:22
Debian setup for OVH
# Partitionning
fdisk /dev/sda (n p 1, a 1, t 1 fd, w)
sfdisk -d /dev/sda | sfdisk /dev/sdb
# RAID 1
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 --assume-clean
# LVM
pvcreate /dev/md0
vgcreate debian /dev/md0
@aeris
aeris / death_letter.tex
Created August 9, 2018 10:00
Lettre de la mort GDPR
\documentclass[10pt]{lettre}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{eurosym}
\usepackage{enumitem}
\usepackage[frenchb]{babel}
\begin{document}
\begin{letter}{
@aeris
aeris / randomize.rb
Last active March 20, 2019 11:41
Fast (>100MBps) CSPRNG to randomize hard drive before encryption
#!/usr/bin/env ruby
require 'openssl'
BLOCK_SIZE = 1024*1024 # 1M
CIPHER_BLOCK_SIZE = 128
loop do
n = 0
cipher = OpenSSL::Cipher::AES.new CIPHER_BLOCK_SIZE, :CBC
cipher.encrypt