Skip to content

Instantly share code, notes, and snippets.

View wilhelmy's full-sized avatar

Moritz Wilhelmy wilhelmy

View GitHub Profile
@syl20bnr
syl20bnr / i3_focus_win.py
Last active November 19, 2018 10:45
Python script for i3 which allows to focus the nth window of the current container hierarchy. It requires i3-py: https://github.com/ziberna/i3-py
#!/usr/bin/env python
#
# author: syl20bnr (2013)
# goal: Focus the nth window in the current workspace (limited to 10 firsts)
#
# Example of usage in i3 config:
#
# bindsym $mod+0 exec focus_win.py -n 0
# bindsym $mod+1 exec focus_win.py -n 1
# ... ...
@h4cc
h4cc / munin_disable_warning.cmd
Created November 29, 2013 14:09
Disable warnings for a munin plugin
# Open the plugin configuration.
# Name is the same as filename under /etc/munin/plugins/{plugin_name}
$ /etc/munin/plugin-conf.d/{plugin_name}
# New Content:
[{plugin_name}]
env.warning 0
env.critical 0
@zonque
zonque / xymodem-mini.c
Last active February 27, 2024 06:31
simple xmodem/ymodem implementation in C
/*
* Minimalistic implementation of the XModem/YModem protocol suite, including
* a compact version of an CRC16 algorithm. The code is just enough to upload
* an image to an MCU that bootstraps itself over an UART.
*
* Copyright (c) 2014 Daniel Mack <github@zonque.org>
*
* License: MIT
*/
@lumbric
lumbric / find_rbl.py
Created April 14, 2016 21:46
Fast draft to get Wiener Linien RBL from address
import lxml
import urllib
import requests
import tabulate
import pandas as pd
# don't ask my why this is distributed via CSV only, not via REST API
csv_params = {
@derhuerst
derhuerst / output.js
Created May 10, 2016 10:22
how fetch a GitHub user's stars
[
{
owner: 'bcoe',
repo: 'top-npm-users',
description: ':star: Generate a list of top npm users by based on monthly downloads.',
language: 'JavaScript',
isFork: false,
stargazers: 27,
watchers: 27
}
@mcastelino
mcastelino / iptables-cheatsheet.md
Last active June 16, 2024 22:48
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@thehans
thehans / L_system.scad
Last active April 12, 2024 04:49
L-system implementation in OpenSCAD
/* L-system OpenSCAD library by Hans Loeblich
Version 2.0
- Now supports "M" move without draw
- Also support position save "[" and restore "]"
- Core functions have been completely rewritten and are about twice as fast using half the memory from before.
- Rules now take the form of a single string per rule: "X=ABC"
- Added new examples to demonstrate added features
This library is for creating L-systems, aka Lindenmayer System,
import cv2
import numpy as np
from random import randint, random
intensity = 10
glitch_row_size = 20
img = cv2.imread('/tmp/screenshot.png')
org_rows, org_cols, cnls = img.shape
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@ddevault
ddevault / Makefile
Last active February 20, 2024 14:17
Tiny Wayland compositor
WAYLAND_PROTOCOLS=/usr/share/wayland-protocols
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
xdg-shell-protocol.h:
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h