Friday, December 14, 2007

A curly browser

You can use curl to transfer a URL ( of course, on a unix system )

The description section of the man page says:

curl is a tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction.

curl offers a busload of useful tricks like proxy support, user authentication, ftp upload, HTTP post, SSL connections, cookies, file transfer resume and more. As you will see below, the amount of features will make your head spin!

It also respects the env variable http_proxy. So you can basically do the following to transfer a URL via a proxy via commandl ine.

# http_proxy=[proxy-host]:[port] curl [url]



Tuesday, December 11, 2007

ps pains.

On a Solaris box, the regular ps command ( ps(1) or /usr/bin/ps ) does not give me much info about the command of a process. Oops .. man ps tells me that only the first 80 chars of the command is shown.

This does not help when I am trying to figure out the java process that is taking up most of my server's CPUs.

Some one has mentioned that /usr/ucb/ps should be the ps command I should use. How the hell could I get the man page for that ps. I don't know how, but I figured out it is ps(1B). Here is the man from Sun docs.

-w is the option I should use ( long/wide output ) together with -a ( show processes of all users ). Oh, there is a note for the -w option, the wide output option can be viewed only by a superuser or the user who owns the process.