Category: Linux

awk silliness

This one-liner will print every other character in upper case. oracle@emgrid01 ~ >echo “the quick brown fox jumped over the lazy dog” | awk -F “” ‘{for (i=1; i

instr() in awk

If you have a long command line string, as you may find with java processes with a lot of properties, what is below will allow you to print those “columns” with a certain value as delimited by a space in…

Who is the big load on my server?!

What is below will show SQL statements for a given window (the last four days in the example below) that are tightly correlated with load average on a server. In general, a statistical correlation greater than 60 means there is…

Using awk with group by functionality

You can use the following example if you need to total numbers over a group in a given file. We first show our sample file… 14:30:57 oracle@emgrid01 ~ >cat list.txt steve:61 steve:14 becky:57 steve:19 jenna:69 stephen:57 maddie:54 jenna:53 abby:41 jenna:21…

Huge pages

Huge Pages is a feature available in later Linux kernels that provides two important benefits: 1. Locks the memory available to huge pages, so it cannot be paged to disk 2. Make the TLB (translation lookaside buffer) much smaller on…

Where is my close button?!!

So I just updated to Ubuntu 10.4, and the first thing I noticed is the fact the close/minimize/maximize buttons were switched to the top left hand corner from the right corner. I have no clue why something as standard as…

logrotate configured by mere mortals

This will provide a way to implement log file rotations by a non-privileged users using the standard Linux logrotate infrastructure. For our test case, we set up a log file that looks similar to a “normal” log file we may…

memset example

This is just a quick note so I don’t forget. If you don’t run a memset, the memory will only be allocated, but not shown as being used in the OS. int main() { int i = 1; while(i++ <…