Show Local IP

2023-12-23 1 min read Linux Networking
Show local IP You can see the local IP of the machine with the command - ip a. However if you have to use the address in some variable in a scrit. It becomes little tricky, something like Show the interfaces in one line with ‘-o’ Show only IPv4 address’s with ‘-4’ and the command looks like 1 ip -4 -o a show dev eth0|awk '{gsub(/\/.*/,"",$4);print $4}' Replace eth0 with then correct interface name. Continue reading

Openvpn files to nmcli connection

2022-11-12 1 min read Linux Networking
Openvpn files to nmcli connection Many times you get openvpn file and when you want to connect to the VPN server, you have to start the vpn client from the cli. How you wish that this was added to NetworkManager so that you could connect to it with one click. If this is the case, then you can use these commands to do the same ane enjoy :) 1 2 nmcli connection import type openvpn file test. Continue reading

GREP_COLORS – change the colors in the GREP output.

2019-04-22 4 min read bash Linux
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options mean. Here is the excerpt from the man command: GREP_COLORS Specifies the colors and other attributes used to highlight various parts of the output. Its value is a colon-separated list of capabilities that defaults to ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv and ne boolean capabilities omitted (i. Continue reading

copy /proc folder

2019-03-18 1 min read bash Learning Linux
Other day, I was trying to copy the proc folder with following command: tar cvzf /tmp/proc.tgz /proc and I found out that all the files in tar were empty. Strange it may seem but lot of people are facing this as /proc is not a regular filesystem, so I wrote a quick script to copy the proc folder. Here is the script: cd / mkdir /tmp/proc [[ -z $1 ]] && exit -1 find /proc/$1/ -not -name pagemap | while read F ; do D=/tmp/$F if [[ -d $F ]] then echo " Continue reading

Get to your ebooks quickly

2018-11-12 2 min read Linux Uncategorized
So this is going to be a little longer post than usual. To begin with, here is screenshot of how it would look like finally: We are using β€œrofi” here to show the menu. So, lets first install that cat <<EOF >/etc/yum.repos.d/_copr_yaroslav-i3desktop.repo [yaroslav-i3desktop] name=Copr repo for i3desktop owned by yaroslav baseurl=https://copr-be.cloud.fedoraproject.org/results/yaroslav/i3desktop/fedora-$releasever-$basearch/ type=rpm-md skip_if_unavailable=True gpgcheck=1 gpgkey=https://copr-be.cloud.fedoraproject.org/results/yaroslav/i3desktop/pubkey.gpg repo_gpgcheck=0 enabled=1 EOF yum install rofi Once that is done, we will create a small script to look for all our pdf files and display that in the menu, like above. Continue reading

systemctl enable and start service

2018-09-10 1 min read Fedora
Most of the times when I want to enable the service, I find myself enabling it immediately or it is vice versa. So, the commands I used to use were: systemctl enable sshd.service systemctl start sshd.service But recently I learned that I do not need the 2 commands and this can be done in single command like below 1 <td> <div class="text codecolorer"> &nbsp; </div> </td> </tr> systemctl enable --now sshd. Continue reading
Older posts