Skip to content

Instantly share code, notes, and snippets.

View port19x's full-sized avatar

port19 port19x

View GitHub Profile
@port19x
port19x / backup.sh
Last active April 11, 2024 13:01
backup script
#!/bin/sh
a=$(date +%d.%m.%y)
du -shc "$HOME/git" "$HOME/doc" "$HOME/dotfiles" "$HOME/pic" "$HOME/.ssh" "$HOME/Passwords.kdbx"
printf "Is the backup small enough? (CTRL-C otherwise)"
read
echo "$a: initiating backup"
cd
mkdir "$a"
cp -r "git" "doc" "dotfiles" "pic" ".ssh" "Passwords.kdbx" "$a"
tar c -I"zstd -19 -T0" -f "$a.tar.zst" "$a"
@port19x
port19x / langs.md
Created January 26, 2024 12:47
Languages I use

image

@port19x
port19x / untempo.md
Last active February 10, 2024 09:48
Bibtex & Org Templates

I'm kinda annoyed with the emacs tempo library I currently use and don't want a separate config file that would be necessary to use emacs tempel. So I'm just publishing my templates here for copy pasta / macro bootstrapping for the next paper.

Online Reference

@online{,
  author = "",
  title = "",
  url = "",
@port19x
port19x / cc0
Created October 17, 2023 21:41
my preferred license for easy copy pasta
CC0 1.0 Universal
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for the
@port19x
port19x / timezones.md
Created August 31, 2023 08:05
Global Timezones Zsh Function

Just a small function I just added to my zshrc.

Preview

2023-08-31_10-04

Code

global() {
@port19x
port19x / x.md
Last active October 10, 2023 12:19
Out of band wildcard certificate generation with letsencrypt for

./.access should have 400 permissions and should contain dns_digitalocean_token = <redacted>

sudo pacman -S certbot-dns-digitalocean
sudo certbot certonly --dns-digitalocean --dns-digitalocean-credentials ./.access -d '*.hsnipe.moe' -d 'hsnipe.moe'
sudo cat /etc/letsencrypt/live/hsnipe.moe/privkey.pem /etc/letsencrypt/live/hsnipe.moe/cert.pem > haproxy.pem
scp haproxy.pem root@hsnipe.moe:/mnt/

Rest of configuration is done on server side / infra code

@port19x
port19x / monkey.json
Last active August 14, 2023 12:36
Monkeytype config
{
"theme":"nord",
"themeLight":"serika",
"themeDark":"serika_dark",
"autoSwitchTheme":false,
"customTheme":false,
"customThemeColors":[
"#323437",
"#e2b714",
"#e2b714",
@port19x
port19x / init.lua
Created August 4, 2023 09:20
nvim main.go && go run . && go fmt && go vet
local set = vim.opt
set.number=true
set.relativenumber=true
set.shiftwidth=4
set.tabstop=4
set.softtabstop=4
@port19x
port19x / jogdata.py
Created November 28, 2022 09:22
Visualization of exercise related data with python + july
import july
from july.utils import date_range
import matplotlib.pyplot as plt
dates = date_range("2022-01-01", "2022-12-31")
a = [0]
data = a*2 + [21] + a*16 + [22] + a*10 + [23] + a*4 + [24] + a*9 + [23] + a + [32] + a*3 + [19] + a*2 + [24] + a*3 + [40] + a*13 + [21] + a*6 + [22] + [24] + a*2 + [21] + a*4 + [22] + a*17 + [22] + a*3 + [28] + a*2 + [21] + a*3 + [34] + a*2 + [22] + a + [22] + a + [26] + a + [23] + a*3 + [21] + a*4 + [22] + a*2 + [19] + a*11 + [24] + 2*a + [70] + a*6 + [22] + a*3 + [22] + a*3 + [23] + a + [21] + [20] + [23] + [22] + a*2 + [21] + [21] + a + [20] + a*20 + [20] + a*4 + [21] + a*47 + [18] + a*12 + [20] + a*28 + [20] + a*4 + [40] + a*4 + [28] + a + [24] + a*2 + [22] + a + [20] + a*4 + [22] + [22] + a*9 + [22] + [22] + a + [22]
july.heatmap(dates, data, title="Joglog", month_grid=True, cmap="github")