Skip to content

Instantly share code, notes, and snippets.

View sigma's full-sized avatar
🏠
Working from Home

Yann Hodique sigma

🏠
Working from Home
View GitHub Profile
@sigma
sigma / orgtbl-config.el
Created June 23, 2014 00:11
#emacs ReST support for #org tables
(defun yh/orgtbl-to-rst-paddings (table)
(let* ((pruned-table (remove 'hline table))
(size-table (mapcar (lambda (row)
(mapcar #'length row))
pruned-table)))
(apply #'mapcar* #'max size-table)))
(defun yh/orgtbl-padded-hline (paddings &optional chr)
(let ((chr (or chr ?-)))
(concat (format "+%c" chr)
@sigma
sigma / ssl_timeout.patch
Last active July 23, 2017 23:58
#published getmail ssl #patch
diff --git a/getmailcore/retrievers.py b/getmailcore/retrievers.py
index c0f6580..37e21dc 100755
--- a/getmailcore/retrievers.py
+++ b/getmailcore/retrievers.py
@@ -402,8 +402,7 @@ class SimpleIMAPSSLRetriever(IMAPRetrieverBase, IMAPSSLinitMixIn):
ConfInstance(name='configparser', required=False),
ConfDirectory(name='getmaildir', required=False, default='~/.getmail/'),
- # socket.ssl() and socket timeouts are incompatible in Python 2.3
- #ConfInt(name='timeout', required=False, default=180),
@sigma
sigma / ipy_profile_gae.py
Created August 29, 2010 09:39
#published GAE #ipython configuration
import IPython.ipapi
from getpass import getpass
from netrc import netrc
from optparse import OptionParser
from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.tools.appcfg import AppCfgApp, StatusUpdate
from google.appengine.tools.bulkloader import RequestManager
@sigma
sigma / ssl_tee.sh
Created November 2, 2009 13:57
#published ssl_tee.sh
#!/bin/bash
# this allows to dump clear-text form of the exchanges between SSL client and SSL server
# client-side verification has to be disabled of course
# anyway, useful for debugging
# to run this you'll need
# - a unix system
# - socat
# - ncat (part of nmap 5.0 suite)
@sigma
sigma / noflet.el
Last active July 18, 2017 05:03
noflet based on cl-letf
(defmacro noflet (bindings &rest body)
`(dflet ,(mapcar
(lambda (x)
(list (car x) (cadr x)
`(let ((this-fn ,(symbol-function (car x))))
,@(cddr x))))
bindings)
,@body))
@sigma
sigma / gist:5477827
Last active June 27, 2017 05:43
#git weirdness
┌─(yann@jarvis)─[env:default]───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~magit)─┐
└─(19:09:%)─[master]── git merge --no-ff sergv/master ──(Sun,Apr28)─┘
Merge made by the 'recursive' strategy.
magit-key-mode.el | 1 +
magit.el | 50 +++++++++++++++++++++++++++++++++++++++++++++-----
tests/magit-tests.el | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
3 files changed, 97 insertions(+), 10 deletions(-)
┌─(yann@jarvis)─[env:default]───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(~magit)─┐
└─(19:10:%)─[master]── git co next ──(Sun,Apr28)─┘
Switched to branch 'next'
@sigma
sigma / inventory
Last active June 6, 2017 05:49
custom #ansible roles
localhost ansible_connection=local
coreos181 ansible_ssh_host=172.16.78.181
coreos182 ansible_ssh_host=172.16.78.182
coreos183 ansible_ssh_host=172.16.78.183
[core]
coreos181
coreos182
coreos183
@sigma
sigma / build-tmux.sh
Created October 31, 2015 00:20 — forked from philipsoutham/build-tmux.sh
Build #static #tmux
#!/usr/bin/env bash
pushd $(dirname $0) > /dev/null; CURRABSPATH=$(readlink -nf "$(pwd)"); popd > /dev/null; # Get the directory in which the script resides
set -x
MUSLPKG="musl:musl.tgz:http://www.musl-libc.org/releases/musl-1.1.4.tar.gz"
LEVTPKG="libevent:libevent2.tgz:https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
TMUXPKG="tmux:tmux.tgz:http://iweb.dl.sourceforge.net/project/tmux/tmux/tmux-1.9/tmux-1.9a.tar.gz"
NCRSPKG="ncurses:ncurses.tgz:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz"
TEMPDIR="$CURRABSPATH/tmp"
TMPLIB="tempinstall/lib"
TMPINC="tempinstall/include"
@sigma
sigma / 90-ovfenv.rules
Last active June 5, 2017 01:15
#coreos ovfenv files
# Automatically trigger ovfenv mounting.
ACTION!="add|change", GOTO="coreos_ovfenv_end"
# A normal config drive. Block device formatted with iso9660 or fat
SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="iso9660|vfat", ENV{ID_FS_LABEL}=="OVF ENV", TAG+="systemd", ENV{SYSTEMD_WANTS}+="media-ovfenv.mount"
LABEL="coreos_ovfenv_end"
@sigma
sigma / build_coreos.sh
Created February 5, 2015 21:06
#coreos build script
#!/bin/bash
MANIFEST_URL=${MANIFEST_URL:-https://github.com/coreos/manifest.git}
MANIFEST_REF=${MANIFEST_REF:-master}
MANIFEST_LAYOUT=${MANIFEST_LAYOUT:-minilayout}
MANIFEST_NAME=${MANIFEST_NAME:-release.xml}
BUILD_ID=${BUILD_ID:-`date +%s`}
CORE_PASSWD=${CORE_PASSWD:-plop}