Skip to content

Instantly share code, notes, and snippets.

@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>
#!/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 / 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"
@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 / 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 / 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
#!/usr/bin/env python2
# GistID: 2a0460ce2b2243ffaa55
#
# Add NZB file to the queue
#
# Copyright (C) 2013 Andrey Prygunkov <hugbug@users.sourceforge.net>
#
# This program is free Series; 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 / SendFiles.py
Last active August 29, 2015 14:21
Modified to support conversion of files before sending
#!/usr/bin/env python2
# GistID: 8f261d9852d5fc0bcfe8
#
# Send 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
#!/bin/env python2
#
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# chmod for nzbget
# NOTE: This script requires Python to be installed on your system.
##############################################################################
### OPTIONS ###
@daktak
daktak / qvm-talk.sh
Last active January 9, 2017 05:15
Qubes-OS allow two appvms to talk to each other
#!/bin/bash
vm1=$1
vm2=$2
fw=$3
ip1=`qvm-run -p -u root ${vm1} "ifconfig eth0 | grep 'inet ' | column -t | cut -d ' ' -f3"`
ip2=`qvm-run -p -u root ${vm2} "ifconfig eth0 | grep 'inet ' | column -t | cut -d ' ' -f3"`
if [ -z ${fw} ]; then
fw=sys-firewall
fi