Skip to content

Month: August 2017

So you want to write a Shell script

So some people, companies even, have guidelines that describe how to write shell scripts, or even unit tests for shell scripts, as if “UNIX Shell” was a programming language. That’s wrong.

“Modern Shells” are based on a language that has been written without a formal language specification. The source looked like this, because somebody didn’t like C and wanted Algol, abusing the preprocessor. The original functionality and language rules had to be reverse engineered from that source, and original shell has a lot of weird rules and quirks:

  • You can use the caret, ‘^’, as replacement for the pipe symbol, ‘|’.
  • Check out the section »Consider a variable which has been picked up by the shell from the environment at startup. Modifying this variable creates a local copy.« in that document, especially the part where they explain this:
    If you call a script directly from a bourne shell (“./script” without shebang),  then the shell only forks off a subhell and reads in the script.
    The split between original and local copy of the variable is still present in the subshell.But if the script is a real executable with #! magic, or if another sh is called, then fork and exec is used and only the original unmodified variable will be visible.

And it gets better if you go down the entirety of that particular document.

If you think Unix Shell is a survivable programming environment, good luck, and please take your code with you while you leave.

10 Comments

AMS-IX CEO leaves

AMS-IX press release: »After 17.5 years, Job Witteman will leave AMS-IX as of October 1st. Job Witteman, who was the founder of the world’s largest internet exchange, will leave at the peak of development of the company, […]«

and

»AMS-IX has grown to be the world’s largest internet exchange, having now more than 900 customers, operating 7 internet platforms globally and a peak of internet traffic of 5.5 Tbps. In addition, AMS-IX is considered by the Dutch Government as the third main port, together with Schiphol Airport and the port of Rotterdam. This shows that the ongoing development of the digital sector and infrastructure is taken seriously.«

2 Comments

How large can MySQL Replication be in production?

Based on How large can MySQL be in production (article by JF), I have been looking at the awesome Orchestrator visualization of some replication hierarchies.

Click for large

Names have been removed, but the blue badges indicate some host counts. All of these are installations replicating across multiple Cluster/Data Center Boundaries.

Orchestrator is by far the best tool to discover and manage replication setups like these. You can restructure replication topologies with drag and drop.

3 Comments

Fertig gelesen: Attack of the 50 foot Blockchain

The Blockchain is the solution to everything, and especially the problem of the state. So or similar goes the hype. This book attacks that hype, and it’s fun to read.
It very briefly (one chapter of many) and rather easily understandable explains what Merkle trees and eternal logfiles are, how they are different from the blockchain, what ‘proof of work’ actually means.
 
It then goes on and actually takes apart the libertarian politics bullshit on top of that, by going through all the history of people and “businesses” connected to Bitcoin, Ethereum and the likes. It is full of stories how they failed, were busted, or simply neglected basic necessities.
The book nicely separates out the useful tech part from the political propaganda, and deflates the entire hype around it (Hint: Most people want Merkle trees and a trusted institution, but think they need a Blockchain – they will end up with a blockchain, a centralized institution and a large energy bill).
 
Very much recommended, and also a nice present to give to the geek next to you who is exposed to libertarian propaganda bullshit and needs immunization.
Attack of the 50 foot BLOCKCHAIN“, David Gerard, EUR 5.67
1 Comment