AWS IAM Assume Role is a mechanism that enables a user or service to assume a specific IAM role temporarily. This allows the user or service to acquire temporary security credentials, including access keys, session tokens, and permissions, to perform actions within AWS resources. The assumed role can have different permissions and policies than the original user or service, ensuring a granular level of access control and reducing the need for sharing long-term credentials.
How to Assume IAM Role in AWS and Use It
How to Configure Remote SSH Connection to WSL 2
There may be a case where you want to use WSL(Windows Subsystem for Linux) via a remote SSH connection.
Configuring a remote SSH connection to WSL is not necessarily straightforward because:
- You need to configure port forwarding from WSL to the host machine
- WSL does not have
systemd
, so you need to configure automatic booting of WSL and then SSH server inside it(because you will want to automate everything).
Well, let’s take a look at the configuration process step by step.
Vim Notes
There are several modes in VIM. NORMAL
, INSERT
, VISUAL
are most common ones.
The Most Used Default Key Bindings
:q
: quit VIM.:wq
: save the current buffer and quit.:q!
discard unsaved changes and quith
,j
,k
,l
: Movement. Example:8k
- move 8 lines up:99
: jump to the line 99w
: move one word forwardb
: move one word backward$
: move to the end of the current line0
: move to the beginning of the current lineo
: insert a new line below and go insert modeO
: insert a new line above and go insert modeA
: go insert mode at the end of the current liney
: yank (copy) selected textp
: paste the yanked textd
: delete the selected textdd
: delete the current linex
: delete the cursor characterv
: select the cursor characterV
: select the current line:sp
: split the screen horizontally:vs
: split the screen vertically/john
: search for “john” in the currentfilebuffern
: jump to the next search resultN
: jump to the previous search resultgg
: jump to the top of the current fileG
: jump to the bottom of the current file%
: jump to the closing/opening pair bracket:%s/abc/xyz/g
: replace every “abc” with “xyz” in the current file:vimgrep
: search current directory, see the help for more info:help
: open VIM help
Vim “leader” Key
<leader>
key is a vim tool that can be used to create personalized shortcuts.
How to Use Multiple Github Accounts With SSH Keys on the Same Machine
There might be a chance that you need to create and use a separate github(or bitbucket) account other than your personal one in your workplace. And Github(Bitbucket or Gitlab will do the same I believe) doesn’t allow to share a ssh key between different accounts for authentication.
That’s the case we are going to figure out below.
First of all, create a new ssh key pair on your machine.
|
|
Next, edit/create the ssh config file.
Test Doubles in Unit Testing
“Test Double” is a generic term for any case where you replace a production object for testing purposes.
I believe the following description provides a more intuitive understanding of the concept.
A Test Double is an object that stands in for a real object in a test, similar to how a stunt double stands in for an actor in a movie.
There are various kinds of test doubles: Dummies, Stubs, Mocks, Spies, Fakes.