Device eth0 is not present after cloning RHEL/CentOS in VMWare

#ifup eth0
Device eth0 does not seem to be present, delaying initialisation

Easy fix:

Remove the networking interface rules file, it will be regenerated

# rm -f /etc/udev/rules.d/70-persistent-net.rules

Update your interface configuration file

# vim /etc/sysconfig/networking/devices/ifcfg-eth0

Remove the MACADDR and  the UUID entries

Save and exit the file

Restart the networking service

# service network restart
Advertisements

Use dstat on command line for quick system resource stat collection


 dstat -tv --output /tmp/${HOSTNAME}-dstat-$(date +"%Y%m%d-%H%M%S").csv 10

Starts a dstat process at 10 second intervals and writes output to /tmp called <hostname>-dstat-yyyymmdd-hhmmss.csv &

Kill it with

kill `ps -ef | grep dstat | grep -v grep | awk '{print $2}'`

This csv file is easy to open in a Excel to chart performance metrics.  Consider adding to a script for automation.


Use SCP to copy directories in Linux

scp -r <source_directory> username@ip:destination_directory

it’s that easy


Oracle (Sun) Java on CentOS 6

Sometimes OpenJDK won’t cut it.

Download JDK or JRE binaries

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Get the RPM files from above onto your Linux box.

Install JDK or JRE

rpm -ivh <JDK or JRE rpm file>

Verify proper install

If you get something like this, everything installed properly:

[user@server]# java -version
java version “1.7.0_51”
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
[user@server]# javac -version
javac 1.7.0_51


Windows 7 keyboard shortcuts

I’m most definitely late to the party on this, but I finally found the keyboard shortcuts that I should have known over 2 years ago.

If you are like me and use multiple monitors with Windows 7 and don’t know about these shortcuts, you are probably fighting with window sizing and just how to fit multiple windows on your screen in a useful fashion.

All I wanted to do was to quickly snap 2 maximized Windows on one of my 24 inch monitors so they each take up half the screen. Every time I tried I would end up with one window on the right side of the right monitor and the other window on the left side of the left monitor. Not optimal.

Well, now that frustration is gone. Lifehacker.com to the rescue once again!

Below is a summary of the most useful shortcuts and a link to the lifehacker article for more.

Rest easy frustrated dual monitorians.

  • Win+Home: Clear all but the active window.
  • Win+Space: All windows become transparent so you can see through to the desktop.
  • Win+Up arrow: Maximize the active window.
  • Shift+Win+Up arrow: Maximize the active window vertically.
  • Win+Down arrow: Minimize the window/Restore the window if it’s maximized.  This one is the winner for me!
  • Win+Left/Right arrows: Dock the window to each side of the monitor.
  • Shift+Win+Left/Right arrows: Move the window to the monitor on the left or right.
  • Ctrl+Shift+N: Creates a new folder in Windows Explorer.
  • Win+L: Lock your workstation  Also, super helpful
  • Win+E: Open Computer
  • Win+R: Run dialog

For the entire list of shortcuts and more, check out

http://lifehacker.com/5390086/the-master-list-of-new-windows-7-shortcuts


Disable password expiration in Windows 2012

I have Windows 2012 running in a lab environment and have recently been greeted with password expiring messages.  There’s a pretty straight forward and quick fix to silence those pesky messages.

This is not a recommended change for a production server, but helpful to know in a testing or lab environment.

  • Start typing local security policy in the Search dialog box and select the result.
  • Navigate to Account PoliciesPassword Policy
  • Change Maximum password age to zero (0) to disable

A setting of zero (0) specifies that passwords will never expire.  You can set any value from 0 to 998.


Enable Remote Desktop in Windows 2012

Windows 2012 has remote desktop disabled by default. Enabling it is easy and only takes a minute.

  • Press WindowKey + Q to bring up the global search field.
  • You can also move your mouse to the upper right or lower right portion of the screen to bring up the Charms Bar and then select the Search icon.
  • Enter CMD in the search field and press Enter
  • In command prompt window, type SystemPropertiesRemote and hit Enter
    • The System Properties window will be presented
  • Select Allow remote connections to this computer , click Apply and OK

An entry will then be automatically added in the Windows Firewall for RDP

Verify your ability to RDP into this machine remotely.  If you still can’t RDP into the machine, try disabling your Windows Firewall on the remote machine and see if that changes things.  Troubleshoot accordingly if it doesn’t resolve your issue.