Skip to content

Instantly share code, notes, and snippets.

@Jipok
Jipok / mpd-select
Last active December 18, 2018 18:08
Select mpd track via dmenu
#!/bin/sh
mpc -f "[[%artist% - ][%album% - ]%title%]|[%file%]" playlist | \
cat -n | sed "s/\t/: /" | \
cut -c 1-120 | dmenu -i | cut -d ':' -f 1 \
| xargs -r mpc play > /dev/null
@Jipok
Jipok / btrfs-undelete
Created November 13, 2017 16:11 — forked from Changaco/btrfs-undelete
btrfs-undelete
#!/bin/bash
# btrfs-undelete
# Copyright (C) 2013 Jörg Walter <[email protected]>
# This program is free software; you can redistribute it and/or modify it under
# the term of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or any later version.
if [ ! -b "$1" -o -z "$2" -o -z "$3" ]; then
echo "Usage: $0 <dev> <file/dir> <dest>" 1>&2
echo
@Jipok
Jipok / diff.nim
Created September 27, 2017 11:50
import os, sets, strutils
if paramCount() != 2:
echo "mydiff file1 file2"
quit()
let file1 = open(paramStr(1))
let file2 = open(paramStr(2))
let old_lines = file1.readAll().splitLines()