Showing posts with label admin. Show all posts
Showing posts with label admin. Show all posts

Sunday, February 08, 2009

Tweaking htop display


htop is more flexible than top from procps. But recently I found a tiny inconvinience when htop display processes which use more than 10GB memory. Those processes use 6 characters in VIRT field, while normally it is 5 or less.





$ diff -urN Process.c.orig Process.c
--- Process.c.orig 2008-09-23 10:43:34.000000000 +0700
+++ Process.c 2009-02-07 23:21:57.000000000 +0700
@@ -205,8 +205,8 @@
static void Process_printLargeNumber(Process* this, RichString *str, unsigned long number) {
char buffer[11];
int len;
- if(number >= (1000 * ONE_M)) {
- len = snprintf(buffer, 10, "%4.2fG ", (float)number / ONE_M);
+ if(number >= (10 * ONE_M)) {
+ len = snprintf(buffer, 10, "%3.1fG ", (float)number / ONE_M);
RichString_appendn(str, CRT_colors[LARGE_NUMBER], buffer, len);
} else if(number >= (100000)) {
len = snprintf(buffer, 10, "%4ldM ", number / ONE_K);

After small modification above, now htop behaves 'properly'.

Tuesday, January 20, 2009

Setup Mercurial pada RHEL 4


/* pasang paket mercurial */
$ sudo yum install mercurial
/* ambil flup, ekstrak, instal modul flup */
$ wget http://www.saddi.com/software/flup/dist/flup-1.0.1.tar.gz
$ tar xvfz flup-1.0.1.tar.gz
$ sudo easy_install flup-1.0.1
/* ikuti langkah selanjutnya di http://www.selenic.com/mercurial/wiki/index.cgi/RHEL4HgWebDirSetup */