Skip to content

Instantly share code, notes, and snippets.

View kchr's full-sized avatar
😼

Noor kchr

😼
  • Gothenburg, Sweden
View GitHub Profile
@kchr
kchr / flexget_config_sverigesradio.yml
Last active August 29, 2015 14:10
Flexget config for Sveriges Radio play (podcasts)
templates:
sverigesradio:
interval: 1 hours
urlrewrite:
sr:
regexp: '/topsy/ljudfil/(?P<id>\d+).(?P<ext>.*)'
format: 'http://sverigesradio.se/topsy/ljudfil/\g<id>.\g<ext>'
regexp:
accept:
- Nytt poddradioavsnitt
@kchr
kchr / content_filter.sh
Last active August 29, 2015 14:11
Postfix internal content filtering (spam/virus) transport
#!/bin/sh
#
# This file is defined as a transport pipe in postfix master.cf
# See postfix-scanner/{main,master}.cf example files for sample configuration
#
INSPECT_DIR=/var/spool/postfix/scanner
SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
# Exit codes from <sysexits.h>
@kchr
kchr / README.md
Created August 31, 2015 11:40
Python implementation: Convex hull + Minimal bounding rectangle

What is this?

Python proof-of-concept implementation of two geomapping algorithms

Requirements

This code use the following packages:

#!/usr/bin/env bash
#
# Switch tmux session with rofi menu
ROFI_SCRIPT=$( realpath $0 )
ROFI_ARGS="-bc #0A8A8A -bw 3 -fuzzy"
_filter_dupes () {
perl -ne 'if (!defined $x{$_}) { print $_; $x{$_} = 1; }'
}
@kchr
kchr / nm_cli.bash
Created August 9, 2018 21:18
Network-Manager CLI wrapper for Qubes
#!/usr/bin/env bash
#
# Simple wrapper for Network-Manager CLI on VM
#
target_vm=sys-net
qvm_run() {
local vm=$1; shift
local cmd="$@"
qvm-run \