Featured post

About this blog

tuxThis blog was created with the idea of collecting and linking information about Linux, Git, how to set things up, how to tweak the system here and there, in different architectures, in different distributions and different releases.

All the information presented here is available to public knowledge and can be found with one, two, or a few more Google searches if you persist. All of them were used at least once on productive activities.

Please share your experience and share your comments.

Advertisements

I found two ways to configure the /etc/resolv.conf file to prevent it to be overridden by the system.

  1. Edit the base file under the resolv.conf.d file
sudo vim /etc/resolvconf/resolv.conf.d/base

and then add the nameservers to the file:

nameserver 8.8.8.8
nameserver 8.8.4.4

lastly, update resolvconf:

sudo resolvconf -u

2. Install dnsmasq and edit /etc/dnsmasq.conf to add the nameservers you want.

sudo apt install dnsmasq
and
vim /etc/dnsmasq.conf

Then restart the network services:

sudo service dnsmasq restart and
sudo service network-manager restart

You should be all set now.

References:
1. https://unix.stackexchange.com/questions/128220/how-do-i-set-my-dns-when-resolv-conf-is-being-overwritten

2. https://unix.stackexchange.com/questions/128220/how-do-i-set-my-dns-when-resolv-conf-is-being-overwritten/163506#163506

Cheers!

Static IP config with netplan (ubuntu)

If you use a modern Ubuntu distribution (the latest 18.04 LTS or 17.XX), you might have noticed that the package to configure the network changed.

Ubuntu changed to Netplan, that is more modern and relatively simpler to use. The file configuration for a static IP should be as follows.

# cat /etc/netplan/01-netcfg.yaml
network:
 version: 2
 renderer: networkd
 ethernets:
 eth0:
 dhcp4: no
 addresses: [YOUR.STATIC.IP.ADDRESS/24]
 gateway4: X.X.X.X
 nameservers:
 addresses: [YY.YY.YY.YY, 8.8.8.8]

Reference: I extracted the following information from  https://ppc64el.wordpress.com/2018/03/22/ubuntu-18-04-netplan/

Please visit the link above for more information (including the original /etc/network/interfaces format of the eth0 interface before the transition to netplan).

Cheers!

Install Silversearcher-ag on Ubuntu

The Silversearcher tool is a super fast search tool that gives you rich information when searching for a string through all your files.

To install it:

sudo apt install silversearcher-ag

The Github project page:

https://github.com/ggreer/the_silver_searcher

You can find answers about why it is so fast, a chance to collaborate and other info there.

Cheers!

Git: Add ‘Signed-Off-By’ From Command Line

In order to append a Signed-off-by line with the author’s information.

In order to automatically append this line to the commit, append a ‘-s’ switch to the git commit command:

$ git commit -s

Just be sure your name and email are correct in the appended line, and you are done!

NOTE: In case your information is not correct, issue:

$ git config --global user.name "Your Name"
$ git config --global user.email "your.email@company.com"

Cheers!

Git: basic tag commands

To get the repository’s tags issue:

$ git fetch --tags [branch_name]

To add a tag to the top commit:

$ git tag -a

Note: this will open an editor screen where you can insert a description message (similar to a commit)

To add a tag to a specific commit:

$ git tag -a [tag_name] [commit_hash]

To push a tag to remote:

$ git push [repo_name] --tags  # for all tags
$ git push [repo_name] [tag_name] # for a single tag named 'tag_name'

To merge a tagged commit:

$ git merge [tag_name]

See also: how to see the information of the repo’s branches from the CLI, including your tags in this post

Cheers!