27 Feb 2018
Cleaning up devicemapper Docker
Just run these three. No need to remove RUNNING containers.
Cleanup exited processes:
docker rm $(docker ps -q -f status=exited)
Cleanup dangling volumes:
docker volume rm $(docker volume ls -qf dangling=true)
Cleanup dangling images:
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
13 Dec 2017
How to PUT a base64 encoded string into etcd key with cURL
When using cURL, use this command (the order is very(!) important!!!):
curl -XPUT --data-urlencode value="base64 encoded string" http://127.0.0.1:2379/v2/keys/...
27 Jun 2017
How to pretty print JSON in VIM
because why not?
Open your JSON file in VIM. Type the following command:
:%!python -m json.tool
Enjoy.
30 May 2017
Backup script Docker host
I use this very simple backup script for backing up my config files to my NAS
#!/bin/sh
echo Backup script for Docker volumes
# Set var
filename=$(date +%Y-%m-%d)
oldfiles=$(date +%Y-%m-%d -d "now -7 days")
backuplocation=/Backup
# Tar the entire docker mount
tar -zcf $filename.tar.gz /docker
# Remove files from 7 days ago
rm $backuplocation/$oldfiles.tar.gz
rm $backuplocation/$oldfiles.fstab
# Copy to backup location
cp $filename.tar.gz $backuplocation
cp /etc/fstab $backuplocation/$filename.fstab
# Remove tar file
rm $filename.tar.gz
Whatevah!
24 May 2017
How to fix mixed content for Wordpress
When using an Nginx proxy you should add the following piece of code to wp-config.php
:
f ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) ||
(!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) {
$_SERVER['HTTPS'] = 'on';
}
11 May 2017
Use this command to download a 10Gb file:
wget -O /dev/null http://speedtest.tele2.net/10GB.zip
10 May 2017
D13d3l.nl is a placeholder blog page for my domain.
I probably will use this blog for personal documentation