Skip to content

Instantly share code, notes, and snippets.

@piec
piec / gpg2qrcodes.sh
Last active August 27, 2015 08:41 — forked from joostrijneveld/gpg2qrcodes.sh
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done

I want to write Rust code on my computer (x86_64, Ubuntu 14.04) and produce arm executables. I found hints on the internet, but not a concise set of instructions on what to do. So I wrote them down exactly:

apt-get install g++-arm-linux-gnueabihf
git clone https://github.com/mozilla/rust.git
mkdir rust/build-cross
cd rust/build-cross
../configure --target=arm-unknown-linux-gnueabihf --prefix=$HOME/local/rust-cross
make -j8 && make install
@piec
piec / jobcontrol.vim
Last active August 29, 2015 14:05 — forked from tarruda/jobcontrol.vim
" Demo of Neovim job control feature.
"
" It starts two netcat processes listening on the same TCP port,
" the second process will exit immediately since the port will be
" unavailable(Used to demonstrate the stderr/exit events)
" To play with this, use two terminals
"
" On terminal 1: `nvim -S jobcontrol.vim`.
" Use `:call jobwrite(srv1_id, "string") to write
" data to the netcat client
@piec
piec / vidtest.c
Created February 3, 2014 19:55 — forked from Circuitsoft/Output
#include <errno.h>
#include <fcntl.h>
#include <linux/videodev2.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
@piec
piec / my_prompt.sh
Last active August 29, 2015 13:55 — forked from madx/my_prompt.sh
#!/bin/bash
function __hbar
{
eval printf '%.0s$2' {1..$1}
}
function __barre
{
__hbar $(tput cols) ─