Skip to content

Instantly share code, notes, and snippets.

View toke's full-sized avatar

Thomas Kerpe toke

View GitHub Profile

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

1. http://blog.rootshell.be/2015/02/19/my-little-pwnie-box/
2. https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
@toke
toke / grbl-settings.txt
Created October 31, 2018 22:45
GRBL 1.1 settings for my Elekslaser A3
$$
$0=10
$1=25
$2=0
$3=1
$4=0
$5=0
$6=0
$10=1
$11=0.010
@toke
toke / fw_block.sh
Last active April 24, 2023 09:36
Simple spamhaus ipset firewall block
#!/usr/bin/bash
## Run every 24h via cron
## Old entries will time out later automatically
(
cd /var/lib/firewall
wget -qN 'http://www.spamhaus.org/drop/drop.txt'
ipset create -exist spamhaus_drop hash:net counters timeout 90000 comment
@toke
toke / advisory_locks_example.sql
Last active January 18, 2022 21:32
Example for advisory locks in postgresql
do $$
DECLARE
ADV_LOCK BOOLEAN DEFAULT FALSE;
LOCK_ID INTEGER DEFAULT 50;
BEGIN
-- EARLY LOCK
-- LOCK_ID := 'tablename'::regclass::integer;
SELECT pg_try_advisory_lock(LOCK_ID) into ADV_LOCK;
RAISE NOTICE 'LOCK_ID: %', LOCK_ID;
IF ADV_LOCK THEN
@toke
toke / config_20200406-1.ini
Last active December 6, 2021 23:35
Prusa Slicer config. PLA, 0,8mm Nozzle Artillery Sidewinder
# generated by PrusaSlicer 2.1.1 on 2020-04-07 at 19:06:22 UTC
avoid_crossing_perimeters = 1
bed_custom_model =
bed_custom_texture =
bed_shape = 0x0,300x0,300x300,0x300
bed_temperature = 55
before_layer_gcode =
between_objects_gcode =
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
@toke
toke / anybind_aio.py
Created January 28, 2020 13:06
Using TPROXY to bind to any port on many IPs (asyncio variant)
import asyncio
import socket
BIND_IP = "127.0.0.1"
TCP_PORT = 1234
SOCK_BACKLOG = 32
IP_TRANSPARENT = 19
desc = f"""
Anybind; "bind" on many IPs and many Ports.
@toke
toke / ansible-vault-pass.bash
Last active October 24, 2021 21:38
Small helper script for usage with ansible-vault and ansible-playbook together with pass https://www.passwordstore.org/ Two implementations: first in bash and anotger one in python, which should be better as the git config hack to get ini files may fail due to incompatibilities in git vs. ansible ini style. The bash version is kept for reference.
#!/usr/bin/env bash
set -e
#
# Written by Thomas Kerpe <toke@toke.de> - Public Domain
#
# Small helper script for usage with ansible-vault and ansible-playbook
# together with [pass](https://www.passwordstore.org/)
#
# Say you have stored the vault-password for the current ansible playbook in pass
@toke
toke / README.md
Last active July 3, 2020 00:36
K.R.A.U.S. in C

K.R.A.U.S. in pure C

Abstract

This is a C fork of the famous K.R.A.U.S. (floor of the day) application by @jautz written in perl. The acronym K.R.A.U.S. stands for the German phrase "Kaffee-Runde auf unterschiedlichen Stockwerken". It's origin lies far in the beginning of civilisation and was once called Tempus clausum.

Since being independent of a single implementation is cruical for live threatening services this fork has been established.

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG8naiu/yFZpOdBakeMWZKTrVKtQXb21ldWwjA5dKGcm toke@bluesky-20160318

Kleiner Test mit Sqlite

Sqlite-Datenbank öffnen

sqlite3 test.sqlite3

Testtabelle tbl1 erzeugen:

create table tbl1 (probe int, parameter int, result Char(10))