Skip to content

Instantly share code, notes, and snippets.

View ThorstenS-linux's full-sized avatar

Thorsten Strusch ThorstenS-linux

View GitHub Profile
@ThorstenS-linux
ThorstenS-linux / pandoc.css
Created January 13, 2022 19:35 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@ThorstenS-linux
ThorstenS-linux / project-create.sh
Created August 17, 2019 06:45 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name [service-name]`
# - project-name is mandatory
# - service-name is optional
#!/usr/bin/env roundup
describe "redis-cli(1)"
# Start the redis server on port 9999
port=9999
printf "PORT $port\n" | ./redis-server - &
redis_pid=$!
# Give redis time to start listening
#!/bin/bash
#
# Dieses Script ist von http://wiki.debian.org/DebianInstaller/Preseed/EditIso
# Es holt die aktuellen initrd.gz (CD-Version, nicht hd-media). Es entpackt sie
# und plaziert die preseed.cfg in das root der initrd. Danach werden sie wieder
# zusammengesetzt und unter dem originalen Namen abgespeichert.
#
# Hintergrund:
# In der initrd schaut das Script lib/debian-installer-startup.d/S35initrd-preseed
# nach, ob die preseed.cfg existiert und nutzt diese.
@ThorstenS-linux
ThorstenS-linux / nginx include unifi.conf
Created April 8, 2018 11:57 — forked from dlangille/nginx include unifi.conf
nginx reverse proxy for unifi controller, so you can put a real cert in front of it.
# listen on port 80, and redirect to port 443
server {
listen 10.0.0.131:80;
server_name unifi01.int.unixathome.org;
error_log /var/log/nginx-unifi01.int.unixathome.org.error.log info;
access_log /var/log/nginx-unifi01.int.unixathome.org.access.log combined;
/*
RC PulseIn Servos
By: Matthew Macdonald-Wallace
Date: 29/07/2015
HEAVILY BASED ON:
RC PulseIn Joystick
By: Nick Poole
SparkFun Electronics
@ThorstenS-linux
ThorstenS-linux / beautiful_idiomatic_python.md
Created March 21, 2017 12:23 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]: