CRLF vs LF

CRLF vs LF

When working in software development, one of the most subtle yet crucial aspects you need to be aware of is the difference between line endings in text files between Windows (CRLF \r\n) and Linux/MacOS (LF \n). This small detail can cause big problems if not handled correctly, especially when working in mixed environments – version control conflicts, script incompatibilities, compilation or execution issues. I wrote this post to have a handy reference for dealing with this topic, including a few tricks. …

September 28, 2024 · 3 min
Git Multi-Account

Git Multi-Account

This post will walk you through the process of setting up and using multiple accounts with one or more Git providers (GitHub, GitLab, Gitea). I describe the two options I recommend: HTTPS + Git Credential Manager and SSH multi-account. The first, HTTPS + Git Credential Manager, is the one I use most, because it’s compatible with CLI and/or GUI tools like Visual Studio, VSCode, Git Desktop, Gitkraken, etc. The second option, SSH multi-account, I delegate to “headless” machines, servers I connect to remotely via CLI or VSCode remote that need to clone repositories and work on them. …

September 21, 2024 · 12 min
Socketed SSH

Socketed SSH

Systemd is a system used in Linux to manage boot and system processes. Its “units” are configuration files that describe the processes and services that systemd manages. One of these units is systemd.socket, which starts the corresponding daemon when a connection is established through a socket with the machine. A socket is a form of communication between processes over a network or within the system. By creating a unit of this type, we ask it to listen on a specific socket and start a specific service when a connection is received. …

April 14, 2023 · 2 min
Git Cheat Sheet

Git Cheat Sheet

This post contains my GIT cheat sheet, various reminders I use as a programmer — common commands or situations. It comes in handy for example when I accidentally delete a file and want to recover it, check a previous version of code, or ignore a modification in a specific file. …

October 10, 2021 · 18 min
SSH and X11 as root

SSH and X11 as root

The goal is to make X11 (X-Window) applications work “also” from root. Making them work from a regular user is straightforward, but then switching to root with su/sudo and having X11 work is not allowed in Linux. The X11 connection only belongs to the user you logged in with via SSH. …

February 11, 2017 · 7 min
SSH on Linux

SSH on Linux

The SSH service is the first thing you should configure on a Linux system. With OpenSSH you get a set of tools – including ssh, sshd, scp, etc. – that allow you to enable secure remote shell access to your machine. If you come from the “telnet” era, you should forget about it; its replacement today is SSH. …

February 1, 2009 · 2 min