Skip to content

Instantly share code, notes, and snippets.

defutf8 on
escape ^z^z
termcapinfo kterm 'hs@'
vbell off
attrcolor b "d"
startup_message on
cjkwidth
defscrollback 10000
msgwait 2
bufferfile "$HOME/tmp/screen-exchange"
@genneko
genneko / tmux.conf
Created June 13, 2018 00:23
Tmux settings which might be required for 256 colors. I'm not sure about this.
# https://kakurasan.blogspot.com/2017/06/term-256-and-16million-colors.html
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "xterm-256color"
@genneko
genneko / light-theme.minttyrc
Created June 13, 2018 00:27
Light color theme for mintty
Black=0,0,0
Red=255,100,0
Green=183,234,17
Yellow=234,206,28
Blue=65,105,225
Magenta=237,157,185
Cyan=0,191,191
White=255,255,255
BoldBlack=64,64,64
BoldRed=255,100,0
$ jls
JID IP Address Hostname Path
1 r1 /vm/r1
2 vpnr1 /vm/vpnr1
3 vpnr2 /vm/vpnr2
4 vpnh1 /vm/vpnh1
5 vpnh2 /vm/vpnh2
$ jls -s vnet name | fgrep vnet=1
vnet=1 name=r1
@genneko
genneko / core.txt.0
Created January 29, 2019 11:16
Excerpt from /var/crash/core.txt.0 generated after a kernel panic upon restarting wireguard on a FreeBSD 12.0 host.
dumped core - see /var/crash/vmcore.0
Tue Jan 29 11:09:03 UTC 2019
FreeBSD 12.0-RELEASE-p2 FreeBSD 12.0-RELEASE-p2 GENERIC amd64
panic: page fault
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
@genneko
genneko / wgq-cfgen
Last active February 2, 2019 07:01
A script which generates a pair of wg-quick (WireGuard) configuration files for quick testing. Not meant for production use.
#!/bin/sh
#
# wgq-cfgen - generates an initial configuration file pair for wg-quick
#
prog=$(basename $0)
bindir=$(dirname $(readlink -f $0))
echoerr() {
echo "$@" >&2
}
@genneko
genneko / .gdbinit
Last active February 7, 2019 07:31
Trying to debug kernel for the first time in my life :P, with the help of gdb's remote debugging facility.
define p_v6elem
printf "%02x%02x", $arg0 >> 0 & 0xff, $arg0 >> 8 & 0xff
end
define p_v4
printf "%d.%d.%d.%d", $arg0 >> 0 & 0xff, $arg0 >> 8 & 0xff, $arg0 >> 16 & 0xff, $arg0 >> 24 & 0xff
end
define p_dl
printf "datalink type = %d, nlen = %d, alen = %d", $arg0->sdl_type, $arg0->sdl_nlen, $arg0->sdl_alen
@genneko
genneko / WireGuard.patch
Last active April 15, 2019 08:09
FreeBSD patches for wireguard-go and wg-quick
diff --git a/src/tools/wg-quick/freebsd.bash b/src/tools/wg-quick/freebsd.bash
index 93f1a3b..9ce3be2 100755
--- a/src/tools/wg-quick/freebsd.bash
+++ b/src/tools/wg-quick/freebsd.bash
@@ -55,7 +55,12 @@ make_temp() {
}
clean_temp() {
- [[ -n $CLEANUP_TMPDIR ]] && rm -rf "$CLEANUP_TMPDIR"
+ if [ -n $CLEANUP_TMPDIR ]; then
@genneko
genneko / Vagrantfile
Created April 4, 2019 05:37
Vagrantfile to create three FreeBSD 12.0 VMs in a private subnet 192.168.10.0/24.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/freebsd-12.0"
config.vm.define :r1 do |node|
node.vm.hostname = "r1"
node.vm.network "private_network", ip: "192.168.10.1", virtualbox__intnet: "wgnet"
node.vm.provider "virtualbox" do |vb|
@genneko
genneko / Vagrantfile
Created April 9, 2019 01:58
for custom Box build
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/freebsd-12.0"
config.ssh.insert_key = false
config.vm.define :freebsd do |node|
node.vm.hostname = "freebsd"
node.vm.provider "virtualbox" do |vb|