Page 1 of 5

Newsletter #39 - Fooled by labels Dec 5 2023

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...

Newsletter #38 - Digital Magic - A Short Story Nov 9 2023

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...

Newsletter #37 - Shells and My New Video Course Nov 2 2023

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...

Cheat sheets Oct 22 2023

Here is a list of cheat-sheets that I created for utilities and programs I enjoy using.

Read More...

Emacs - readline library cheat sheet Oct 22 2023

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

CommandDescription
C-aMove to the beginning of the line
C-eMove to the end of the line
C-bMove backward one character
C-fMove forward one character
M-bMove backward one word
M-fMove forward one word
C-lClear screen and redisplay the line

Editing Text

CommandDescription
C-dDelete the character under the cursor
C-hDelete the character before the cursor
M-dDelete the word after the cursor
M-DELDelete the word before the cursor
C-kKill from cursor to end of line
C-uKill from cursor to beginning of line
C-wKill the word behind the cursor
M-tTranspose (swap) the last two words
C-tTranspose (swap) the last two characters
C-yYank (paste) the last killed text

Command History

CommandDescription
C-pPrevious command in history
C-nNext command in history
M-<Move to the first command in history
M->Move to the last command in history
C-rReverse search through history
C-sForward search through history (might be disabled in some terminals)

Miscellaneous

CommandDescription
C-_ or C-x C-uUndo the last editing command
C-x C-eEdit the current line in an external editor (usually vi or emacs)
M-&Run the previous command in the background
C-v or M-vInsert 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...

Screen - terminal multiplexer cheat sheet Oct 22 2023

The following is a short list of the most common keybindings for the screen terminal multiplexer.

CommandDescription
C-a ?Get the screen help, and shows some keybindings
C-a cCreate a new window
C-a nSwitch to the next window
C-a p or Ctrl-a -Switch to the previous window
C-a 0 to C-a 9Switch to window number 0-9
C-a C-aToggle between the current and last window
C-a ARename 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 SSplit display horizontally
C-a | or C-a VSplit display vertically
C-a QClose all regions except the current one
C-a XClose the current region
C-a \Close current session
C-a :resizeResize region
C-a :fitResize 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 nextLoad next layout
C-a :layout prevLoad previous layout
C-a :layout title <title>Set the title of the current layout
Read More...

Tmux - terminal multiplexer cheat sheet Oct 22 2023

The following is a short list of the most common keybindings for the tmux terminal multiplexer.

Starting tmux

CommandDescription
tmuxStart a new session
tmux new -s nameStart a new session with a name
tmux aAttach to the last session
tmux a -t nameAttach to a named session
tmux lsList sessions

Session Management

CommandDescription
C-b dDetach from the current session
C-b $Rename the current session
C-b sList sessions (navigate with arrow keys)

Windows (Tabs)

CommandDescription
C-b cCreate a new window
C-b ,Rename the current window
C-b wList windows
C-b nNext window
C-b pPrevious window
C-b 0 to 9Go to window number 0-9
C-b &Close the current window

Panes (Splits)

CommandDescription
C-b %Vertical split
C-b "Horizontal split
C-b oSwitch to the next pane
C-b ;Toggle to the last pane
C-b xClose the current pane
C-b [Space]Toggle pane layouts
C-b q followed by a numberQuickly select a pane by number
C-b { or C-b }Swap panes

Misc Commands

CommandDescription
C-b tShow the time
C-b ?List all keybindings
C-b zZoom 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...

Vi - readline library cheat sheet Oct 22 2023

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.”

CommandDescription
EscEnter command mode
iEnter insert mode (before cursor)
IEnter insert mode (beginning of line)
aEnter insert mode (after cursor)
AEnter insert mode (end of line)
REnter replace mode

Cursor Movement

CommandDescription
hMove cursor left
lMove cursor right
jMove to previous command in history
kMove to next command in history
wMove forward one word
bMove backward one word
0 or ^Move to beginning of line
$Move to end of line

Editing Text

CommandDescription
xDelete the character under the cursor
XDelete the character before the cursor
dwDelete word from cursor to word end
dbDelete word from cursor to word start
D or d$Delete to end of line
d^Delete to beginning of line
ddDelete entire line
uUndo the last change
Ctrl-rRedo the last undo
pPaste text after cursor
PPaste text before cursor

Command History

CommandDescription
/Search backward in command history
?Search forward in command history
nRepeat the last / or ? command

Miscellaneous

CommandDescription
: followed by a commandExecute a command (e.g., :ls will run the ls command)
vEdit 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...

Set up AWS Cognito with Terraform and Go Oct 9 2023

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:

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...

Directory Structure for Terraform Projects Oct 1 2023

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...

$