Skip to content

Instantly share code, notes, and snippets.

View hh's full-sized avatar

Hippie Hacker hh

View GitHub Profile
@chrisbarrett
chrisbarrett / Learn Emacs in 7 days.el
Last active February 9, 2020 06:13
Paste into the scratch buffer and `M-x eval-buffer` to begin the journey.
(url-copy-file "http://ulrichdesign.ca/wp-content/uploads/2011/11/YOU-LACK-discipline.jpg"
"~/discipline.jpg")
(defun you-lack-discipline ()
(interactive)
(insert-image (create-image "~/discipline.jpg")))
(dolist (k '([up] [left] [down] [right]))
(global-set-key k 'you-lack-discipline))
@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
anonymous
anonymous / Firefox Default SSL CAs.mkd
Created January 2, 2013 17:24
Is there a way to change the default SSL CA's for firefox BEFORE the profile is created on Ubuntu?
user@laptop:~$ lsb_release  -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:	Ubuntu 12.04.1 LTS
Release:	12.04
Codename:	precise

user@laptop:~$ certutil -d ~/.mozilla/firefox/fk9tyf55.default -L
@spikegrobstein
spikegrobstein / chef_compact.sh
Created November 16, 2012 23:39
Chef compaction script run via cron
#! /bin/bash -
curl -H "Content-Type: application/json" localhost:5984/chef
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact
sleep 3
for VIEW in nodes roles registrations clients data_bags data_bags_items users checksums cookbooks sandboxes environments id_map; do
curl -H "Content-Type: application/json" -X POST http://localhost:5984/chef/_compact/$VIEW
@lucasdavila
lucasdavila / 1_ubuntu_terminal_command
Last active February 21, 2024 16:26
Installing Source Code Pro fonts in ubuntu
# to execute this gist, run the line bellow in terminal
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh
@tranthamp
tranthamp / gist:2721326
Created May 17, 2012 20:15
D-Bus and Connman notes
# Connman Technology API examples: (Object Path: /net/connman/technology/<wifi/ethernet>, Interface: net.connman.Technology)
# GetProperties
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.GetProperties
# Scan
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.Scan
# Disable/Enable wifi
dbus-send --system --dest=net.connman --print-reply /net/connman/technology/wifi net.connman.Technology.SetProperty string:Powered variant:boolean:true
#!/bin/bash
set -e -x
echo "Setting up base system"
REMOTE_SCRIPT="https://raw.github.com/gist/2573056/74237aada624251de7ddfe5e8b98a6e39f736e43/base_setup.sh"
wget -nv -O - "$REMOTE_SCRIPT" | bash
echo "Setting up Chef"
#REMOTE_SCRIPT="http://codecafe.com/chef/ec2_client_setup.sh"
REMOTE_SCRIPT="http://git.io/chefclientsetup.1"
@magnars
magnars / gist:2350388
Created April 10, 2012 10:50
Push mark when using ido-imenu
;; Push mark when using ido-imenu
(defvar push-mark-before-goto-char nil)
(defadvice goto-char (before push-mark-first activate)
(when push-mark-before-goto-char
(push-mark)))
(defun ido-imenu-push-mark ()
(interactive)