Skip to content

Instantly share code, notes, and snippets.

View leszekdubiel's full-sized avatar

Leszek Dubiel leszekdubiel

View GitHub Profile
printf "\tname John\tage 24\t\ncity Kraków\tname Ann\tabout works here\tage 45\n\tspeaks Polish\tname Leszek\t\r\v\b\t\tnote malformed line still works\n" | perl -e 'use utf8; use Modern::Perl qw{2017}; use Data::Dumper; no warnings qw{uninitialized}; while (<STDIN>) { my %h = map { split / /, $_, 2 } grep { / / } split /[^[:print:]]/, $_, -1; 0 && warn Dumper(\%h); print "\t$_ $h{$_}" for @ARGV ? @ARGV : sort keys %h; print "\t\n"; }' name age about
@goetzc
goetzc / btrfs-subvolume-diff.sh
Created December 30, 2017 23:02
Show the difference between two btrfs subvolumes/snapshots
#!/bin/bash
#
# Author: http://serverfault.com/users/96883/artfulrobot
#
# This script will show most files that got modified or added.
# Renames and deletions will not be shown.
# Read limitations on:
# http://serverfault.com/questions/399894/does-btrfs-have-an-efficient-way-to-compare-snapshots
#
# btrfs send is the best way to do this long term, but as of kernel