Skip to content

Instantly share code, notes, and snippets.

@areina
areina / emacs-email-setup.md
Created October 12, 2012 15:00
Manage your email in emacs with mu4e

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
@areina
areina / custom-mu4e-trash-folder.el
Created October 30, 2013 10:54
mu4e - Dynamic trash folder for multiple accounts
(defun custom-mu4e-trash-folder (msg)
(if msg
(cond
((string-match "foo@gmail.com" (mu4e-message-field msg :maildir))
"/foo0@gmail.com/[Gmail].Trash")
((string-match "foo@3scale.net" (mu4e-message-field msg :maildir))
"/foo@3scale.net/[Gmail].Trash"))
(mu4e-ask-maildir-check-exists "Save message to maildir: ")))
(setq mu4e-trash-folder 'custom-mu4e-trash-folder)
@areina
areina / apitools_github_oauth.lua
Created April 23, 2014 16:01
Apitools middleware to provide a callback endpoint for github oauth
return function(request, next_middleware)
local CLIENT_ID = "foo"
local CLIENT_SECRET = "bar"
local APP_URL = "http://localhost:9000/#overview"
if request.uri == '/callback' then
local session_code = request.args["code"]
local url = "https://github.com/login/oauth/access_token"
local request_body = {
client_id = CLIENT_ID,
@areina
areina / gist:8f4852b9e352468c7c0f747b11444c66
Created October 16, 2017 16:25
error - ansible provisioning
The full traceback is:
File "/tmp/ansible_NvoXyJ/ansible_modlib.zip/ansible/module_utils/basic.py", line 2744, in run_command
cmd = subprocess.Popen(args, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
[WARNING]: As of Ansible 2.4, the parameter 'executable' is no longer
supported with the 'command' module. Not using '/bin/bash'.
strace -f -p 890
strace: Process 890 attached
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
futex(0x557420eb0508, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, NULL, ffffffff <unfinished ...>
+++ killed by SIGKILL +++
#!/usr/bin/env ruby
# @see http://stackoverflow.com/a/11522507
if ARGV.empty?
$stdout.puts "Usage: cleanup.rb dump.sql table_a [table_b ...]"
else
args = ARGV.reverse
file = args.pop
output_file = "#{file.gsub(File.extname(file), '')}-cleanup.sql"
;; only the first time:
;; $ sbcl
;; (ql:quickload "cffi")
---
(load "~/development/cl-libusb/package.lisp")
(in-package :cl-libusb)
installation in ubuntu 11.10
$ cd ~/sources
$ git clone https://github.com/djcb/mu.git
$ cd mu
$ sudo apt-get install libtool libgmime-2.4-dev libxapian-dev
$ autoreconf -i
$ configure
$ make
$ make install
@areina
areina / ubuntu-stumpwm
Created March 6, 2012 08:27
Ubuntu 11.10 Unity and Stumpwm
/usr/share/xsessions/gnome-stumpwm.desktop
[Desktop Entry]
Name=Stumpwm Unity
Comment=Tiling window manager
TryExec=/usr/bin/gnome-session
Exec=gnome-session --session=stumpwm
Type=XSession
@areina
areina / unifyrepotips
Created February 8, 2012 10:55
Pasos que s'han fet per unificar els repos d'ubiquo.
* Unificar els repos (tret de http://stackoverflow.com/questions/277029/combining-multiple-git-repositories)
Here's a solution I gave here:
First do a complete backup of your phd directory: I don't want to be held responsible for your losing years of hard work! ;-)
$ cp -r phd phd-backup
Move the content of phd/code to phd/code/code, and fix the history so that it looks like it has always been there (this uses git's filter-branch command):
$ cd phd/code