Skip to content

Instantly share code, notes, and snippets.

@mkhattab
mkhattab / ubuntu-14.04.preseed.cfg
Created March 15, 2015 19:14
Ubuntu 14.04 Preseed
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/choose_interface select auto
d-i netcfg/wireless_wep string
d-i base-installer/kernel/override-image string linux-server
@mkhattab
mkhattab / common.yml
Last active August 29, 2015 14:13
Ansible IPtables
---
- name: install iptables persistent
apt: pkg=iptables-persistent update_cache=yes state=present
tags:
- common
# For some reason, iptables-persistent will fail to start
# if IPv6 rules file is empty or invalid
- name: remove iptables rules.v6 file
file: path=/etc/iptables/rules.v6 state=absent
@mkhattab
mkhattab / my-scheme.el
Last active August 29, 2015 13:56
Evaluate last sexp as inline comment
;;; my-scheme configuration
(defun my-scm-preoutput-filter (string)
(with-current-buffer (window-buffer (frame-selected-window))
(save-restriction
(save-excursion
(backward-sexp)
(forward-sexp)
(paredit-comment-dwim)
@mkhattab
mkhattab / emacs-multiterm-tramp.sh
Created February 4, 2012 19:19
Emacs Multi Term Shell
#Emacs ansi-term directory tracking
# track directory, username, and cwd for remote logons
if [ "$TERM" = "eterm-color" ]; then
function eterm-set-cwd {
$@
echo -e "\033AnSiTc" $(pwd)
}
# set hostname, user, and cwd
function eterm-reset {