Skip to content

Instantly share code, notes, and snippets.

View Diftraku's full-sized avatar
🐤
Kweh

Toni Kaija Diftraku

🐤
Kweh
View GitHub Profile
@Diftraku
Diftraku / subdump.sh
Created March 24, 2020 19:13
Dump specific subtitle tracks from MKV files to appropriate .srt files
#!/bin/bash
SUB_TRACKS="2:jpn 3:eng"
find . -type f -iname "*.mkv" -print0 | while IFS= read -r -d '' file; do
TITLE=$(basename "${file}" .mkv)
echo $TITLE
for track in $SUB_TRACKS; do
TRACK_ID=$(echo $track | cut -d':' -f1)
TRACK_LANG=$(echo $track | cut -d':' -f2)
mkvextract tracks "${file}" "${TRACK_ID}:${TITLE}.${TRACK_LANG}.srt"
done
@Diftraku
Diftraku / ufw-glusterfs.conf
Created April 4, 2018 09:59
UFW Application Profile for GlusterFS
[GlusterFS Daemon]
title=GlusterFS (Daemon)
description=GlusterFS Daemon
ports=24007/tcp
[GlusterFS Management]
title=GlusterFS (Management)
description=GlusterFS Management
ports=24008/tcp

Keybase proof

I hereby claim:

  • I am diftraku on github.
  • I am diftraku (https://keybase.io/diftraku) on keybase.
  • I have a public key ASB5wpHK3e1BcwCBw-IQilrcTQ0VnNkf0AtIn1Q6S08Nvwo

To claim this, I am signing this object:

@Diftraku
Diftraku / gist:9991b70204c3b054af43
Created August 16, 2015 12:52
Microsoft Crapware™-blocklist
# Microsoft Crapware
0.0.0.0 vortex.data.microsoft.com
0.0.0.0 vortex-win.data.microsoft.com
0.0.0.0 telecommand.telemetry.microsoft.com
0.0.0.0 telecommand.telemetry.microsoft.com.nsatc.net
0.0.0.0 oca.telemetry.microsoft.com
0.0.0.0 oca.telemetry.microsoft.com.nsatc.net
0.0.0.0 sqm.telemetry.microsoft.com
0.0.0.0 sqm.telemetry.microsoft.com.nsatc.net
0.0.0.0 watson.telemetry.microsoft.com
@Diftraku
Diftraku / gist:5888214
Created June 28, 2013 21:18
A "simple" PHP function to convert arrays into DataTable JSON export format fit to use with Google Charts
<?php
/**
* arrayToDataTable()
* Converts PHP arrays to nested arrays fit for json_encode()
*
* Format Notice:
* - $cols contains all the columns for the DataTable, each column having a type and a label.
* Columns can be defined as plain arrays (containing only type and label, see below) or as a named array,
* with each of the properties defined as key => value pairs. All columns must have at least a 'type'.
*
@Diftraku
Diftraku / shimmie.txt
Created December 26, 2012 17:50
Shimmie strict standards errors
Strict standards: Declaration of PoolsTheme::display_error() should be compatible with that of BaseThemelet::display_error() in {root}/ext/pools/theme.php on line 0
Call Stack:
0.0033 672624 1. {main}() {root}/index.php:0
Strict standards: Declaration of CustomUserPageTheme::display_login_page() should be compatible with that of UserPageTheme::display_login_page() in {root}/themes/danbooru/user.theme.php on line 0
Call Stack:
0.0033 672624 1. {main}() {root}/index.php:0
@Diftraku
Diftraku / list-tree.sh
Created November 21, 2012 17:46
Simple tree -d reproduction using bash
#!/bin/bash
if [ $# -lt 1 ] ; then
$1="~/";
fi
# print the header
echo ".";
echo "|-- $1";
parent="$1";
padding="";
recurse() {