Skip to content

Instantly share code, notes, and snippets.

@BastiTee
BastiTee / autodns.py
Created February 27, 2021 12:31
Crontab-ready Python script to update AutoDNS / InternetX domains
# -*- coding: utf-8 -*-
"""Update script for AutoDNS / InternetX.
Requires:
- https://pypi.org/project/requests/
- https://pypi.org/project/click/
"""
import logging
from re import match
@BastiTee
BastiTee / poc-paywall-gabonn.py
Last active October 26, 2023 18:54
Proof of concept: Paywall used on gabonn.de
# -*- coding: utf-8 -*-
"""Proof-of-concept.
This scripts tries to document the drawbacks of the paywall used on General-Anzeiger Bonn.
http://gabonn.de/
As with many other paywalls the content behind the paywall is still present – in this
case with letter-randomized "blurred" words. The raw data itself can easily be obtained
with any HTML parser like BeautifulSoup.
@BastiTee
BastiTee / README.md
Last active May 9, 2021 14:42
How I memorized to draw the Circle of Fifths

How I memorized to draw the Circle of Fifths

A cheat sheet with the patterns I apply to draw a Circle of Fifths from memory and some more nice little things you can read from it once it's drawn.

Drawing the circle

Draw a circle with twelve markers clockwise

@BastiTee
BastiTee / .gitignore
Last active February 26, 2024 07:59
Use turndown to create a markdown file from an HTML file
*.md
!README.md
node_modules/
@BastiTee
BastiTee / Dockerfile
Last active November 16, 2019 20:37
Scan-2-Mail
FROM ubuntu:17.10
# Install basic environment
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
wget vim git iputils-ping python3 python3-pip unzip
RUN echo 'deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_17.04/ /' > /etc/apt/sources.list.d/owncloud-client.list
RUN wget -nv https://download.opensuse.org/repositories/isv:ownCloud:desktop/Ubuntu_17.04/Release.key -O Release.key
RUN apt-key add - < Release.key
RUN apt-get update && apt-get upgrade -y
@BastiTee
BastiTee / sync-google-drive.sh
Created October 25, 2019 20:36
Use skicka to sync entire google drive https://github.com/google/skicka
#!/bin/bash
# Where to put the google drive data?
target_folder="/where/to/put/data"
# Make sure this script only runs once to be used in crontab
lock_file=${target_folder}/LOCKFILE
if [ -f $lock_file ]; then echo "Locked."; exit 0; fi
touch $lock_file
@BastiTee
BastiTee / yt2rss.sh
Created April 27, 2019 17:59
Generate an MP3-based RSS feed from a YouTube playlist
#!/bin/bash
@BastiTee
BastiTee / style.css
Last active January 29, 2021 08:39
A stylesheet for a very compact and post-it-colored Jira sprint board
/*
A COMPACT KIOSK-LIKE THEME FOR JIRA KANBAN BOARD
@BastiTee
URL-FILTERING
-------------
- Use this regex in stylus/browser: .*rapidView=42[^v]*
- Make sure to change the '42' to your board's number
*/
@BastiTee
BastiTee / GameOfLife.kt
Created August 8, 2018 06:56
Game of Life functional in Kotlin
package com.acme.jvm
import java.util.stream.Stream
typealias Board = List<List<Boolean>>
fun step(board: Board) = board.mapIndexed { rowIdx, row ->
row.mapIndexed { colIdx, cellAlive ->
neighboursAlive(board, rowIdx, colIdx) in if (cellAlive) 2..3 else 3..3
}
@BastiTee
BastiTee / access_s3.sh
Created June 20, 2018 07:00
Accessing Amazon S3 bucket using Curl
# #!/bin/bash
function aws_get_file() {
# Returns the file as binary
#
aws_request "GET" "-XGET" "$1"
}
function aws_get_file_metadata {
# Returns a string like: