Recent Notes

Displaying keyword search results 1 - 3
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on December 12, 2007 20:30:01    Last update: December 12, 2007 20:32:23
This is a script to tail a log file through the web browser. It uses AJAX, apache web server, mod_python, UNIX utilities tail (requires the --lines switch) and wc . The log file may reside on the web server or any other host accessible from the web server through SSH. Although it's written in python, it should be easy to port to other languages such as Perl. Apache httpd.conf : LoadModule python_module modules/ ... Python script: import time, os from os.path import basename ...
Created by Dr. Xi on August 29, 2007 03:50:17    Last update: August 29, 2007 03:53:02
The command lsof lists all open files. Here are some simple uses: 1. List what files are in use by process with id 2512: /usr/sbin/lsof -p 2512 2. To find the process that has /u/abe/foo open, use: lsof /u/abe/foo 3. To find who's accessing the CDROM: $ /usr/sbin/lsof /media/cdrom COMMAND PID ... 4. To list all files using any protocol on port 80: lsof -i :80 This is a link to the man page: