Category: Linux

Print thread dump for a single thread

We had an issue where a single thread was using all the CPU. We wanted to check it at the command line while troubleshooting. We used what is below… [atg@CMHLDECOMAP01 ~]$ jstack 3000 | awk ‘{if ($1 == “\”Thread-9\””) {i…

Open ports by interface

I often use what is below to get a listing of currently open ports by interface. If you find you can’t “see” a port from another computer, and… it is open on the IP to which you are trying to…

Comparing RPM’s between servers

Periodically, I will want to compare the RPM installations between two or more servers. Sometimes, I may not care about the specific versions of each RPM, but only that *some* version exists. To do this, I can use awk and…

Converting ASCII to binary

This is pretty useless, but I know some people like this kind of thing 🙂 10:11:42 oracle@emgrid01 ~ >echo “if you can read this you are a geek” | xxd -b | awk ‘{printf(“%s %s %s %s %s %s “,$2,$3,$4,$5,$6,$7)}…

Creative ways to do simple things

I always like exercises such as this, especially for interview questions. In an interview, I am never looking for the correct answer as often as I am how the question is answered, and how creative the person is. For example,…