Skip to content

Instantly share code, notes, and snippets.

View dewey's full-sized avatar
👋
Click here to edit status

Philipp Defner dewey

👋
Click here to edit status
View GitHub Profile
@dewey
dewey / app.js
Created November 6, 2014 23:16
Script to calculate the total size of data listed in all torrent files in a given directory
// Script to calculate the total size of data listed in all torrent files in a given directory.
//
// Dependencies: Install `parse-torrent-file` and `glob` with `npm install`. `fs` is already a core library.
// Usage: Move all directories containing *.torrent files into the torrent/ directory
// and run `node app.js`.
//
// Author: https://github.com/dewey - 6.11.2014
var parseTorrentFile = require('parse-torrent-file'),
fs = require('fs'),
@dewey
dewey / gist:214b9ec50c71223da356
Created November 6, 2014 23:07
SCP Torrent from directory containing a bunch of torrents to watch directory every 5 seconds and then delete it.
for f in torrents/*; do scp "$f" [email protected]:~/rtorrent/watch/watchWHAT/ && rm "$f" ; sleep 5; done
@dewey
dewey / backup-znc-logs.sh
Created August 19, 2014 19:55
This is a simple script to automatically backup your IRC logs from multiple remote servers to a local directory.
#!/bin/bash
#title : backup-znc-logs.sh
#description : Create a local backup of all important ZNC accounts
#date : 19.08.2014
# ------------------------- START CONFIG -------------------------
# Script home directory
# This is the directory where you want to store the directories containing your log files.
SCRIPT_HOME="${HOME}/Documents/Textual Logs/ZNC/"

Keybase proof

I hereby claim:

  • I am dewey on github.
  • I am dewey (https://keybase.io/dewey) on keybase.
  • I have a public key whose fingerprint is AA6F A1E8 62E3 0BDB 1FE5 6DF7 E047 2B03 3D23 D359

To claim this, I am signing this object:

@dewey
dewey / fixcookies.sh
Last active August 29, 2015 13:56
fixcookies.sh
#!/bin/bash
#title : fixcookies.sh
#description : Replace cookie file if pywhatauto breaks it
#author : dewey
#date : 04.03.2014
md5sum=$(which md5sum)
COOKIEDIRECTORY="/home/dewey/pywhatauto/cookies"
if [ -e "$COOKIEDIRECTORY" ]; then
@dewey
dewey / popcorntime.sh
Created February 17, 2014 00:52
Randomly pick a movie from a given directory based on various optional input parameters.
#!/bin/bash
#title : popcorntime.sh
#description : This script picks a random movie from a given directory based on various input parameters.
#author : dewey
#date : 17.02.2014
# Initialise some variables
quality=
extension=
@dewey
dewey / config
Last active January 3, 2016 22:09
~/.newsbeuter/config
# Refreshing
auto-reload yes
reload-threads 3
reload-time 20
feed-sort-order unreadarticlecount-asc
# Open links in this browser
browser open
# Write error log
@dewey
dewey / git-deploy.md
Created January 10, 2014 22:39
Deploy websites using git

The local repository

cd ~/sites
mkdir example.com
cd example.com
git init
> Initialized empty Git repository in /Users/dewey/sites/example.com/.git/

The remote repository

cd ~/Documents/Developement/Eclipse/Trash
cp -R code ~
git branch -D abgabe
git checkout --orphan abgabe
git rm -rf .
rm -rf documentation .DS_Store code
git rm -r --cached documentation speisekarten .settings README.md
mv ~/code .
git add code/
git commit -m "Commit: $(date)"
@dewey
dewey / gist:7633623
Last active December 29, 2015 07:09
Restoring Textual.app channel order

Why

After accidentally hitting command + R in Textual.app your channel list will get sorted alphabetically. Unfortunately there's currently no way to revert that.

To restore the old settings:

  1. Quit Textual.app
  2. cp /path/to/timemachine/.../com.codeux.irc.textual.plist ~/Library/Containers/com.codeux.irc.textual/Data/Library/Preferences/com.codeux.irc.textual.plist
  3. A Reboot or Relogin is necessary due to Mavericks caching the preference file.

Reassign Shortcut

To prevent this from happening overwrite Textual's shortcut with some obscure shortcut you'll never hit: