Sometimes when I’m working with files in Git, I find myself with a change in a file that says “No newline at end of file”. This occurs when my editor adds the missing newline at the end of the file. While you should have a newline at the end of the file, you may have a reason for not wanting to add this change. In that case, you can remove the newline from the end of the file.
A lot of the posts I write include command-line interface (CLI) commands to type in. I’ve found over time there are things I can do to improve how these commands are communicated.
One of the things that made me much better at Git was making my current branch (and whether or not I have any changed files) always visible. By default zsh includes everything you need to do this, you just need to configure it.
While there are many ways to customization your command line prompt, one that can help readability is adding a blank line at the beginning of each prompt.
Curl is a fantastic tool for making web requests from the command line. As a developer, I find this tool particularly useful. Retrieve Content at a URL curl https://salferrarello.com/ Making a HEAD Call Sometimes, we want to see the Header Values returned from a URL using the HEAD. The HTTP HEAD method requests the headers […]
When working with Git on the command line, I spend a lot of time switching back and forth between two branches. Even with Git tab completion, it is a lot of typing. However Git has a shortcut for the previous branch, a single dash (-).
When creating 301 redirects, I often want to check multiple URLs quickly from the command line (to avoid the manual clicking in the browser and browser caching of results). I’ve written this script to speed up my process.
When faced with a folder full of gzipped files, I found I was unable to use my usual go to program grep to search for text in the files. However, zgrep came to my rescue.
You can look up the name servers associated with a domain name using either “whois” or “dig NS”. In some rare occasions, I have gotten back two different answers using these two techniques. In my experience, “dig NS” is the more trustworthy of the two.
Using SSH keys allows greater security than a password when remoting into a machine, using SFTP, or WP CLI on a remote machine – however, they do require more work to setup. For security reasons, I generate a new key pair for each site I work on. To generate a new key pair I do the following.