Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ward on github.
  • I am wardmuylaert (https://keybase.io/wardmuylaert) on keybase.
  • I have a public key whose fingerprint is 251A E47B D975 B352 0005 B96B D009 7589 55A0 7CEC

To claim this, I am signing this object:

@ward
ward / blkdevmonitor.sh
Last active September 7, 2019 13:42
qnap nas hard drive spinning issues
#!/bin/bash
#================================================================
# Copyright (C) 2008 QNAP Systems, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@ward
ward / parse-kattis-problem-page.sh
Created July 15, 2019 13:35
Parse a open.kattis.com problem listing page to fetch the individual problems for offline use.
#!/bin/sh
# Expects a problems.txt to exist that is the source code of a problems page
if [ ! -f problems.txt ]; then
echo "You should get the source of a page with a list of problems. Save it in problems.txt."
exit 1
fi
problems=$(sed '/problems\//!d' problems.txt | sed '/\/submit/d' | sed '/\/statistics/d' | sed 's/^.*problems\/\(.*\)".*$/\1/')
@ward
ward / gist:ecf811ad0b854d51f769c7fc3b7dcad9
Created October 23, 2016 15:14
vim replace simple <a> tag to markdown url
:s/<a href="\([^"]\+\)">\([^<]\+\)<\/a>/[\2](\1)/
@ward
ward / notes.txt
Created February 25, 2016 15:59
Compare music from a while back
find /run/media/ward/warddisk/Muziek/ -printf "%P\n" | sort > ~/tmp/muziek.txt
find /run/media/ward/WARDPOD/music/ -printf "%P\n" | sort > ~/tmp/music.txt
then
git diff the files
@ward
ward / notes.md
Last active November 18, 2015 19:20
Sane running heatmap
@ward
ward / gist:508743e3e566c87f68e5
Created October 28, 2015 12:15
reenablebrowsersanity.js
document.oncontextmenu = undefined;
document.onselectstart = undefined;
document.oncut = undefined;
document.oncopy = undefined;
document.onpaste = undefined;
document.onmousedown = undefined;
document.onclick = undefined;
@ward
ward / proximususage.js
Created October 7, 2015 08:20
Proximus usage bookmarklet
/**
* Run on https://admit.belgacom.be/eservices/wps/myportal/myBillAndUsage
* Shows the ratios of your current used bandwidth (used / total) and of
* how much of the month has gone by (current amount passed / total amount in month)
*/
function parseBytes(s) {
var gm = /^(\d+) GB (\d+) MB$/;
var g = /^(\d+) GB$/;
var m = /^(\d+) MB$/;
# Changes the metadata of all the dates to the modify date in the filesystem
# The -P keeps the modify date itself intact
exiftool -P -"filemodifydate>alldates" SOMEFILE.jpg
# Show date related metadata
exiftool -alldates SOMEFILE.jpg
# Show file modified date
exiftool -filemodifydate SOMEFILE.jpg
@ward
ward / anagrams
Created April 7, 2015 15:01
Ward Muylaert anagrams
(via: http://datagenetics.com/blog/april12015/index.html)
Here are all the English language sub words that can be made from: WARD MUYLAERT
Min word length: 3
Max number of words: 3
Words excluded:
Must include:
---