Skip to content

Instantly share code, notes, and snippets.

View janstuemmel's full-sized avatar

Jan Stümmel janstuemmel

View GitHub Profile
@janstuemmel
janstuemmel / totp-expires.js
Last active December 21, 2022 00:28
When does a 2fa (totp) token expire...
const period = 30;
const epoch = Math.floor(Date.now() / 1000.0);
const expires = (Math.ceil(epoch / period) * period) - epoch;
console.log(expires);
@janstuemmel
janstuemmel / README.md
Last active December 22, 2019 17:29
Parcel bundler and postcss modules

Parcel Bundler + module stylesheets

Setup

npm i -D postcss-modules
// ./.postcssrc
#!/bin/sh
# USAGE: execute with e.g.: BAZ=hello ./script.sh 5 1
#
## Variables
#
FOO=foo
${BAR:-bar} # default value "bar" for BAR, can be set from outside the script
echo $FOO $BAR # prints: foo bar
@janstuemmel
janstuemmel / ssh-reverseproxy_webdev.md
Last active January 27, 2019 17:12
SSH reverse prox for web development

SSH Reverse Proxy

ssh -nN -R <remote-port>:localhost:<local-port> <username>@<server-ip-or-hostname>

Explanation

  • <remote-port> Any free port on your remote server, e.g. 9999
  • `` The port your local webserver is listening to, e.g. 8080
@janstuemmel
janstuemmel / steam_sys_info.txt
Created November 9, 2018 17:58
Steam system information
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD FX(tm)-8350 Eight-Core Processor
CPU Family: 0x15
@janstuemmel
janstuemmel / ungoogle_tabA-10.1_sm-t580.md
Last active December 18, 2023 14:17
Ungoogle Galaxy Tab A 10.1 (2016, SM-T580, Android 7) with Lineage OS 14.1 and MicroG

Ungoogle Samsung Galaxy Tab A 10.1

Model: SM-T580, Android 7, 64bit

Read first, flash afterwards! File to download are in the Resources section below!

Unlock OEM

  • Settings > System > About Phone > Build Number (Tap 7 times)
  • Enable OEM-Unlock in Developer Options
@janstuemmel
janstuemmel / php-regex-cheat-sheet.pdf
Last active February 7, 2018 02:54
Php Regex Cheatsheet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@janstuemmel
janstuemmel / vim.png
Last active February 7, 2018 02:51
Vim Cheatsheet
vim.png