Skip to content

Instantly share code, notes, and snippets.

View andrenarchy's full-sized avatar
🚴‍♂️

André Gaul andrenarchy

🚴‍♂️
View GitHub Profile
config defaults
option syn_flood '1'
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
config zone
option name 'lan'
option network 'lan'
option input 'ACCEPT'
@andrenarchy
andrenarchy / oneliner.md
Last active January 2, 2016 07:49
One liner or very short code snippets
  • Get a list of all installed openwrt packages containing 'libremap'.

    opkg list-installed | grep libremap | awk '{ print $1 }' | tr '\n' ' '
    
  • pretty plots in matplotlib with mpltools:

    from mpltools import style
import numpy
from krypy import linsys
m = 10
n = 5
A = numpy.random.rand(m, m)
A = A + A.T
B = numpy.random.rand(n, m)
Z = numpy.zeros((n, n))
tau = 1e-4
@andrenarchy
andrenarchy / handbrake_batch
Last active August 29, 2015 14:12
Converts a dir with videos into mp4
#!/bin/bash
BASE_DIR=/home/andre/
INPUT_DIR=$BASE_DIR/handbrake_input/
OUTPUT_DIR=$BASE_DIR/handbrake_output/
OUTPUT_EXT=mp4
HANDBRAKE=HandBrakeCLI
LOG=$BASE_DIR/handbrake_batch.log
for INPUT in `ls $INPUT_DIR`; do
@andrenarchy
andrenarchy / howto.md
Last active October 21, 2018 02:59
Build icinga2 and icinga-web Debian/Ubuntu packages for non-{i386,amd64} architectures

Build icinga2 and icinga-web Debian/Ubuntu packages for non-{i386,amd64} architectures

Why?

The icinga PPA only provides packages for i386 and amd64. If you're running an ARM-powered device such as the Raspberry Pi or the ODROID U3 (which I use), you have to build the packages yourself. However, compiling the packages is very easy thanks to Debian's excellent build tools and the work of the icinga package maintainer. This howto uses pbuilder which builds in a clean chroot so your original system is not polluted with build packages.

Compile icinga2 and icingaweb2 on Ubuntu 14.04 trusty

The ppa does not build packages for ARM (e.g. ODROID U3), so let's compile them.

Configure pbuilder

Make sure that /etc/pbuilderrc contains the line

echo 'COMPONENTS="main universe multiverse restricted"' | sudo tee -a /etc/pbuilderrc

Create trusty build env

@andrenarchy
andrenarchy / HOWTO.md
Created November 18, 2015 10:42
CyanogenMod update w/ encryption

IMPORTANT: use full zip (signed flashable zip; not the incremental update)

FILE="http://builds.cyngn.com/factory/bacon/cm-12.1-YOG4PAS2QL-bacon-signed.zip"
wget ${FILE}
# copy ${FILE} to phone storage (/sdcard)
# reboot to recovery, install ${FILE}, wipe cache & dalvik cache
### Keybase proof
I hereby claim:
* I am andrenarchy on github.
* I am andrenarchy (https://keybase.io/andrenarchy) on keybase.
* I have a public key ASDBVcqSCeQErj79PAZaMzyv0WaMyYKSGClZLycQ6ZmDvwo
To claim this, I am signing this object:
LOG_FILE_PATH=""
BUCKET_DIR_PATH="/data/buckets"
DATABASE="postgresql://dbname=stellar-core user=postgres host=postgres-core"
HTTP_PORT=11626
PUBLIC_HTTP_PORT=true
@andrenarchy
andrenarchy / stellar-testnet.yml
Last active August 21, 2018 23:56
Stellar Core and Horizon with docker-compose
version: '3'
services:
postgres-core:
image: postgres:9
volumes:
- "/var/stellar-data-testnet/postgres-core:/var/lib/postgresql/data"
environment:
- POSTGRES_DB=stellar-core
stellar-core:
image: stellar-core