Linux Archive

Temporary failure resolving – sudo apt-get update in ubuntu

If you are trying to update ubuntu respository and getting error: W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg  Temporary failure resolving ‘us.archive.ubuntu.com’ just check the DNS. Set the Google DNS (8.8.8.8) in /etc/resolvconf/resolv.conf.d/base echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null then sudo service resolvconf restart After this procedure, I was able to resolve hostnames and sudo

Bash script to get average time from logs

What if we have logs of a server like apache or syslog server and we want to get average time from timestamps of all rows. How can we do it? Basically, we need to filter timestamp (column-8) from each row and just find its average. Below is the screenshot of the problem. (click on the

Kill multiple pid with same process

Sometime back I caught up in a situation where I need to kill multiple pid invoked from same process. So, all process have same name Assume, process invoked for “vim” editor. If I have 20 “vim” process running and I want to kill all of them, what’s the best way to do it? #There are multiple ways: