Commands for controlling the Raspberry Pi 2 LEDs.
See rpi-leds for a node module that does this.
- OK (ACT) LED =
led0
- Power (PWR) LED =
led1
Allow access
Disable vim automatic visual mode on mouse select | |
issue: :set mouse-=a | |
add to ~/.vimrc: set mouse-=a | |
my ~/.vimrc for preserving global defaults and only changing one option: | |
source $VIMRUNTIME/defaults.vim | |
set mouse-=a |
Commands for controlling the Raspberry Pi 2 LEDs.
See rpi-leds for a node module that does this.
led0
led1
Allow access
LIBUV_HOME := $(HOME)/src/github.com/joyent/libuv | |
LIBUV := $(LIBUV_HOME)/build/Release/libuv.a | |
INC = $(LIBUV_HOME)/include | |
all: | |
gcc -o main -I$(INC) -Wall main.c $(LIBUV) | |
PHONY: all |
/* | |
Create server/client self-signed certificate/key (self signed, DONT ADD PASSWORD) | |
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout client-key.pem -out client-cert.pem | |
openssl req -x509 -newkey rsa:2048 -days 3650 -nodes -keyout server-key.pem -out server-cert.pem | |
*/ | |
#include <stdio.h> |
wget http://archive.zfsonlinux.org/debian/pool/main/z/zfsonlinux/zfsonlinux_1%7Ewheezy_all.deb | |
dpkg -i zfsonlinux_1~wheezy_all.deb | |
apt-get update | |
apt-get install debian-zfs | |
modprobe zfs | |
fdisk -l | |
apt-get install parted | |
parted /dev/vda mklabel gpt |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
#!/bin/bash | |
#### | |
# Split MySQL dump SQL file into one file per table | |
# based on http://blog.tty.nl/2011/12/28/splitting-a-database-dump | |
#### | |
if [ $# -lt 1 ] ; then | |
echo "USAGE $0 DUMP_FILE [TABLE]" | |
exit |
ctrl-z | |
bg | |
touch /tmp/stdout | |
touch /tmp/stderr | |
gdb -p $! | |
# In GDB | |
p dup2(open("/tmp/stdout", 1), 1) | |
p dup2(open("/tmp/stderr", 1), 2) |