Skip to content

Instantly share code, notes, and snippets.

@daktak
daktak / FailEmail.py
Last active August 29, 2015 14:21
NZBGet ppscript modified to send email only on failure
#!/usr/bin/env python2
# GistID: d92a0fccbe76f275ff2e
#
# E-Mail post-processing script for NZBGet that notifies on failure only
#
# Copyright (C) 2013 Andrey Prygunkov <hugbug@users.sourceforge.net>
# With modifications by Chris Pickett "Parnic"
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@daktak
daktak / MoveFiles.py
Last active February 3, 2018 01:06
NZBGet script to move nzb files into watch dir
#!/usr/bin/env python2
# GistID: 581f5a91899f5662a4a8
#
# Move files post-processing script for NZBGet
#
# Copyright (C) 2013 Andrey Prygunkov <hugbug@users.sourceforge.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@daktak
daktak / vcftoxml.py
Created May 7, 2015 04:04
convert Contacts.vcf to XML format used by Pidgin (good for Whatsapp / Telegram contact list)
#!/usr/bin/env python
"""
Parse phone and email records out of vCard file and store them in an xml file to
be inserted into pidgins blist.xml.
Copyright (C) 2012 Senko Rasic <senko.rasic@dobarkod.hr>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@daktak
daktak / ng-iprules.sh
Last active March 12, 2016 21:02
Transparent Proxy mangle for NetGear router
#!/usr/bin/expect
set timeout 20
set hostName [lindex $argv 0]
set userName [lindex $argv 1]
set password [lindex $argv 2]
spawn telnet $hostName
expect "DGN2200v3 login: "
send "$userName\r"
#!/bin/sh
# script to check for complete torrents in transmission folder, then stop and move them
# either hard-code the MOVEDIR variable here?
MOVEDIR=/pub/sabnzbd/complete # the folder to move completed downloads to
IP=192.168.5.90
# ?or set MOVEDIR using the first command-line argument
# MOVEDIR=%1
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
@daktak
daktak / config
Last active August 29, 2015 14:03
vimb config file - dvorak keymapping http://fanglingsu.github.io/vimb/
set home-page=http://duckduckgo.com
set editor-command=gvim -f %s
nnoremap b n
nnoremap B N
nnoremap t j
nnoremap n k
nnoremap h d
nnoremap l h
nnoremap <C-r> <C-I>
nnoremap <C-c> <C-O>
@daktak
daktak / nZEDb-nginx.conf
Created May 21, 2014 06:33
nZEDb nginx.conf
location /nzedb/ {
try_files $uri $uri/ @rewrites;
alias /opt/nzedb/nZEDb/www/;
}
location /nzedb/covers/ {
try_files $uri $uri/ @rewrites;
alias /opt/nzedb/nZEDb/resources/covers/;
}
@daktak
daktak / getwebshot.sh
Last active December 30, 2018 22:38
Take a photo from the webcam and email it. Requires sendmail and mplayer
#!/bin/sh
#edit /etc/pam.d/system-auth
#change pam_unix (line 2 to below)
#auth [success=1 new_authtok_reqd=ok ignore=ignore default=bad] pam_unix.so try_first_pass likeauth nullok
#auth [default=ignore] pam_exec.so seteuid /usr/local/bin/getwebshot.sh
TMP_DIR=/tmp/cheese
HOSTNAME=localhost
MAILTO=me@email.com
MAILFROM=root@email.com.au
SUBJECT="Do you know this person?"
@daktak
daktak / xbmcsendmsg.py
Created April 22, 2014 02:15
Send notify popup to XBMC
#!/bin/env python2
import json
import requests
import getopt, sys
HOST='localhost'
PORT='8080'
TITLE="Testing"
MESSAGE="Hello"
@daktak
daktak / .zshrc
Last active December 30, 2018 22:38
zshrc from system rescue cd
#
# This file is based on the configuration written by
# Bruno Bonfils, <asyd@debian-fr.org>
# Written since summer 2001
# colors
eval `dircolors /etc/DIR_COLORS`
autoload -U zutil
autoload -U compinit