Page 1 of 5
Hello, and welcome to issue #39!
This issue includes a new short story. The idea behind this story came from a Capture The Flag (CTF) game I was playing a few weeks ago. One of the flags could be obtained using a reasoning similar to what is presented in the story. It also seems to be a potential security issue often overlooked in projects starting to use Kubernetes.
I won’t go into much detail now; I would prefer you to read the story, and we can discuss it after you’ve read it. But I would like you to apply what you learn from the story to other aspects of your day-to-day life. Question what you think, and you might be able to catch a glimpse of something that wasn’t obvious before.
Read More...
Hello, and welcome to issue #38!
Have you ever wished for magic to exist? If it did, would you notice it?
Maybe magic does exist, just in a different form than what you expected. Not in potions and spells, but in technology.
It seems far-fetched, but our technology mirrors aspects of magic. Instant communication
across long distances. Spells in the form of commands in a terminal. Programs as spirits doing our bidding.
Read More...
Hello, and welcome to issue #37!
I’ve been thinking about the age old disputes between engineers. Everyone has a preference on how the world should work. Some people prefer Chrome, others FireFox. Some people prefer vim, others are wrong. You know what I mean, there are fans and there are FANS.
Way back when, when I was a young lad who enjoyed listening to the sound of my 56k-modem attempting to connect to the “Information Superhighway”. That is what the Internet was called back then, for the uninitiated. There was one such debate, “should you use bash or should you use zsh?”
Read More...
Here is a list of cheat-sheets that I created for utilities and programs I enjoy using.
Read More...
Bash Emacs Editing Mode Cheat Sheet
Bash’s default editing mode is Emacs. Here’s a list of the most useful shortcuts to help you navigate and edit the command line efficiently.
Cursor Movement
| Command | Description |
|---|
| C-a | Move to the beginning of the line |
| C-e | Move to the end of the line |
| C-b | Move backward one character |
| C-f | Move forward one character |
| M-b | Move backward one word |
| M-f | Move forward one word |
| C-l | Clear screen and redisplay the line |
Editing Text
| Command | Description |
|---|
| C-d | Delete the character under the cursor |
| C-h | Delete the character before the cursor |
| M-d | Delete the word after the cursor |
| M-DEL | Delete the word before the cursor |
| C-k | Kill from cursor to end of line |
| C-u | Kill from cursor to beginning of line |
| C-w | Kill the word behind the cursor |
| M-t | Transpose (swap) the last two words |
| C-t | Transpose (swap) the last two characters |
| C-y | Yank (paste) the last killed text |
Command History
| Command | Description |
|---|
| C-p | Previous command in history |
| C-n | Next command in history |
| M-< | Move to the first command in history |
| M-> | Move to the last command in history |
| C-r | Reverse search through history |
| C-s | Forward search through history (might be disabled in some terminals) |
Miscellaneous
| Command | Description |
|---|
| C-_ or C-x C-u | Undo the last editing command |
| C-x C-e | Edit the current line in an external editor (usually vi or emacs) |
| M-& | Run the previous command in the background |
| C-v or M-v | Insert the next character typed literally (e.g., allows input of control characters) |
Note: In this cheat sheet, C stands for the Control key and M stands for the Meta key (usually the Alt or Option key). Combining C or M with a character means pressing the Control or Meta key, respectively, while also pressing that character.
Read More...
The following is a short list of the most common keybindings for the screen terminal multiplexer.
| Command | Description |
|---|
| C-a ? | Get the screen help, and shows some keybindings |
| C-a c | Create a new window |
| C-a n | Switch to the next window |
| C-a p or Ctrl-a - | Switch to the previous window |
| C-a 0 to C-a 9 | Switch to window number 0-9 |
| C-a C-a | Toggle between the current and last window |
| C-a A | Rename the current window |
| C-a w or C-a " | Show a list of windows |
| C-a <Space> | Switch to the next region |
| C-a <Backspace> | Switch to the previous region |
| C-a <Tab> | Move to the next region |
| C-a S | Split display horizontally |
| C-a | or C-a V | Split display vertically |
| C-a Q | Close all regions except the current one |
| C-a X | Close the current region |
| C-a \ | Close current session |
| C-a :resize | Resize region |
| C-a :fit | Resize window to fit the terminal size |
| C-a :layout save <name> | Save current layout as <name> |
| C-a :layout load <name> | Load layout named <name> |
| C-a :layout next | Load next layout |
| C-a :layout prev | Load previous layout |
| C-a :layout title <title> | Set the title of the current layout |
Read More...
The following is a short list of the most common keybindings for the tmux terminal multiplexer.
Starting tmux
| Command | Description |
|---|
| tmux | Start a new session |
| tmux new -s name | Start a new session with a name |
| tmux a | Attach to the last session |
| tmux a -t name | Attach to a named session |
| tmux ls | List sessions |
Session Management
| Command | Description |
|---|
| C-b d | Detach from the current session |
| C-b $ | Rename the current session |
| C-b s | List sessions (navigate with arrow keys) |
Windows (Tabs)
| Command | Description |
|---|
| C-b c | Create a new window |
| C-b , | Rename the current window |
| C-b w | List windows |
| C-b n | Next window |
| C-b p | Previous window |
| C-b 0 to 9 | Go to window number 0-9 |
| C-b & | Close the current window |
Panes (Splits)
| Command | Description |
|---|
| C-b % | Vertical split |
| C-b " | Horizontal split |
| C-b o | Switch to the next pane |
| C-b ; | Toggle to the last pane |
| C-b x | Close the current pane |
| C-b [Space] | Toggle pane layouts |
| C-b q followed by a number | Quickly select a pane by number |
| C-b { or C-b } | Swap panes |
Misc Commands
| Command | Description |
|---|
| C-b t | Show the time |
| C-b ? | List all keybindings |
| C-b z | Zoom in/out on a pane |
| C-b [ and C-b ] | Enter/Exit copy mode |
| C-b : | Enter command mode |
Configuration
~/.tmux.conf is the configuration file for tmux. You can customize settings and keybindings there.
Read More...
Bash Vi Editing Mode Cheat Sheet
In Bash, you can switch to Vi editing mode with the command set -o vi. Here’s a collection of the most useful shortcuts in Vi mode.
Modes
In Vi mode, you start in “command mode” where you can navigate and manipulate text but cannot insert new text. To insert or append text, you’d enter “insert mode.”
| Command | Description |
|---|
Esc | Enter command mode |
i | Enter insert mode (before cursor) |
I | Enter insert mode (beginning of line) |
a | Enter insert mode (after cursor) |
A | Enter insert mode (end of line) |
R | Enter replace mode |
Cursor Movement
| Command | Description |
|---|
h | Move cursor left |
l | Move cursor right |
j | Move to previous command in history |
k | Move to next command in history |
w | Move forward one word |
b | Move backward one word |
0 or ^ | Move to beginning of line |
$ | Move to end of line |
Editing Text
| Command | Description |
|---|
x | Delete the character under the cursor |
X | Delete the character before the cursor |
dw | Delete word from cursor to word end |
db | Delete word from cursor to word start |
D or d$ | Delete to end of line |
d^ | Delete to beginning of line |
dd | Delete entire line |
u | Undo the last change |
Ctrl-r | Redo the last undo |
p | Paste text after cursor |
P | Paste text before cursor |
Command History
| Command | Description |
|---|
/ | Search backward in command history |
? | Search forward in command history |
n | Repeat the last / or ? command |
Miscellaneous
| Command | Description |
|---|
: followed by a command | Execute a command (e.g., :ls will run the ls command) |
v | Edit the current line in an external editor (usually vi or vim) |
Note: Always remember that you start in command mode in Vi mode. Use i, I, a, A, or R to enter different variations of insert or replace mode.
Read More...
Choosing AWS Cognito for your user authentication and authorization needs is an excellent option. Cognito provides a lot of capabilities, and with all the flexibility comes some complexity. It is hard to wrap your head around how to set it up, you probably have questions like:
- should I use a User Pool or an Identity Pool?
- If I create a User Pool, do I need to use a federated Identity Provider?
- When the documentation says that Cognito can be used as an OIDC what does it mean?
The goal of this article is to shed some light on this topics and help you set Cognito for your project. We’ll use go for the examples, but should be able to understand the ideas behind the code an dapply them to a project using other languages.
Read More...
Terraform doesn’t concern itself with the directory structure of our project. It cares about state. We, as the users of the project, are the ones who benefit from a clean and easy-to-understand directory structure.
In this post, we’ll explore basic directory structures used for Terraform projects.
Note: If you want a more in-depth discussion about the state and directory structure relationship, you might like my guide Meditations on Directory Structure for Terraform Projects.
Read More...