Skip to content

Instantly share code, notes, and snippets.

View codefionn's full-sized avatar

Fionn Langhans codefionn

View GitHub Profile
@codefionn
codefionn / .vimrc
Last active March 19, 2020 08:37
My vimrc file
set incsearch hlsearch
set number relativenumber
set cursorline
set nowrap
set tabstop=4 shiftwidth=4 noexpandtab
set colorcolumn=81
syntax on
filetype indent on
@codefionn
codefionn / .autostart
Last active April 7, 2018 18:12
Configuration for the awesome window manager
#!/bin/bash
function run {
if ! pgrep $1 ;
then
$@&
fi
}
#run compton -CGb -r 0 -l 0 -t 0 --blur-background-fixed
@codefionn
codefionn / make.conf
Last active March 19, 2020 08:36
/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CFLAGS="${COMMON_FLAGS} -flto"
CXXFLAGS="${COMMON_FLAGS} -flto"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
LDFLAGS="-Wl,-O2 -Wl,--as-needed -flto"
@codefionn
codefionn / config
Last active March 19, 2020 08:38
i3.config - VIM controls
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
@codefionn
codefionn / .Xresources
Last active October 12, 2018 15:25
Xresources for rxvt-unicode (solarized dark)
! xft
Xft*antialias: true
Xft*rgba: rgba
Xft*hinting: true
Xft*hintstyle: hintfull
! rxvt-unicode
URxvt*saveLines: 1000
URxvt*internalBorder: 3
URxvt*lineSpace: 0
@codefionn
codefionn / ipforward
Last active April 5, 2019 09:10
Network sharing with iptables
#!/usr/bin/env bash
sysctl -w net.ipv4.ip_forward=1
# Has network (here: a OpenVPN tunnel)
INTERNET=tun0
# wants network (here: LAN-port)
WANTS_NET=enp0s25
NEW_IP=192.168.2.20
ip link set up dev $WANTS_NET
@codefionn
codefionn / clang
Last active March 19, 2020 08:34
/etc/portage/package.env - clang-flto
CC="clang"
CXX="clang++"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"

Setup mosquitto for TLS

Below, certificates and keys will be created for TLS. Then the misquitto configuration will be edited. Your server will run on localhost:8883 afterwards not localhost:1883.

Create directory for certificates

mkdir /etc/mosquitto/certs
### This is a YAML representation of the profile.
### Any line starting with a '# will be ignored.
###
### A profile consists of a set of configuration items followed by a set of
### devices.
###
### An example would look like:
### name: onenic
### config:
### raw.lxc: lxc.aa_profile=unconfined
@codefionn
codefionn / initramfs.sh
Last active August 23, 2022 21:30
Custom initramfs generator on Gentoo
#!/usr/bin/env bash
echo "Generating initramfs source structure"
cd /usr/src/initramfs && rm -r *
mkdir -p {bin,dev/mapper,etc,lib,lib64,mnt/root,proc,root,sbin,sys,run}
cp --archive /dev/{null,console,tty} dev
# Required executables
cp \
/bin/busybox \
bin/