Sort on part of string using ls & sort

Sometimes sorting some files seems easy, but its not. For example this part :


Of course I would like to sort on numeric_id, and not on the random string; This is where command guru’s are master, I’m but a humble user, so I’d like to share my hacky solution !

ls -l | sort -t_ -k2

bam, sorted.

split large file with … split.

A small useful hack (/use of) when you need to cut a large (huge) file in pieces to move it to tapes (2.5 Tb), cd (800 Mb), … . Here comes split !


definitely not this kind of split

split -b 2T full_data.tar.gz "data.tar.gz.part"

This will split the full_data.tar.gz (+6 Tb) in pieces of 2Tb each, each part will be named data.tar.gz.part*

* is an option (see split –help), but default is double letter (aa, ab, ac, …., zz)

now, to join them together again, you can join them using cat

cat data.tar.gz* > full_data.tar.gz

Go forth and split those large files!

Choosing not to be tracked by Telenet

Itelenot-logo understand that company’s need to make money, but if they try to charge double for a single product,  that’s where I draw the line. Telenet (a network provider) wants to track both to what you look at on TV and internet use. Basically they collect your information and sell it of to advertisement company’s to target you with crappy  ads that are more focused on you, as if the premium price we pay Telenet is not enough for there investors…

Changing it is simple, yet hidden out (IMHO)

  1. Log in at
  2. Go to “My privacy settings”  (Mijn privacy-instellingen)
  3. Select the “common” setting (Algemeen)

howto change Telenet privacy settings, to a more sensible setting.

Lets hope we get a more free kabel network soon. Cause they are abusing their power more and more.

Recursively md5/sha1/sha256/sha512 a directory with files

A quick hack for checking content is consistent over systems using a hashing method.  This is for md5, which is fast but some collision is possible if carefully crafted.  Use this on each directory.

find . -type f -exec md5sum "{}" + > checksum.list

Then checking if both are equal :

diff first.list second.list

No difference : data on both ends same. This also works with sha256sum.

Good luck!

Installing ZFS on Mint 17.3 live medium

So our ZFS server running Centos 7 has some problems, and we needed to verify that the data was oké, and for good measure sync our backup.  Getting ZFS on mint was surprisingly difficult, perhaps cause of my close to zero knowledge about Mint, or perhaps its hanging a bit in limbo right now … Allot of guides on how to get booted using ZFS, but little on just the installation on Mint and not on Ubuntu. I tried (and failed) to use the debian guide, the -native- Ubuntu ppa and even the Ubuntu . In the end I found it using scraps all over the net… weird, since I was under the impression Mint was a beginner-user-friendly distro … well I guess beginners can’t have ZFS. Here goes :

Installing the zfs-native seems the best option :

sudo add-apt-repository ppa:zfs-native/stable
sudo apt-get update

Note : some errors around CD-ROM can be ignored. (I think)

W: Failed to fetch cdrom://Linux Mint 17.3 _Rosa_ - Release amd64 20160105/dists/trusty/non-free/binary-i386/Packages  Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs

Next you need to install build tools :

apt-get install build-essential

It doesn’t seem to have a dependency set on build-essentials, so do it in two steps ! Then finally install zfs … ubuntu-zfs :/

apt-get install spl-dkms zfs-dkms ubuntu-zfs

What was installed is not really clear to me, but I could find my ZFS again, after doing :

modprobe zfs

Finding the zpool can be done using :

zpool import

and to import the set : (dataet = pool name)

zpool import dataset

happy recovery 🙂

New project :

Its been silent for a while, here, not withouth cause, I been working on a new project : 
The idea is to have an “open” dive library, where users can add & modify dive locations and information divers must aquire. Its just starting out, and honistly the code is far from what I’d like, but atleast its moving forward. If you have feedback or a good idea, just drop me a line below!


Directory listing in Nginx

By default, Nginx doesn’t put directory listing on, in a development system that’s a really useful feature (many, many projects) so I tend to put it on. autoindex on;

In the server block under location :

server {
    location / {
        autoindex on;

Worked like a charm !

autoindex in action, showing the directory listing

autoindex in action, showing the directory listing


PID file /run/ not readable (yet?) after start

Aauch, after installing Nginx on a new machine Centos 7, I could not start it… for some weird error :

systemd: Starting nginx - high performance web server...
nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: nginx: configuration file /etc/nginx/nginx.conf test is successful
systemd: PID file /run/ not readable (yet?) after start.
systemd: nginx.service start operation timed out. Terminating.
systemd: Failed to start nginx - high performance web server.
systemd: Unit nginx.service entered failed state.
systemd: nginx.service failed.

The file did exist at /var/run/ and was readable. The fix after some searching :

change /etc/nginx/nginx.conf :


pid        /var/run/;


pid        /run/;

and restart the service, that’s it ? yep, that’s it! BTW, check out this new service Amplify from Nginx!

Running Nginx on Bash for Windows 10

I normally go for Apache as my go-to webserver, lately however I got a liking to Nginx, for no real reasons except for the fact it has a nicer config layout. (a bad reason is a reason non the less) So when I installed Bash for Windows 10, I when and tried Nginx, sadly it didn’t work, and still doesn’t work nicely. I however got it running, this is how : First, install Nginx.

Then I wanted to ignite Nginx, but that did not work, starting Nginx failed cause of port 80 was in use.

2016/06/24 11:37:22 [emerg] 2710#0: bind() to failed (98: Address already in use)

Since I am running two systems (Linux and Windows 10) there are plenty of places to look. I started with the location I know best and was most unlikely the problem : Linux.  Using netstat -tulpn | grep 80 I verified nothing was running on this freshly installed UbuntuBash. So onto W10, I know Skype, Apache, … uses port 80, but that did not run, so the hunt continued. I finally found -using resmon.exe– under Listener-port  the problem, port 80 was being used by System (PID 4) … not something you can easily kill …

PID 4 (Sytem) was listening on port 80. (no longer seen here)

PID 4 (Sytem) was listening on port 80. (no longer seen here)

I dug a bit further and found this useful post. You have to stop some service, this is done using :

  • windows key + x
  • select console (admin)
  • run net stop http
net stop http in Windows 10 (in dutch)

net stop http in Windows 10 (in dutch)

C:\WINDOWS\system32>net stop http
De volgende services zijn afhankelijk van de HTTP Service-service.
Als u de HTTP Service-service stopt, worden deze services eveneens gestopt.

   World Wide Web Publishing-service
   SSDP Discovery
   Print Spooler
   HomeGroup Provider
   Function Discovery Resource Publication
   Function Discovery Provider Host

Wilt u doorgaan met deze bewerking? (J/N) [N]: j
De World Wide Web Publishing-service-service wordt gestopt.
De World Wide Web Publishing-service-service is gestopt.

De SSDP Discovery-service wordt gestopt.
De SSDP Discovery-service is gestopt.

De Print Spooler-service wordt gestopt.
De Print Spooler-service is gestopt.

De HomeGroup Provider-service wordt gestopt.
De HomeGroup Provider-service is gestopt.

De Function Discovery Resource Publication-service wordt gestopt.
De Function Discovery Resource Publication-service is gestopt.

De Function Discovery Provider Host-service wordt gestopt.
De Function Discovery Provider Host-service is gestopt.

De HTTP Service-service is gestopt.

After that I retried nginx to once again be shown an error :

2806#0: ioctl(FIOASYNC) failed while spawning "worker process" (22: Invalid argument)

That was solved using this -still open- bugreport on github. The essence is add the following to /etc/nginx/nginx.conf :

master_process off;
#daemon off;

Now to be honest I have got no idea, what any of those parameters do.  (note) I tried w/o the daemon parameter and it works as well, so I only use master_process and everything seems to “work”. (different from the solution on github!)

After this, Nginx is running nicely on my BashOnWindows. Pretty nice work, Windows !

// update  28/06

On my second machine I also had to change /etc/nginx/sites-available/default the following line :

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;


server {
        listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;

This probably cause some ipv6 problem. (this is development only anyway!)


GPG error nginx signatures couldn’t be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62

A quickie before lunch :

GPG error: lucid Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62

Installing Nginx on my bash on windows 10 installation.  This is suprisingly very similar as on Ubuntu straight on bare metal, so the fix is the same :

In short :

cat nginx_signing.key | sudo apt-key add - 
apt-get update
apt-get install nginx

live :

$ wget
--2016-06-24 11:36:25--
Resolving ( 2001:1af8:4060:a004:21::e3,,
Connecting to (|2001:1af8:4060:a004:21::e3|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1561 (1.5K) [application/octet-stream]
Saving to: ‘nginx_signing.key’

100%[===========================================================================>] 1,561       --.-K/s   in 0s

2016-06-24 11:36:25 (18.4 MB/s) - ‘nginx_signing.key’ saved [1561/1561]

$ cat nginx_signing.key | sudo apt-key add -

$ apt-get install nginx
Reading package lists... Donebs
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
The following NEW packages will be installed:
 libssl0.9.8 nginx
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,194 kB of archives.
After this operation, 3,576 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 trusty-updates/universe libssl0.9.8 amd64 0.9.8o-7ubuntu3. [692 kB]
Get:2 lucid/nginx nginx amd64 1.8.0-1~lucid [502 kB]
Fetched 1,194 kB in 0s (2,337 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libssl0.9.8:amd64.
(Reading database ... 26810 files and directories currently installed.)
Preparing to unpack .../libssl0.9.8_0.9.8o-7ubuntu3. ...
Unpacking libssl0.9.8:amd64 (0.9.8o-7ubuntu3. ...
Selecting previously unselected package nginx.
Preparing to unpack .../nginx_1.8.0-1~lucid_amd64.deb ...

Thanks for using nginx!

Please find the official documentation for nginx here:

Commercial subscriptions for nginx are available on:

Unpacking nginx (1.8.0-1~lucid) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libssl0.9.8:amd64 (0.9.8o-7ubuntu3. ...
Setting up nginx (1.8.0-1~lucid) ...
runlevel:/var/run/utmp: No such file or directory
invoke-rc.d: policy-rc.d denied execution of start.
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
Processing triggers for ureadahead (0.100.0-16) ...