Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefan Siegert sieste

  • Exeter, United Kingdom
View GitHub Profile
@sieste
sieste / arch-linux-install
Last active Sep 29, 2016 — 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
View arch-linux-install
# 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 / ParseDate.vim
Created Apr 9, 2018
vimscript function to format a string that describes a date ('now', 'in 2 days 2pm', 'next week'), using pythons `dateparser` module
View ParseDate.vim
" 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 Jan 28, 2020
MTH3028 Lecture 1.7
View mth3028_1_7.txt
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)
View mth3028_1_8.R
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)
@sieste
sieste / arch-linux-encrypted-kernel-downgrade
Created Nov 14, 2016
Minimal instructions for kernel downgrade on arch linux with full system encryption using dm-crypt and luks
View arch-linux-encrypted-kernel-downgrade
# 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
View mth3028_3.R
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)
View mth3028_3.R
# 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 Mar 16, 2020
Create a screencast from Linux command line
View screencast.md
@sieste
sieste / screencast.sh
Created Mar 21, 2020
screencast: A bash script to simultaneously record audio from mic and video from screen
View screencast.sh
#!/bin/bash
#
# Record screen and microphone audio
# Stefan Siegert 2020, adapted from code by Steven Gordon
#
# Example usage:
# screencast intro-to-datacomms
# The audio and screen will be recorded. Press 'z' to stop.
# Two files will be created: intro-to-datacomms-audio.flac, intro-to-datacomms-screen.mp4
@sieste
sieste / arch-linux-install.md
Last active Mar 21, 2020 — 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
View arch-linux-install.md
You can’t perform that action at this time.