Check Last Logins in Linux

Today I learned about last, lastb and lastlog which are cli utilities to check last login information. last: Shows a listing of last logged in users lastb: Shows last login tries lastlog: Reports the most recent login of all users or of a given user ...

October 3, 2023 · 1 min · Iduoad

Pip install packages from git

Today I learned that pip can install dependancies from git repositories, local directories and weels. Source...

October 3, 2023 · 1 min · Iduoad

nsswitch.conf Syntax

Today I learned about the nsswitch config file. The /etc/nsswitch.conf file is used to configure which services are to be used to determine information such as hostnames, password files, and group files. An example of the /etc/nsswitch.conf # Name Service Switch configuration file. # See nsswitch.conf(5) for details. passwd: files systemd group: files [SUCCESS=merge] systemd shadow: files systemd gshadow: files systemd publickey: files hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns networks: files protocols: files services: files ethers: files rpc: files netgroup: files The syntax is the following:...

October 2, 2023 · 2 min · Iduoad

Zsh Profiling

Today I learned how to profile Zsh in case of performance issues. To do that we should surround the content of .zshrc with the following: zmodload zsh/zprof # Content of .zshrc zprof ...

May 23, 2023 · 1 min · Iduoad

Install packages from host machine with Buildah

Today I learned that I can use Buildah to mount a container image and install packages on top of it from the host. microcontainer=$(buildah from registry.access.redhat.com/ubi8/ubi-micro) micromount=$(buildah mount $microcontainer) yum install \ --installroot $micromount \ --releasever 8 \ --setopt install_weak_deps=false \ --nodocs -y httpd yum clean all \ --installroot $micromount buildah umount $microcontainer buildah commit $microcontainer ubi-micro-httpd Source...

March 30, 2022 · 1 min · Iduoad

Azure Repos SSH Authentication

Today I learned that to authenticate with ssh to Azure Repos, it is necessary to add PubkeyAcceptedAlgorithms +ssh-rsa and HostkeyAlgorithms +ssh-rsa to the host config. Host nwad HostName ssh.dev.azure.com IdentityFile ~/Work/Nimbleways/.ssh/id_rsa IdentitiesOnly yes PubkeyAcceptedAlgorithms +ssh-rsa HostkeyAlgorithms +ssh-rsa More...

March 28, 2022 · 1 min · Iduoad

Getting battery information with upower

Today I learned how to get battery information (including remaining time) using upower. upower -i /org/freedesktop/UPower/devices/battery_BAT0 Source...

February 28, 2022 · 1 min · Iduoad