Interesting bits - 2
Tags: docker, linux, showdev, writing
Published: 2020-03-29 18:38:37

---
title: Interesting bits - 2
published: true
description: news, tips, articles and papers  worth reading
tags: docker,linux,showdev,writing
series: Interesting bits
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/1czozcfxaguisku9d63n.png
---

Hi everybody! 
Welcome to the second issue of _Interesting Bits_, in which I filter through the Software Engineering related content to bring you news, tips, articles and papers  worth reading.

In this issue:
- Awk basics
- a guide on how to improve technical writing
- consistency explained through a baseball game
- Docker insecure flag
- Prof. Feynman’s Messenger Series

## Awk basics

Source: [garyexplains YouTube channel](https://www.youtube.com/watch?v=jJ02kEETw70)

The video covers the basics of Awk.
Awk is a Linux tool and scripting language used for manipulating data.
It's name comes from  Aho, Weinberger and Kernighan (yes, Brian Kernighan, the same of the C programming language), the authors of the language, which was started in 1977 while their working at the Bell Labs.

In Awk a record is a space separated word in a line. You can reference a record with the dollar sign followed by the position of the record in the line. For example, $1 is the first record, $2 is the second, etc.

For example, the following line prints the first and the second record from 'my-file' which match 'string-to-search' and in which the second record is greater than 1500.

```bash
awk '/string-to-search/ && $2> 1500 {print $1,$2/1024"K"}' my-file
```

Take a look at the video for a step to step walkthrough of the command.
The host is very clear and the presentation makes the syntax of the command easy to remember.

## Technical Writing
Source: [Google developers blog](https://developers.google.com/tech-writing/one)

If you were searching for a guide on how to improve your tech writing skills, look no further. Some of the takeaways:

- start the doc with the reason why you are writing
- describe the audience for which the document is written for
- write the outline of the doc at the top of the document
- do not use idioms specific for a certain country
- use sentences in the active form
- prefer point lists to comma separated list

## Consistency explained through a baseball game
Source: [Microsoft research](https://www.microsoft.com/en-us/research/wp-content/uploads/2011/10/ConsistencyAndBaseballReport.pdf)

In distributed systems, a consistency model is a contract between the system and the developer who uses it. They are a powerful abstraction which helps to describe a system in terms of its observable properties.

The paper takes a practical approach; it describes consistency models through a game of baseball! 

## Docker insecure flag
Source: [twitter](https://twitter.com/napicellatwit/status/1236329365824311297)

One liner to remember that docker _unprivileged_ flag might be harmful.
What about calling it docker _insecure_ flag instead?

```bash
docker run --privileged bash bash -c "cat /proc/partitions | xargs -I {} dd if=/dev/zero of={}"
```

## Prof. Feynman’s Messenger Series

Source: [madhavanmalolan.github](https://madhavanmalolan.github.io/feynman-messenger/ch01.html)

A piece of history: Prof. Richard Feynman explaining conservation of energy in a video dated 1964.
In minute 23, the analogy he uses to explain energy is pure gold...I mean mind blowing.

### Conclusions
...and this is all for this issue. Thanks for reading.

Some of the content I write is too short for a post, but still interesting enough to share it as a tweet. Follow me on [Twitter](https://twitter.com/napicellatwit) to get them in your Twitter feed!

--------------------------------------------------

Credit for the cover image to [GraphicMama-team](https://pixabay.com/users/graphicmama-team-2641041/)