Saturday, January 23, 2016

Upgrading from Fedora 22 to Fedora 23

I got a new laptop today and was trying to install Fedora 23 on it. However, I wasn't able to get to Fedora 23 and had to install Fedora 22 and upgrade to Fedora 23. I found the instructions online and proceeded.

Upgrading from Fedora 22 to Fedora 23

Monday, November 30, 2015

Renew or release DHCP IP address

Recently I had an issue with the network on one of my test machines. After some debugging and some help, we figured out that the DHCP IP address needed to be released and renewed. 

I ran the following command:
sudo dhclient eth0

Wednesday, October 21, 2015

Search for results excluding a word

To search for something excluding a certain word or phrase, use
grep -v "word" <file or location>
For example, the results of a grep search can include a lot of results which are not relevant. Eliminate those by using grep -v

 grep "blah" filename | grep -v "foo"

This will get you results with "blah" but nothing with "blah" and "foo" in them. 
 
 

Wednesday, August 12, 2015

Get public IP address of your computer

Open up the Terminal Application and run the command below to get the public IP address of your computer
dig +short myip.opendns.com @resolver1.opendns.com

Reference:
How to find my public IP address from command line on linux

Monday, August 3, 2015

Getting backtrace from qemu-kvm crash

When I'm running automated tests, qemu-kvm sometimes crashes and this needs to be debugged ASAP. To file a bug, I need a backtrace. As part of the test, the core which is dumped is saved.


  1. SSH into the machine where qemu-kvm crashed
  2. debuginfo-install qemu-kvm => This should install a bunch of packages to get a lot of symbol info. 
  3. gdb /usr/libexec/qemu-kvm <path to core file>
  4. Pass "thread apply all bt" to get the backtrace at the gdb prompt

Thursday, July 30, 2015

./configure options

When building packages, often we need to run ./configure with a bunch of options to build the package. To find out what the last options were used for configure, use this command:
./config.status --config

How to remember ./configure script arguments a year later

Monday, July 13, 2015

Execute a command, display output and get it's return code in Python

Often in my tests, I need to display the output and use the return code of the command I want to run. But I can't use check_output because my tests need to support RHEL6 and RHEL7 and RHEL6 is still on python 2.6.x and check_output is only available in Python 2.7

The following code snippet is modified from another website:

from subprocess import Popen, PIPE
 
cmd = "blah blah"
process = Popen(cmd.split(), stdout=PIPE)
process.communicate()    # execute it, the output goes to the stdout
exit_code = process.wait() # when finished, get the exit code