Skip to content

Instantly share code, notes, and snippets.

@inhies
inhies / hyperboria.sh
Created December 11, 2012 09:36 — forked from cantor/hyperboria.sh
cjdns Init Script (start|stop|restart|status|flush|update|install|delete)
#!/bin/sh -e
### BEGIN INIT INFO
# hyperboria.sh - An init script (/etc/init.d/) for cjdns
# Provides: cjdroute
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Cjdns router
# Description: A routing engine designed for security, scalability, speed and ease of use.
reload|restart|force-reload)
stop
until check; do :; done
start
exit 0
;;
@inhies
inhies / gist:4969862
Last active December 13, 2015 20:28
Modified cjdns.sh init.d script
#!/bin/sh -e
### BEGIN INIT INFO
# hyperboria.sh - An init script (/etc/init.d/) for cjdns
# Provides: cjdroute
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Cjdns router
# Description: A routing engine designed for security, scalability, speed and ease of use.
@inhies
inhies / twrp.sh
Last active May 16, 2024 14:12
Creates TWRP compatible backups over USB using ADB without any files ever touching your SD card.
#!/bin/bash
#
# Version 1.4
#
# twrp.sh -- a TWRP compatible backup script for your computer
# Brought to you by inhies
#
# This script creates TWRP compatible backups over usb using adb and magikz
# By default it makes a folder in the standard TWRP date--time format (I think)
# To restore these backups, place the folder in /sdcard/TWRP/BACKUPS/<serialnumber>/
@inhies
inhies / cjdns.sh
Last active April 23, 2016 21:20
This script will install, start, update, and restart cjdns. A complete cjdns init.d solution! :D
#!/bin/bash
### BEGIN INIT INFO
# cjdns.sh - An init script (/etc/init.d/) for cjdns
# Provides: cjdns
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Cjdns router
# Description: A routing engine designed for security, scalability, speed and ease of use.
@inhies
inhies / sigcatch.go
Last active December 14, 2015 11:38
Snippet showing how to catch common interrupts and use the HUP signal to reload your config on the fly. Note that you can not catch SIGKILL so we don't even try.
c := make(chan os.Signal, 1)
signal.Notify(c)
go func() {
for sig := range c {
switch sig {
case syscall.SIGHUP:
fmt.Println("Reloading config")
if err := parseConfig(); err != nil {
fmt.Println("Error parsing config")
fmt.Println(err)
@inhies
inhies / cjdns-keygen.go
Last active December 14, 2015 16:59
Generates cjdns key pairs and stores the private key along with the IPv6 address in a database. Then use MySQL to search through the IPs for some with nice patterns.
package main
import (
"code.google.com/p/go.crypto/curve25519"
"crypto/rand"
"crypto/sha512"
"database/sql"
"fmt"
_ "github.com/Go-SQL-Driver/MySQL"
"os"
@inhies
inhies / tmux notes.md
Last active December 14, 2015 17:39
Just some tmux notes

tmux notes

Note that I use Ctrl-a for my prefix k

  • C-a C-o Rotate panes
  • C-a q Show pane numbers
  • swap-pane -s source -t target Rearrange panes

Default Bindings

@inhies
inhies / socialnode.go
Last active December 8, 2019 19:23
Reads the public feed from socialno.de every 60 seconds and displays the new posts with proper formatting to fit your terminal width. Usage: `go run socialnode.go`
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sort"
"strings"
"syscall"
@inhies
inhies / .tmux.conf
Created March 10, 2013 05:26
current version of my .tmux.conf
# C-b is not acceptable -- Vim uses it
set -g prefix C-a
unbind C-b
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0