Skip to content

Instantly share code, notes, and snippets.

View sieste's full-sized avatar

Stefan Siegert sieste

View GitHub Profile
@sieste
sieste / arch-linux-install
Last active September 29, 2016 21:42 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sda bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# This assumes a wifi only system...
@sieste
sieste / arch-linux-encrypted-kernel-downgrade
Created November 14, 2016 22:35
Minimal instructions for kernel downgrade on arch linux with full system encryption using dm-crypt and luks
# Kernel downgrade on ARCH Linux with encrypted file-system
#
# assumes you followed https://gist.github.com/mattiaslundberg/8620837 to set up your system
#
# Credits:
# https://stephentanner.com/restoring-grub-for-an-encrypted-lvm.html
# https://wiki.archlinux.org/index.php/Kernel_Panics
# Boot into archiso live USB
@sieste
sieste / arch-brother-dcp-j4120dw-installation.md
Last active August 1, 2024 15:08
Minimal instructions to install Printer/Scanner combo "Brother DCP-J4120DW" under Arch Linux

General

  • Power up the printer, install cartridges
  • Settings -> Wi-Fi -> Setup-Wizard to connect printer to your network
  • Settings -> Wi-Fi -> TCP/IP, note IP address (mine is 192.168.1.8)
  • check if printer is reachable on the network: ping 192.168.1.8
  • create new user "lp" in group "lp": sudo useradd -s /bin/false -g lp lp

Install printer

  • install driver from AUR: yay brother-dcpj4120dw
@sieste
sieste / ParseDate.vim
Created April 9, 2018 22:34
vimscript function to format a string that describes a date ('now', 'in 2 days 2pm', 'next week'), using pythons `dateparser` module
" vimscript function takes input string `inp`, hands it to python function `parse` (module `dateparser`),
" and outputs the parsed date in format `fmt`; return `inp` if string could not be parsed to valid date
" Example:
" :echo ParseDate('tomorrow', '%Y %m %d')
function! ParseDate(inp, fmt)
python << endpython
import vim, dateparser as dp
inp = vim.eval('a:inp')
fmt = vim.eval('a:fmt')
inp_parsed = dp.parse(inp, languages=['en','de'],
@sieste
sieste / mth3028_1_7.txt
Last active January 28, 2020 16:18
MTH3028 Lecture 1.7
n = 1
theta = 1
alpha = 0.05
lo = up = numeric(10000)
for (i in 1:10000) {
x = rexp(n, 1/theta)
lo[i] = -x / log(alpha)
up[i] = -x / log(1-alpha)
}
mean(theta < lo)
@sieste
sieste / arch-linux-install.md
Last active March 21, 2020 16:46 — forked from kylemanna/arch-linux-install.md
Minimal instructions for installing arch linux on an UEFI NVMe system with full system encryption using dm-crypt and luks
n = 10
theta = 1
alpha = 0.05
lo = up = numeric(10000)
for (i in 1:10000) {
x = rexp(n, 1/theta)
lo[i] = ((1-alpha)^(-1/n) - 1) * sum(x)
up[i] = (alpha^(-1/n) - 1) * sum(x)
}
xo = rexp(10000, 1/theta)
tt = seq(as.Date('2020-02-25'), as.Date('2020-03-08'), by='1 day')
I = c(13, 13, 15, 20, 23, 36, 39, 51, 85, 116, 164, 209, 273)
# Example 3.12
x = c(0.02, 0.19, 0.27, 0.28, 0.32, 0.50, 1.08, 1.42, 2.23)
# Example 3.13
x = c(-0.63, 0.18, -0.84, 1.60, 0.33, -0.82, 0.49, 0.74, 0.58)
y = c(-0.31, 1.51, 0.39, -0.62, -2.21, 1.12, -0.04, -0.02, 0.94)
# Example 3.12
x = c(0.02, 0.19, 0.27, 0.28, 0.32, 0.50, 1.08, 1.42, 2.23)
# Example 3.13
x = c(-0.63, 0.18, -0.84, 1.60, 0.33, -0.82, 0.49, 0.74, 0.58)
y = c(-0.31, 1.51, 0.39, -0.62, -2.21, 1.12, -0.04, -0.02, 0.94)
# Example 3.16
x = c(0.38, 0.59, 0.06, 0.08, 0.22, 1.45, 0.61, 0.27, 0.48, 0.07)
B = 1000
@sieste
sieste / screencast.md
Last active March 16, 2020 15:54
Create a screencast from Linux command line