Posts

Showing posts with the label trouble shooting

Recursive rename in python script

#!/usr/bin/env python import fnmatch import os root = os.getcwd() pattern = "*.JPG" for root, dirs, files in os.walk(root):     for filename in fnmatch.filter(files, pattern):         #print (os.path.join(root, filename))         full_src = os.path.join(root, filename)         full_dst = full_src.replace('.JPG','.jpg')         os.rename(full_src, full_dst)         print "Renaming {0} to {1}".format(full_src, full_dst)

Some trouble shooting that I just found and use :) #1

KVM machine in my office turn on with its kvm's instances. But some of them don't got an IP, even network interface card. So here is what i have found. $ sudo ifconfig eth0 up   # to bring up eth0 $ sudo dhclient -r   # release ip  $ sudo dhclient   # obtain ip ref cyberbiz website