Skip to content

Instantly share code, notes, and snippets.

akomakom /
Last active Apr 8, 2021
Automated DVD Rip (then encode) using dvdbackup and ffmpeg, on insert. udev->systemd->dvdrip(script here)->dvdbackup (automatic rip to VOB). Then, when all are ripped, run dvdencode(script here) to compress all VOBS into a new cleanly named hierarchy

What this is

A collection of files to set up the following automation:

  • Activate on insert
  • Rip the DVD to a temporary path (eg /opt/dvd/tmp.XXXXX/NAME-FROM-DVD-ITSELF/VIDEO_TS)
  • Eject

Then a manual step:

  • Review directory names and rename as needed (a lot of DVD disk identifiers are useless)
  • run dvdencode, it will process all of the above to a new hierarchy, example filename: /opt/dvd/encoded/NAME-FROM-DVD-ITSELF/NAME-FROM-DVD-ITSELF-1-of-7.mp4
akomakom /
Last active Nov 11, 2019
barracudavpn <-> systemd-resolve compatibilty script

barracudavpn <-> systemd-resolve compatibilty script


My corporate Ubuntu laptop is set up with barracudavpn that doesn't understand systemd-resolve.
In its default configuration it simply overwrites /etc/resolv.conf, completely screwing up DNS on my local LAN (and non-work DNS).


akomakom /
Last active Sep 19, 2018 — forked from woods/
Set color bash prompt according to git/svn branch, and return status of last command.
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
akomakom / init.gradle
Last active Mar 29, 2018 — forked from mosabua/init.gradle
init.gradle file for proxying all repositories with Sonatype Nexus, with blacklisting feature for excluded projects. also adds plugin repository handling and a disable flag
View init.gradle
* init.gradle file for development using Nexus as proxy repository
* @author Manfred Moser <
* akom added blacklisting feature to leave certain projects alone.
apply plugin: NexusRepositoryPlugin
class NexusRepositoryPlugin implements Plugin<Gradle> {
akomakom / ansible-setup-windows.ps1
Last active Dec 25, 2020
Set up windows host for ansible remoting including upgrading powershell and rebooting if necessary (reboots only if PS requires upgrade)
View ansible-setup-windows.ps1
# This script has been tested on Windows server 2008, 2012, 2016 and Windows 10.
# This script can be run from puppet using puppetlabs/powershell:
# exec { 'setup-ansible-remoting':
# command => file("${module_name}/ansible-setup-windows.ps1"),
# provider => powershell,
# logoutput => true,
# }
# To make sure that we can run local scripts. You may need to run this line manually before you can run this script
akomakom / russian-phonetic-like-linux.klc
Last active Apr 16, 2017 — forked from max630/gist:2872656
Russian phonetic layout for MS Keyboard Layout Creator 1.4 (Windows 7). Layout is the same as the standard Russian-Phonetic keyboard in Ubuntu. (Ч on +, Ю on `, Э on \). Layout Creator 1.4 would not load, so I rebuilt it from scratch.
View russian-phonetic-like-linux.klc
KBD RU_P "Russian - Phonetic Akom"
COPYRIGHT "(c) 2017 Akom"
LOCALEID "00000419"
akomakom / find-nexus-local-repos.rb
Last active Dec 19, 2016
Nexus 2.x backup helper that finds local repositories and produces an rsync include file or runs a command for each one. See comments and -h for usage.
View find-nexus-local-repos.rb
#!/usr/bin/env ruby
# helper for backing up nexus 2 repositories that matter
# Run with -h for help
# Finds Nexus repositories that are not group, shadow or proxy
# and either produces an rsync file or runs an arbitrary command for each directory
# Examples (you may need to specify -n for all of these examples to specify your nexus installation)
akomakom /
Last active Jan 15, 2019
Bash completion file for tmux using a simple clusters file, autocompletes list names and starts ssh to all matches in a single window with synchronized keyboard input.

What this is

The two bash completion scripts provide two bash completion prefixes:

  • tm or tmuxmulti ("Connect in a split terminal to all hosts in the matched list(s)")
  • tmh or tmuxmultihost ("Tmux Multi by Host", same but for matching against the hostnames rather than list names)

The system-of-record for both of these is a ~/.tmux_clusters file (see below for format).


Option 1 (static)

akomakom / jenkins-groovy-system-script.groovy
Last active Jan 14, 2020 — forked from rb2k/gist:8372402
A jenkins script to clean up workspaces on slaves. On all slaves with less than X free GB, this script removes /slaves/workspace/* if slave is idle. If not idle, it removes /full/job/workspace/path for each job that isn't currently running. There are two versions: a "System Groovy Script" and a Jenkinsfile (Pipeline script)
View jenkins-groovy-system-script.groovy
Jenkins System Groovy script to clean up workspaces on all slaves.
Check if a slave has < X GB of free space, perform cleanup if it's less.
If slave is idle, wipe out everything in the workspace directory as well any extra configured directories.
If slave is busy, wipe out individual job workspace directories for jobs that aren't running.
Either way, remove custom workspaces also if they aren't in use.
import hudson.model.*;