Displaying keyword search results 1 - 4
Created by Dr. Xi on February 11, 2010 05:07:48 Last update: February 11, 2010 05:08:20
On Linux, you can use the fuser command to find out who has a file open, or is using a port. For example, if you start Tomcat and get the error "Address already in use: 8080", you want to know which process is already binding to port 8080.
# list processes on port 8080 fuser 8080/tcp ...
Created by Dr. Xi on May 05, 2009 19:59:21 Last update: May 05, 2009 19:59:21
Delete a single file:
>>> import os >>> file = 'myfile' >>> os.rem...Delete a directory and contents:
>>> import shutil >>> dir(shutil) ['Error', ...
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/mod_python.so ...Python script:
import time, os from os.path import basename ...
Created by Dr. Xi on August 10, 2007 19:53:32 Last update: August 10, 2007 19:53:32
As a Java developer, I often need to find out which Jar file to include on my classpath in order to fix some compilation error (undefined package, class etc). This is a little Perl script I wrote to facilitate this task.
#!/bin/perl # find jar containing specified...