Hhkb Keyborad Setting for Azerty French User

As a developer living in Paris, I have to use a standard AZERTY ISO French keyboard at work, so my HHKB needs to have a similar configuration to a standard French keyboard. I used the HHKB mapping tool to change the Ctrl and Caps keys and AutoHotkey to map Alt + W to < and Alt + Shift + W to >. Create the script Here is the script: 1 2 3 4 5 6 7 8 9 10 #Requires AutoHotkey v2.0 !w:: { Send "<" } +!w:: { Send ">" } Run automatically the script every time your computer starts Create a shortcut of your script: ...

 · 171 words

Ubuntu System Administration Cheatsheet

System Configuration Change System Hostname 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # 1. Set the hostname sudo hostnamectl set-hostname new_name # 2. Update hostname file sudo vim /etc/hostname # Replace old name with new_name # 3. Update hosts file sudo vim /etc/hosts # Replace old name with new_name in the line: # 127.0.1.1 old_name # 4. Apply changes sudo reboot # 5. Verify changes hostnamectl Package Management APT Commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Update package list and upgrade system sudo apt update sudo apt upgrade # Install packages sudo apt install package_name # Remove packages sudo apt remove package_name sudo apt purge package_name # Remove package and config sudo apt autoremove # Remove unused dependencies # Search packages apt search package_name apt show package_name # List installed packages apt list --installed dpkg -l | grep package_name Java Installation and Management 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 # Install Java sudo apt install openjdk-17-jdk-headless sudo apt install openjdk-11-jdk-headless # Alternative version # List installed Java versions sudo update-alternatives --list java # Configure default Java version sudo update-alternatives --config java sudo update-alternatives --config javac # Remove Java sudo apt purge openjdk-* sudo apt autoremove # Check Java version java -version javac -version User Management 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Create new user sudo adduser username # Add user to sudo group sudo usermod -aG sudo username # Switch user su - username # Change password sudo passwd username # Delete user sudo userdel -r username # -r removes home directory Network Configuration 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # Show network interfaces ip addr ifconfig # Configure network interface sudo vim /etc/netplan/01-netcfg.yaml # Apply network changes sudo netplan apply # Show network status networkctl status # Configure firewall sudo ufw status sudo ufw enable sudo ufw allow 22/tcp # Allow SSH Service Management 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # View service status systemctl status service_name # Start/Stop services sudo systemctl start service_name sudo systemctl stop service_name # Enable/Disable service at boot sudo systemctl enable service_name sudo systemctl disable service_name # Restart service sudo systemctl restart service_name # View service logs journalctl -u service_name System Monitoring 1 2 3 4 5 6 7 8 9 10 11 12 13 # System resources top htop free -h df -h # System logs tail -f /var/log/syslog journalctl -f # Process monitoring ps aux | grep process_name pgrep process_name Storage Management 1 2 3 4 5 6 7 8 9 10 11 12 13 # List block devices lsblk fdisk -l # Mount device sudo mount /dev/sda1 /mnt/mydrive # Auto-mount (edit fstab) sudo vim /etc/fstab # Check disk usage du -sh /path ncdu /path # Interactive disk usage System Updates 1 2 3 4 5 6 7 8 9 10 11 12 # Update package list sudo apt update # Upgrade packages sudo apt upgrade sudo apt dist-upgrade # Auto-remove unused packages sudo apt autoremove # Clean package cache sudo apt clean Security 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Update SSH configuration sudo vim /etc/ssh/sshd_config # View auth logs sudo tail -f /var/log/auth.log # Check listening ports sudo netstat -tulpn sudo ss -tulpn # Configure firewall rules sudo ufw status sudo ufw allow from 192.168.1.0/24 sudo ufw deny 23 Performance Tuning 1 2 3 4 5 6 7 8 9 10 11 12 13 # View system limits ulimit -a # Modify system limits sudo vim /etc/security/limits.conf # View running processes ps aux --sort=-%cpu # Sort by CPU usage ps aux --sort=-%mem # Sort by memory usage # Monitor I/O operations iostat iotop Backup and Recovery 1 2 3 4 5 6 7 8 9 10 11 # Create backup sudo tar -czf backup.tar.gz /path/to/backup # Restore from backup sudo tar -xzf backup.tar.gz -C /path/to/restore # Create system snapshot (if using LVM) sudo lvcreate -L10G -s -n snap01 /dev/vg0/root # Rsync backup rsync -av --progress /source /destination Troubleshooting 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Check system logs journalctl -xe tail -f /var/log/syslog # Check disk errors sudo fsck /dev/sda1 # Memory issues free -h vmstat 1 # CPU issues top mpstat 1 # Network issues ping google.com traceroute google.com mtr google.com

 · 779 words

Terraform Infrastructure as Code Cheatsheet

Basic Terraform Commands Initialization and Setup 1 2 3 4 5 6 7 8 # Initialize Terraform working directory terraform init # Initialize and upgrade modules terraform init -upgrade # Initialize with specific backend terraform init -backend-config="config.hcl" Planning and Applying 1 2 3 4 5 6 7 8 9 10 11 # Show execution plan terraform plan # Apply changes terraform apply terraform apply -auto-approve # Skip approval prompt # Destroy resources terraform destroy terraform destroy -target aws_instance.web # Destroy specific resource terraform destroy -auto-approve Workspace Management 1 2 3 4 5 6 7 8 9 10 11 # List workspaces terraform workspace list # Create workspace terraform workspace new dev # Switch workspace terraform workspace select prod # Delete workspace terraform workspace delete dev State Management State Commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # Show current state terraform show # List resources in state terraform state list # Move resource within state terraform state mv aws_instance.old aws_instance.new # Remove resource from state terraform state rm aws_instance.web # Pull remote state terraform state pull # Push state to remote terraform state push Variable Management Variable Definition 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # variables.tf variable "instance_type" { type = string default = "t2.micro" description = "EC2 instance type" } variable "environment" { type = string validation { condition = contains(["dev", "staging", "prod"], var.environment) error_message = "Environment must be dev, staging, or prod." } } Variable Assignment 1 2 3 4 5 6 7 8 9 10 11 # Command line variables terraform plan -var="instance_type=t3.micro" terraform apply -var="environment=dev" # From file terraform plan -var-file=custom.tfvars terraform apply -var-file=prod.tfvars # Environment variables export TF_VAR_instance_type=t2.micro # Linux/macOS setx TF_VAR_instance_type t2.micro # Windows Code Quality and Formatting 1 2 3 4 5 6 7 8 9 10 11 # Format code terraform fmt # Validate configuration terraform validate # Show providers terraform providers # Clean up terraform init -reconfigure Module Usage Basic Module Structure 1 2 3 4 5 6 7 8 # modules/vpc/main.tf module "vpc" { source = "./modules/vpc" vpc_cidr = var.vpc_cidr subnet_cidrs = var.subnet_cidrs vpc_name = var.vpc_name } Module Versioning 1 2 3 4 5 6 module "s3_bucket" { source = "terraform-aws-modules/s3-bucket/aws" version = "3.7.0" bucket_name = "my-bucket" } Best Practices State Management ...

 · 671 words

Git and GitHub CLI Cheatsheet

GitHub CLI Setup Install GitHub CLI (gh) 1 2 3 4 5 6 7 8 # Ubuntu/Debian sudo snap install gh # macOS brew install gh # Windows winget install GitHub.cli GitHub CLI Authentication 1 2 3 4 5 # Login to GitHub gh auth login # View authentication status gh auth status Git Configuration User Configuration 1 2 3 4 5 6 7 8 9 10 # Set username and email for local repository git config user.name "Your Name" git config user.email "your.email@example.com" # Set global username and email git config --global user.name "Your Name" git config --global user.email "your.email@example.com" # View current configuration git config --list Credential Management 1 2 3 4 5 6 7 8 9 # Disable git credential prompt export GIT_TERMINAL_PROMPT=0 # Linux/macOS set GIT_TERMINAL_PROMPT=0 # Windows # Store credentials (cached) git config --global credential.helper cache # Store credentials (permanent) git config --global credential.helper store Basic Git Commands Repository Operations 1 2 3 4 5 6 7 8 9 10 11 # Initialize new repository git init # Clone repository git clone <repository-url> # Add remote repository git remote add origin <repository-url> # View remote repositories git remote -v Daily Workflow Commands 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Check status git status # Add files git add <file> # Add specific file git add . # Add all changes # Commit changes git commit -m "message" # Commit with message git commit -am "message" # Add and commit tracked files # Push and Pull git push origin <branch> git pull origin <branch> Branch Management 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 # List branches git branch # Local branches git branch -r # Remote branches git branch -a # All branches # Create branch git branch <branch-name> git checkout -b <branch-name> # Create and switch # Switch branches git checkout <branch-name> git switch <branch-name> # Git 2.23+ # Delete branch git branch -d <branch-name> # Local git push origin --delete <branch-name> # Remote History and Differences 1 2 3 4 5 6 7 8 9 # View history git log git log --oneline # Compact view git log --graph # Graphical view # View changes git diff # Working directory vs staging git diff --staged # Staging vs last commit git diff <commit1> <commit2> # Between commits Undo Operations 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # Discard changes in working directory git restore <file> git checkout -- <file> # Old syntax # Unstage files git restore --staged <file> git reset HEAD <file> # Old syntax # Modify last commit git commit --amend # Reset to specific commit git reset --soft HEAD~1 # Keep changes staged git reset --hard HEAD~1 # Discard changes Stash Operations 1 2 3 4 5 6 7 8 9 10 11 12 13 # Save changes temporarily git stash # List stashes git stash list # Apply stashed changes git stash apply # Keep stash git stash pop # Remove stash after applying # Remove stash git stash drop # Remove latest stash git stash clear # Remove all stashes Advanced Git Operations Merging and Rebasing 1 2 3 4 5 6 7 8 # Merge branch git merge <branch-name> # Rebase branch git rebase <branch-name> # Interactive rebase git rebase -i HEAD~3 # Rebase last 3 commits Tags 1 2 3 4 5 6 7 8 9 10 # Create tag git tag <tag-name> git tag -a <tag-name> -m "message" # Annotated tag # List tags git tag # Push tags git push origin <tag-name> git push origin --tags # Push all tags Submodules 1 2 3 4 5 6 7 8 9 # Add submodule git submodule add <repository-url> # Initialize submodules git submodule init git submodule update # Update all submodules git submodule update --remote Git Best Practices Write clear, descriptive commit messages Commit early and often Use branches for new features Keep your repository clean Don’t commit sensitive information Regularly pull changes from upstream Review changes before committing

 · 687 words

Google Cloud Platform

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 gcloud compute instances create my-first-instance gcloud compute instances list gcloud config list gcloud config configurations list gcloud compute instance-templates create test-templates --image=ubuntu-22.04 gcloud config set project kubernetes-406008 gcloud container clusters list gcloud container clusters create mygkecluster --num-nodes 2 --machine-type e2-micro gcloud components install gke-gcloud-auth-plugin kubectl create deployment hello-world-rest-api --image=in28min/hello-world-rest-api:0.0.1.REASE --dry-run=client -o yaml> mydeployment.yaml #Création d'un bucket gsutil mb gs://nom_de_bucket

 · 76 words