pipes
Pipe-Sem 1.0
This is a pipe based semaphore implementation for developing ASYNC applications. more>>
Pipe-Sem 1.0 is a good utility which might help you a lot in developing ASYNC applications. Many synchronization primitives are available for Unix systems, but any of them expose a pollable interface to the user. In these cases, if the caller execute a down operation on a blocking semaphore, the application will sleep and whole ASYNC loop will starve because of the wait.
To cope with this problem in ASYNC software, the publisher developed a pipe based semaphore implementation, called Pipe-Sem. The implementation is trivially simple and it uses the pipe internal mechanisms to expose a pollable wait interface.
Besides the standard semaphore operations, the function psem_down_fd() can be used to retrieve a files descriptor that can be dropped inside a Unix pollable API like select(2), poll(2) or epoll(2). The caller will have to wait for input events (POLLIN), and when receiving the event itself, the caller should invoke the psem_try_down() function to try to acquire the semaphore.
Please note that receiving an event from the pollable interface, does not mean that we acquired to semaphore, and the function psem_try_down() will have to be called (and tested for zero return code) to correctly complete the down operation.
<<lessxmms-pipe 0.5.5
xmmspipe is a plugin for XMMS that enables it to be controlled by sending strings to a named pipe (FIFO). more>>
echo play_pause > ~/.xmms/inpipe
will cause XMMS to pause or play.
Since version 0.5.0, it is possible to setup an output pipe, and query XMMS for information. For example, sending "report title" to the input pipe will cause the current songs title to be printed on the output pipe.
Included is a demo program called "fade", that shows how to use the plugin to fade the current song and advance to the next one. It requires the output pipe to be be enabled (via the Config window).
The Infopipe plugin does output pipes a little differently.
When I first wrote this plugin, I didnt know about other programs that I couldve used to control XMMS with shell scripts, such as xmmsctrl or xmms-shell. However, Ive kept xmmspipe alive because pipes may be preferable in some situations:
The pipe automatically inherits the security features of the underlying filesystem (e.g. you could change its permissions so that only users of a particular group can control XMMS).
In many programming languages, writing to a pipe is easier than executing programs, making it easier to build programs to control XMMS.
The plugin can call internal XMMS functions which means it can have more functionality than programs relying on the xmms_remote_* functions alone. For example, XMMSPipe can load/save playlists.
Sometimes I think XMMS itself should just be an MP3-playing daemon that interfaces with the outside world exclusively through pipes (one for input, at least one for output). This would allow a lot more flexibility, e.g. the GUI could be arbitrary and playlists could be managed by an external program. (It would work in the same way gkrellm works with files in /proc.) Also, the code would be simpler because it only has to worry about reading various audio formats and playing them. It wouldnt have to deal with window managers, X, etc.
Enhancements:
- Added playlist_move command due to Graeme Yeo
pipebench 0.40
pipebench is a utility that shows the status and a benchmark of piped commands. more>>
Pipebench measures the speed of a pipe, by sitting in the middle passing the data along to the next process. Works on at least Linux, OpenBSD, NetBSD, Solaris and x86, Alpha, HPPA, Sparc and Sparc64.
Compiling
Just type make to compile.
Type make install to have pipebench be installed in /usr/local/bin
Pipepanic 0.1.3
Pipepanic is a pipe connecting game using libSDL. more>>
Comes with built-in help, is primarily mouse/stylus driven and can be played in different resolutions and orientations.
ntcpclient
ntcpclient project is a GPL replacement for tcpclient from ucspi-tcp. more>>
It is almost definately more primitive than the ucspi-tcp one. Although I havent used it, or seen the source. In fact, I wrote this under the impression that the program I was replacing was closed source. but it was a nice excuse to write some code.
It works by opening the socket using options passed on the command line (performing hostname lookups and such), creating two pipes then forking. The parent process sits in a loop selecting on the socket/pipe and relaying any data between them. The child just execves with the relevant command line and the socket can be read/written to by simply writing to a numbered file descriptor. Seems always to be 5 and 6, but I think that could change between systems.
PAIP 0.2.4
PAIP (pipe) is a universal filter application. more>>
You will need:
gcc & GNU make
GNU sed
GNU install
libdl
libpthread
In three steps you can install it:
1) ./configure
Enter the destination path on prompt.
Just pressing will set the default path /usr/local.
2) make
3) make install
Enhancements:
- fixed Makefiles
- extended plugin socket (connections-switch)
- new using-plugin jpg2bmp
- new using-plugin gif2bmp
Pipe Viewer 1.0.1
Pipe Viewer is a pipeline data transfer meter. more>>
It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.
pv is now considered to be stable code: it appears to work reliably on systems it has been tested on.
mod_auth_pipe 1.0
mod-auth-pipe is a module of authentication written for Apache 1 (it hasnt been tested with Apache 2, but it may work). more>>
Actually, this module is just mod-auth-shadow with a few modifications in order to accept any program as a pipe, letting this one validate both users andr groups.
mod_auth_pipe contents the module itself and an example pipe.
mod-auth-pipe can be configured independantly for whole server, for any VirtualHost or just per Location/Directory. It has very few configuration variables and its format is very simple. In order to configure apache to authenticate, for example, access to the administrative interface of oscommerce you can type this on your httpd.conf:
< Directory /var/www/oscommerce/catalog/admin >
AuthType Basic
AuthName osCommerce admin site
AuthPipe on
AuthPipeProgram /usr/local/bin/auth-pipe
require group oscommerce-admins
< /Location >
This way, and with a well-made auth-pipe program you can be sure that only those within the group oscommerce-admins could enter that section of your web.
PipeBandwidth 0.1
PipeBandwidth is a program that measures the speed at which data goes through a pipe and prints statistics to stderr. more>>
Basically, it just reads from stdin, writes data back to stdout, and measures the speed. PipeBandwidth can be useful to measure transfer rates while sending data through netcat or compressing with gzip or bzip2.
progress 1.0
Progress is a utility used in a pipe to report progress of data transfer to standard error. more>>
Enhancements:
- February 9, 2003
- progress 1.0
- Initial announcement
IO::Pipe::Producer 1.5
IO::Pipe::Producer is a Perl module that provides two modules getSubroutineProducer and getSystemProducer. more>>
SYNOPSIS
# Module which provides 2 methods: getSubroutineProducer
# and getSystemProducer. They take a subroutine reference
# (with associated arguments) and a system call
# respectively and return (blessed) handles on their
# streaming standard output and standard error output.
# EXAMPLES of usage
use IO::Pipe::Producer;
$obj = new IO::Pipe::Producer();
$stdout_fh =
$obj->getSubroutineProducer($subroutine_reference,
@subroutine_parameters);
# OR
use IO::Pipe::Producer;
$obj = new IO::Pipe::Producer();
($stdout_fh,$stderr_fh) =
$obj->getSubroutineProducer($subroutine_reference,
@subroutine_parameters);
# OR
use IO::Pipe::Producer;
$stdout_fh = new IO::Pipe::Producer($subroutine_reference,
@subroutine_parameters);
# OR
use IO::Pipe::Producer;
($stdout_fh,$stderr_fh) =
new IO::Pipe::Producer($subroutine_reference,
@subroutine_parameters);
# Then you can read the returned handles like any other
# file handle...
while()
{print "STDOUT From Producer: $_"}
while()
{print "STDERR From Producer: $_"}
# You can also do the same thing with system calls using
# the getSystemProducer subroutine. However, this feature
# is not accessible via the new constructor
use IO::Pipe::Producer;
$obj = new IO::Pipe::Producer();
$stdout_fh =
$obj->getSystemProducer("echo "Hello World!"");
use IO::Pipe::Producer;
$obj = new IO::Pipe::Producer();
($stdout_fh,$stderr_fh) =
$obj->getSystemProducer("echo "Hello World!"");
# However, this is exactly the same as:
use IO::Pipe::Producer;
$stdout_fh = new Producer(sub{system(@_)},
"echo "Hello World!"");
# OR
use IO::Pipe::Producer;
($stdout_fh,$stderr_fh) =
new IO::Pipe::Producer(sub{system(@_)},
"echo "Hello World!"");
Alvis::Pipeline 0.11
Alvis::Pipeline is a Perl extension for passing XML documents along the Alvis pipeline. more>>
SYNOPSIS
use Alvis::Pipeline;
$in = new Alvis::Pipeline::Read(host => "harvester.alvis.info",
port => 16716,
spooldir => "/home/alvis/spool");
$out = new Alvis::Pipeline::Write(port => 29168);
while ($xml = $in->read(1)) {
$transformed = process($xml);
$out->write($transformed);
}
This module provides a simple means for components in the Alvis pipeline to pass documents between themselves without needing to know about the underlying transfer protocol. Pipe objects may be created either for reading or writing; components in the middle of the pipeline will create one of each. Pipes support exactly one method, which is either read() or write() depending on the type of the pipe. The granularity of reading and writing is the XML document; neither smaller fragments nor larger aggregates can be transferred.
The documents expected to pass through this pipeline are those representing documents acquired for, and being analysed by, Alvis. These documents are expressed as XML contructed according to the specifications described in the Metadata Format for Enriched Documents. However, while this is the motivating example pipeline that led to the creation of this module, there is no reason why other kinds of documents should not also be passed through pipeline using this software.
The pipeline protocol is described below, to facilitate the development of indepedent implementations in other languages.
Zip 2.32
Zip is a compression and file packaging utility for Unix, VMS, DOS, OS/2, Windows 9x/NT, Amiga, Atari, Macintosh. more>>
Zip is analogous to a combination of the Unix commands tar(1) and compress(1) and is compatible with PKWAREs PKZIP and Nico Maks WinZip. Its part of the Info-ZIP project.
Main features:
- creating zipfiles in a pipe or on a device
- VMS and OS/2 extended file attributes
- conversion between Unix, MS-DOS and Macintosh text file formats
- the ability to run on most of your favorite operating systems.
Enhancements:
- fixed -R operation to match the supplied file patterns in all recursed subdirectories, like PKZIP 2.04 "-p -r" (or PKZIPC 4+ "-recurse")
- handle cases where -x, -R, and -i patterns are mixed
- new example C-Sharp code for using DLLs
- added some directory-search speedups
- fixed bug when encrypting large uncompressible files
- fixed Windows NTFS time problem
- fixed VMS logical name parse problem
- added VMS DEBUG option
- updated VMS help
- fixed selection of files to delete by date
- added -MM option where each input file pattern must match at least one file and all input files must be readable
- added check for when Zip tries to exceed seek limit in output file
- minor changes to compile with Visual C++ 2005
- added support for Unix FIFOs (named pipes)
- other minor fixes
Simple UDP proxy/pipe 0.3
Simple UDP proxy/pipe is an advanced UDP proxy/datapipe/packets forwarder and modifier with multiple functions. more>>
Multiple clients allowed (you can connect many clients you want to this proxy), creation of ACP files (tcpdump capture files, just like a sniffer), packets forwarding (chat style, each packet is forwarded to all the other clients and server connected), packets injection (the tool opens a specific UDP port where you can send your customized packets which will be sent to the server), hexadecimal visualization and plugins support for the modification and visualization of the packets with some example plugins already included (Zdaemon huffman, Doom huffman, Half-life decoding and one for the replacement of the text strings).
Plugins (which work on both Windows and Linux) are very basic to create and use, just take a look at example_sudp.c for more informations.
4tH compiler 3.5b
4tH is a Forth compiler with a little difference. more>>
4tH is a very small compiler that can create bytecode, C-embeddable bytecode, standalone executables, but also works fine as a scripting language. It supports over 85% of the ANS Forth CORE wordset and features conditional compilation, pipes, files, assertions, forward declarations, recursion, include files, etc.
It comes with an RPN calculator, line editor, compiler, decompiler, C-source generators, and a virtual machine.
Enhancements:
- More CORE words and most of the DOUBLE wordset are supported.
- Output buffers can be flushed.
- An experimental multitasking environment was added.