blogs

CNBC homepage reacting to Dow dropping to 7600

Submitted by admin on Fri, 11/21/2008 - 12:06am. ::

Screenshot from CNBC as Dow drops below 7600.

gzip large files

Submitted by simha.chow on Tue, 05/20/2008 - 8:49am. ::

gzip and large files
The tool gzip is probably the most widely used file compressor on UNIX systems, unfortunately it cannot handle files larger than 2G out of the box, but there’s a simple solution to this, we can make it read from stdin and write to stdout, the -c option tells gzip to write to stdout. This will however keep the original file as well.
# gzip -c9 mylargefile.gz
You could also pipe it to gzip, again keeping the original file
# cat mylargefile | gzip -9
Extracting is similar
# cat mylargefile.gz | gzip -d >mylargefile
# gzip -d mylargefile
If you have an application that’s outputting huge amounts of data and would like to compress it on-the-fly, then here’s a solution
# /usr/sbin/mknod mypipe p
# cat mypipe | gzip -9 > myfile.gz &
# mysqldump -u username database_name > mypipe
This can be great if you’re tight on diskspace.
Extracting can be done in a similar way
# /usr/sbin/mknod mypipe p
# gunzip -c myfile.gz > mypipe &
# mysqldump -u username database_name

To send a Text Message to AT&T cellphone.

Submitted by Wingnut on Tue, 03/25/2008 - 6:06pm. ::

To send a Text Message to AT&T cellphone.
echo body |mailx -s ‘Test Message’ 1111111111@mobile.mycingular.com
Where 1111111111 is the area code and phone number all run together.
Keep message short.

USDT in C++

Submitted by smithuns on Mon, 11/12/2007 - 5:24pm. ::

Many people suppose that C/C++ is dead with the advent of Java. However, C/C++ applications are still continued to be developed and deployed. Several applications such as MySQL, PhP, Java, etc. are still developed and deployed in C/C++. With DTrace, the possibilities of tracing applications and gaining an overview in a "non-destructive" way, has opened the opportunities for its usage on production quality systems. From a developer perspective, you could incrementally introduce DTrace probes in the critical paths of your code. Typically, 20% of a software's lifetime lies in the developmental phase and 80% of it is in maintainence.

To ease the debugging of applications, be it on a development system or on a production machine, DTrace offers you wide possibilities. However, the problem is not that simple. When considering C/C++, the way DTrace handles them differently. This is because of the name-mangling phenomenon, that flattens the namespaces of C++ applications. Why should this be done?

UNIX is a flat world too. UNIX understands flat namespaces and was developed or is still developed with the C-language and as a result has a flat namespace. C++ offers the hierarchial namespaces, whereby its possible to organize information in a hierarchial way. UNIX does not understand this hierarchy. Thats a problem! C++ overcomes this by flattening the namespace that makes UNIX happy. This phenomenon is called the name-decoration or name-mangling or namespace mangling and so on.

Let me illustrate this with a small program, written in C and compiled with the Sun Studio compiler ( C & C++ compilers). Lets us call this program hallo.c which has nothing spectacular, but has a simple function, void printHallo(int), taking an integer argument. This function prints the word, "Hallo", n-times depending upon the argument you pass to this function. The program listing is as follows:

meson:/export/home/mithun/USDT >more hallo.c
#include

void printHallo(int);

Solaris Optimal Resource Utilization Code Camp

Submitted by smithuns on Sun, 11/11/2007 - 11:42pm. ::

In June 2007, I and a couple of my colleagues at Sun Microsystems Germany organized a "Code Camp" on Optimal Resource Utilization with Zones and Zfs. The Code Camp was very successful and the materials are widely requested.

The main document illustrating the concepts is the "Walkthrough" document. You shall find the document in this blog post.

Syndicate content