Skip to content

Instantly share code, notes, and snippets.

# Based on https://www.geeksforgeeks.org/create-stopwatch-using-python/
import tkinter as Tkinter
from datetime import datetime
import serial
from serial.tools import list_ports
import time
import threading
@DoomHammer
DoomHammer / docker-port-forwarding.sh
Created November 13, 2018 20:00
Docker on Windows port forwarding
#!/bin/sh
# This script uses Virtualbox Port Forwarding to make all Docker services
# available on Windows host under `localhost`
VBXMGMT=/c/Program\ Files/Oracle/VirtualBox/VBoxManage.exe
# List all the running container ids
docker ps -q | while read -r i; do
# List all the ports bound by this container<Paste>
@DoomHammer
DoomHammer / .tmux.conf
Last active May 12, 2021 23:38
An example Tmux configuration with plugins
## Prefix like in screen
set -g prefix 'C-a'
## Use xterm keys (makes eg. Ctrl+Arrow navigate words)
set-window-option -g xterm-keys on
## List of plugins
# For this to work you need to install https://github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
@DoomHammer
DoomHammer / exifadjust
Created July 5, 2015 13:26
Adjust date on every photo made by specified camera model
for i in *; do if exiv2 pr $i|grep 'Camera model.*EX-S5' >/dev/null; then exiv2 -O +6 -D +6 -a +16:30 ad $i; fi; done
@DoomHammer
DoomHammer / pandoc-pygmentize
Last active December 13, 2021 22:40
Quick-and-dirty pandoc filter to pass all code blocks through pygments highlighter
#!/usr/bin/env python
"""
Pandoc filter to pass all code blocks through pygments highlighter.
"""
from pandocfilters import toJSONFilter, RawBlock
from pygments import highlight
from pygments.lexers import (get_lexer_by_name, guess_lexer, TextLexer)
from pygments.formatters import get_formatter_by_name
@DoomHammer
DoomHammer / flacheck
Created June 14, 2014 21:19
Find every FLAC file beginning from current directory and print names of those with errors
# Find every FLAC file beginning from current directory and print names of those with errors
find -name '*.flac' | while read i; do flac -t "$i" 2>/dev/null || echo $i; done