Saturday, August 12, 2017

Pushing It

It turns out that my rucksack was only 15kgs.
I thought it was much more. By the end of the 12 mile trek it certainly felt like much more.
I had a wonderful day exploring the Leicestershire countryside. The highlight was the Shaggy Ink Cap fungi above. It was absolutely stunning in its location. A real treat of a find.
More walks are planned.
Bed now. I'm as swollen as a balloon.

Sunday, August 06, 2017

Small Victories

Sometimes finding the right command in Linux shell can be an uphill struggle.
I seem to spend hours at a time looking for a simple and elegant solution to a problem only to find long winded articles on how to achieve the result I'm looking for. Today was one such day.
All I wanted to do was re-arrange a list in a random order. There were plenty of articles on how to choose a single item on the list randomly but nothing about my particular problem.
Then I came across the shuf command. There were a few solutions that were close but not quite what I wanted. This is where man pages come into their own. The man page for shuf is short and sweet and all the options I needed are right there on the page. After a little trial and error I wrote a short and elegant command (see above) that does exactly what I want.
How does it work?
I make a list with each item on a different line in a text file and the command writes another text file with the same list but in a random order. Simple.
One more Linux victory under my belt.