Huge Discounts on Mobiles, Books, Cameras, Computers etc: @Flipkart

Tuesday, July 01, 2014

How to find Serial Number?

Wonder how you can find a machine's serial number via a simple command? Especially helpful if you want to use it in a script or want to find the serial number of a remote machine. Or may be you just don't want to get under the desk to find it from behind the machine! It is as simple as this:

wmic bios get serialnumber

dmidecode -t system | grep Serial

Note: The above command should be run from a shell. Eg: Type cmd in Run ( Win+R) for Windows.

Saturday, May 31, 2014

How to denote that your link opens in a new Window?

I like to know whether a link would open in a new window or not, before I click a link. I think it is a good practice (especially for accessibility) and I think all browsers should do it automatically. Though the recommended practice is not to open links in another window (as it breaks back button navigation), we may have to do it some times, especially when we link to external websites. Here is a really neat way to do it, without any code changes, just via CSS (easy to remove if you change mind later).

a[target]::after {
    margin-left: 5px;
    content: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODI2LjQyOSAtNjk4Ljc5MSkiPjxyZWN0IHdpZHRoPSI1Ljk4MiIgaGVpZ2h0PSI1Ljk4MiIgeD0iODI2LjkyOSIgeT0iNzAyLjMwOSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDZjIi8+PGc+PHBhdGggZD0iTTgzMS4xOTQgNjk4Ljc5MWg1LjIzNHY1LjM5MWwtMS41NzEgMS41NDUtMS4zMS0xLjMxLTIuNzI1IDIuNzI1LTIuNjg5LTIuNjg5IDIuODA4LTIuODA4LTEuMzExLTEuMzExeiIgZmlsbD0iIzA2ZiIvPjxwYXRoIGQ9Ik04MzUuNDI0IDY5OS43OTVsLjAyMiA0Ljg4NS0xLjgxNy0xLjgxNy0yLjg4MSAyLjg4MS0xLjIyOC0xLjIyOCAyLjg4MS0yLjg4MS0xLjg1MS0xLjg1MXoiIGZpbGw9IiNmZmYiLz48L2c+PC9nPjwvc3ZnPg==);

<a href="">Open in this window </a>
<a href="" target="_blank">Open in another window </a>

This is how it would look. Notice the icon towards the end of the second link. Many well known websites (eg: Wikipedia) do this.

Wednesday, April 16, 2014

How to add a custom system property to WAS (WebSphere Application Server) 7

Struggling to add a custom environment property to WAS? Tried editing startServer/setupCmdLine batch/script files and failed? Here is how you can do it easily from the Admin Web Console

Go to admin console:
eg: https://localhost:16316/ibm/console

In the admin console:
Application servers -> (server name) -> Server Infrastructure, Java and Process Management, Process Definition -> Java Virtual Machine -> Custom Properties.

Note: The exact sequence may vary depending on what version of Websphere you are using.

The entries you make here are system properties (not environment variables and not WebSphere variables). They can be accessed via System.getProperty().

More Info:

YUM: Error: Cannot retrieve repository metadata (repomd.xml) for repository

Screwed up your yum? Here is a quick way to fix by cleaning it up:

View repolist:
yum repolist all

Clean cached package downloads/headers:
yum clean all

Disable a repo temporarily:
yum --disablerepo epel install htop

Disable a repo permanently:
Remove or comment it out in: /etc/yum.repos.d/

More info:

Task Manager for Linux

New to Linux and missing a graphical task manager like the one in Windows?

Try Htop (Linux Process Monitoring)

Htop is an interactive and real time process monitoring application for Linux. It shows complete list of processes running and easy to use for normal tasks.

For RHEL, CentOS & Fedora 64-bit OS
## For RHEL 5, CentOS 5 & Fedora ##
# wget
# rpm -ihv rpmforge-release*.rf.x86_64.rpm

## For RHEL 6 and CentOS 6
# wget
# rpm -ihv rpmforge-release*.rf.x86_64.rpm

Note: update above command to use the latest version of RPMforge.

Once RPMforge repository is installed. Now start installation with yum command.
# yum install htop

For more info, visit:

You can always see running processing in the console using the following command:
ps aux | less

The pstree command is similar to ps in that it can be used to show all of the processes on the system along with their PIDs. However, it differs in that it presents output in a tree structure that shows how processes are related to each other and in that it provides less detailed information about each process than does ps