Configs

Linux misc. Linux

Time-sync

In a dual-boot system, if your Windows and Linux systems show different times where only one of them is correct, run the below command to sync them. Refer this article and this post for more info

timedatectl set-local-rtc 1 --adjust-system-clock

Static IP reservation

Here’s how to reserve an IP address on your home router for your computer’s wired i.e. ethernet interface connection on your home network. (Similar steps would work for WiFi interface too)

DNS

I use Cloudflare DNS. Their IP addresses for their DNS as per their page are:

IPv4 IP6
1.1.1.1 2606:4700:4700::1111
1.0.0.1 2606:4700:4700::1001

You can set these on your computer and or on your router

View your set DNS settings: resolvectl status


Mounting Drive Partitions


Note that the TARGET can be a file or even a directory

# Creating a symbolic link (fails if symlink exists already)
ln -s TARGET LINKNAME

# Create/update a symbolic link
ln -sf TARGET LINKNAME

Brightness of External Monitor

Laptop has buttons to increase/decrease brightness but no such option for monitors. For that, we make use of the ddcutil command. It provides a set of VCP (Virtual Control Panel) codes to adjust values of various settings such as brightness contrast, display-mode etc

# See how your monitor details
ddcutil detect

# See available VCP control codes
ddcutil capabilities

# Get Brightness details (my VCP code for it was 10)
# It shows current value and range of valuees allowed too
ddcutil getvcp 10

# Set brightness to a certain value
ddcutil setvcp 10 33

# Relatively increment/decrement brightness
ddcutil setvcp 10 + 5
ddcutil setvcp 10 - 5

For convenience, you can add your brightness setup within your shell config file itself (~/.zshrc or ~/.bashrc)

alias get-brightness="ddcutil getvcp 10"
alias set-brightness="ddcutil setvcp 10"
alias bright++="ddcutil setvcp 10 + 5"
alias bright--="ddcutil setvcp 10 - 5"

# Set brightness to zero after 7PM
if [[ $(date +"%H") -ge 19 ]] then
  set-brightness 0
fi