You can generate different SSH keys for different Bitbucket accounts, for example, and configure them in ~/.ssh/config to use one or the other based on hostnames.

This config file will point a custom hostname to bitbucket.org (continuing the example), but specify a key different from the default.

Read more

Add these lines to the top of a Makefile to load environment variables from a file. The minus sign lets it fail silently if the file doesn't exist:

-include .env
export
Read more

In Linux, you can make IPv4 traffic have a higher priority than IPv6 by running the following command:

sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"

Read more

If you run out of memory in Linux, you can create a file to hold additional memory using these commands:

/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
/sbin/swapon /var/swap.1
Read more

In Ubuntu (and probably other OSes) you can create an empty file, resize it to a couple GBs, create a filesystem on it, and then mount it at any location. You can treat this as a virtual drive to, for example, limit the size of a directory:

Read more
Subscribe to linux
Mastodon Mastodon