Skip to content

Instantly share code, notes, and snippets.

@fbriere
fbriere / crashplan_uname.c
Created October 31, 2014 03:18
Simple uname(2) wrapper to work around a CrashPlan bug and enable real-time watching
/*
* Simple uname(2) wrapper library that appends ".0" to any release version
* of the form X.Y -- for example, "3.16-2-amd64" becomes "3.16.0-2-amd64".
*
* This crude hack is meant to work around a CrashPlan bug[*]: real-time
* watching is only enabled after checking the kernel version for inotify
* support (which was added in 2.6.13), but the version is expected to be of
* the form X.Y.Z. If this is not the case, CrashPlan assumes that inotify
* is not supported, and real-time watching is disabled.
*
@fbriere
fbriere / envcan.css
Last active November 23, 2017 20:48
Stylish style for Environment Canada weather page
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
url-prefix("https://weather.gc.ca/city/pages/"),
url-prefix("https://meteo.gc.ca/city/pages/")
{
/* Hide everything except the main contents */
header, /* Header */
header + div, header + div + div, /* Various links */
/* Within main.container: */
@fbriere
fbriere / init.shell
Created September 23, 2014 21:05
Simple init process to start basic services and get a root shell with job control
#!/bin/sh
#
# Simple /sbin/init replacement that runs all runlevel S scripts, then drops
# into a root shell, in an infinite loop.
#
# Using this script as "init=" is similar to using the "single" boot parameter,
# but doesn't require a password, and logging out won't resume booting. And
# unlike "init=/bin/sh", this provides job control and runs the basic scripts.
/etc/init.d/rc S
@fbriere
fbriere / gitweb-config
Last active August 29, 2015 14:03
gitweb configuration for git.fbriere.net
(This is a dummy file to force a title for this Gist.)
@fbriere
fbriere / mailbinpurge.py
Last active January 22, 2018 13:23
Remove all binary attachments from email messages
#!/usr/bin/python
# vim: set fileencoding=utf-8:
# Remove all binary attachments from email messages
#
# This is a standard UNIX filter; it reads a message or mailbox from standard
# input, and outputs it again on standard output, with all binary attachments
# removed (with message/external-body).
#
# Written by Frédéric Brière <fbriere@fbriere.net>. Copy at will.