Skip to content

Instantly share code, notes, and snippets.

@glennblock
glennblock / fork forced sync
Created March 4, 2012 19:27
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 17, 2024 15:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@guillermo
guillermo / my_app.sh
Created January 15, 2014 08:27
This is a unix wrapper around the erlang vm.
#!/bin/bash
# This is a unix wrapper around the erlang vm. It provides the following functionality:
#
# * Spawns in foreground
# * Handle SIGHUP and call RELOADFUNC
# * Handle SIGTERM SIGQUIT and SIGINT telling to the vm to quit
# * Dies if the vm dies (for example kernel killing because out of memory)
#
# Forks and improvements are welcome.
@stevedomin
stevedomin / ex_playground.conf
Created August 12, 2015 23:32
Elixir Playground upstart conf
description "ex_playground"
setuid ex_playground
setgid ex_playground
start on runlevel [2345]
stop on shutdown
respawn
respawn limit 10 20
@hfreire
hfreire / qemu_osx_rpi_raspbian_jessie.sh
Last active March 24, 2024 14:35
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@plamb
plamb / gce_auth.ex
Last active December 9, 2020 14:31
Authenticate with Google Cloud using service account json key and Elixir
# https://developers.google.com/identity/protocols/OAuth2ServiceAccount
key_json = File.read!("some-service-account-key-file.json")
key_map = JOSE.decode(key_json)
jwk = JOSE.JWK.from_pem(key_map["private_key"])
jws = %{"alg" => "RS256"}
header = %{
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
@wsmoak
wsmoak / LICENSE.md
Last active April 24, 2019 07:11
Turning a stepper motor with Elixir

Turny is an Elixir port of the Adafruit Python Library for DC + Stepper Motor HAT, which is a Python library for interfacing with the Adafruit Motor HAT for Raspberry Pi to control DC motors with speed control and Stepper motors with single, double, interleave and microstepping, designed specifically to work with the Adafruit Motor Hat

----> https://www.adafruit.com/product/2348

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Limor Fried for Adafruit Industries. MIT license, all text above must be included in any redistribution

The MIT License (MIT)

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@SinanGabel
SinanGabel / Cluster setup hints
Last active June 25, 2024 09:38
CouchDB 2.* on Ubuntu 16.04
# See also: http://docs.couchdb.org/en/latest/cluster/index.html
# Before you can add nodes to form a cluster, you have to have them listen on a public ip address
# and set up an admin user (use same admin:password for all nodes).
# Do this, once per node:
# If you have installed couchdb in /opt (else change the Path)
cd /opt/couchdb/etc
cp local.ini local.ini.orig
cp vm.args vm.args.orig