Disclaimer: This content reflects my personal opinions, not those of any organizations I am or have been affiliated with. Code samples are provided for illustration purposes only, use with caution and test thoroughly before deployment.
(Right-click on the picture and select Open image in new tab to see the diagram in full size.)
After some recent discussion with a friend on note-taking methods, I decided to document my current productivity system for future reference. It is a combination of note-taking, time management, TODO list, project management, and writing combined. It has evolved over the years so I find it interesting to take a snapshot and look back a few years later.
I’ve conducted many system design interviews in the past. Whenever I brought up the topic of database sharding, the candidates almost always shout out “Yes, yes I know! Consistent hashing!”. If you probe them further, they will draw this classic ring diagram on the whiteboard.
…, this particular approach (Consistent hashing, as defined by Karger et al.) actually doesn’t work very well for databases, so it’s rarely used in practice (the documentation of some databases still refers to consistent hashing, but it is often inaccurate).
Then why is every system design interview study guide tell you otherwise? Let’s dive into this topic in this post.
You want to play a notification sound in a Linux shell script, but don’t want to download any sound files (e.g. MP3, WAV, MIDI). Here is a script that generates the sound on-the-fly:
First install SoX, the Swiss Army knife of sound processing programs.
sudo apt-get install sox
Then:
play -n synth 0.3 pluck A3 vol -20dB repeat 2
play: the player command from SoX.
-n: Play a “null file”.
synth 0.3 pluck A3: Play the A3 (220.00 Hz) sound for 0.3 seconds, with a waveform that simulates a guitar string pluck.
vol -20dB: The default is too loud, reduce the volume by -20dB.