SSH Getting Started

Generate key ssh-keygen -t ed25519 -C "your_email@example.com" Copy key to server ssh-copy-id -i .ssh/id_ed25519.pub <server_name> Connect to server ssh -i ~/.ssh/id_ed25519 <user>@<server_name> Avoid retyping passphrase on each new connection eval $(ssh-agent -s) ssh-add /mnt/c/Users/f.tith/.ssh/id_ed25519 It is only valid in one session. On terminal kill, you’ll need to rerun those commands. Sources https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key

February 21, 2024 · 1 min

Git Usual Commands

This page describe the usual git commands I used on daily, weekly or monthly basis. Daily push git add -u git commit -m "<changes description>" git push [<remote>] [<branch>] e.g. git add -u git commit -m "add feature" git push origin main Update feature branch from base branch Scenario: you are working on your feature branch ‘dev’ and made a Pull Request targeting ‘main’ as base. Unfortunately, someone pushed changes on the base branch ‘main’ and your feature branch ‘dev’ is “Out-Of-Date”....

February 4, 2024 · 2 min

Docker Compose Tips

Useful commands List deployed docker compose project docker compose ls Cleanup containers and volumes docker compose down -v Copy from one volume to another cp -rp /var/lib/docker/volumes/ftith_opensearch-data1/_data/ /var/lib/docker/volumes/opensearch_opensearch-data1/ YAML anchor and aliases Simple x-common_env: &common_env env_file: - db.env services: db: <<: *common_env image: postgres:16.3 frontend: <<: *common_env image: nginx:1.27.0-bookworm Common anchors with multiple docker compose files Due to this bug: https://github.com/docker/compose/issues/5621, you’ll need a workaround to fix this issue. Given those 2 files:...

December 20, 2023 · 1 min

Ansible Data Structures

Type of data structures Since Ansible is based on Python. There are two main data structures in Ansible: list and dictionary. List Initialization of a list - name: Initialize an empty list set_fact: list: [] Result is: {"list": []} Append element to a list - name: Append element to list set_fact: list: "{{ list + [ 'element_1' ] }}" Result is: {"list": ["element_1"]} Append multiple elements to a list - name: Get list of files in current directory shell: "ls" register: ls_files - name: Append filtered elements (only yaml file) to list set_fact: list: "{{ list + [ item ] }}" loop: "{{ ls_files....

December 18, 2023 · 3 min

Deploy hugo website to Github Pages

Hey! My first post is a dog eats dog post: I will give you the commands I used to deploy my blog using hugo framework to github pages. Sources: Quick start on official Hugo website Papermod Theme Installation Prerequisites git hugo cli Local setup Create a new hugo website This command will generate a template for hugo project. By default it will use .toml extension for the configuration file. You can also use ....

November 28, 2023 · 3 min