The “whois” command is very well-known in programming circles. The website whois.com is pretty well-known, even though it’s not accredited with ICANN. Using whois, you can find out everything you need to know about a domain – who owns it, when it expires, its status, nameservers, and even the contact information of the owners. In […]
Resolving the “Fatal: Refusing to Merge Unrelated Histories” Error
In git, the “fatal: refusing to merge unrelated histories” error occurs when you merge two branches with no common ancestor and git doesn’t know where to begin the merge. This error doesn’t occur in the normal git workflow, but it can happen when you try to combine two unrelated git projects into a single one, […]
How to Use Dig to Specify a DNS Server
Dig is a Linux tool standing for “Domain Information Groper” (yeah, it’s weird, but it is what it is). It’s used to get DNS information for a particular domain. Other tools do this, most notably “ping”, but dig allows users to go a step further and query specific DNS servers. This is useful for debugging, […]
How to Use Bash Function Arguments
We’ve seen how bash shell scripts work in Linux, and allow you to automate complex actions. Bash functions are essential to shell scripts – they help keep code clean and modular. While bash isn’t a traditional programming language, there are many similarities, even though it doesn’t have some more advanced functionality than modern programming languages, […]
How to Use the “docker volume create” Command
We’ve seen the usefulness of docker, and how we can use it to run applications normally requiring huge amounts of configuration such as web servers and databases. This seems like the perfect solution for complex packages that require expert maintenance and setup. And it is! There’s a reason why docker is widely used and loved. […]
How to Manager Docker Memory Limits
Using docker can become addictive. Once you see how easy it is to download and start a container running an application that normally requires heavy configuration – like a web server, for example – you start to think of everything in terms of docker containers. But with this comes risks. Docker containers can grow in […]
Should You SSH Into a Docker Container?
In the article on how to fix the Docker “permission denied” error, we saw that we can use docker to easily set up pre-configured instances of applications so that we don’t have to know too much about setting it up and running it ourselves. Long-running applications like database servers and web servers that require complex […]
How to Append to a File in Bash
From the point of view of someone who’s not very experienced with Linux, it can seem to be a very niche scenario where you’d want to append something to a file. But as soon as you begin managing a server, you’ll see we have many reasons to add content to a file. As a result, […]
How to Use Bash Functions
A bash function is a way to encapsulate some functionality that you foresee yourself reusing repeatedly. Last week, I wrote about using a bash alias for complex commands, and we saw that functions could be used similarly for commands that require dynamic arguments instead of static ones. But we can use functions for a lot […]
How to Use a Bash Alias in Linux
When you first start using Linux, you’ll need only a handful of commands. As you gain experience, you learn more of them, but the complexity of the commands increases. Commands like awk, df, git, etc., all have a huge range of options and endless combinations of them. Every Linux system administrator and every server has […]
