locks
Z-lock 0.1
Z-lock is a Japanese shooter with a twist: your shot power is directly proportional to the number of enemies locked on to you. more>>
Installing/Uninstalling:
Z-Lock is entirely contained within this directory. There is no installation. To uninstall, simply delete this directory.
Running:
Type ./z-lock from this directory to start the game.
Compiling:
Install the OpenGL development libraries. (This is the hard part.)
Install the D compiler, version 0.106. (http://ftp.digitalmars.com/dmd.106.zip) Note that this is non-opensource, so if you cant run the binary, youre out of luck. If you dont like it, talk to digitalmars. I dont like it either. Also, any later versions of the D compiler will NOT work. 0.106 or earlier is needed. As a final note, the resultant binary will not work on other computers, due to problems in the D compiler.
Install SDL_mixer.
Compile Bulletml with "make" in the import/bulletml directory.
Compile with "make -f linux.mak" in the src directory.
Known Issues:
The compiler is non-opensource. Compiling on non-x86 platforms is unlikely to work.
cnslock 1.02
cnslock is a dockapp which provides a visual indication of the states of the three lock buttons (caps, num, and scroll). more>>
cnslock was written so that I could see the state of those keys as I have a wireless keyboard with no leds on it.
Usage:
Simply launch:
cnslock
If you have problems running it under a different window manager, such as fvwm or enlightenment, there is a command line argument that may help:
cnslock -w
Memlockd 0.03
Memlockd project locks a list of files into RAM so that if the system starts paging excessively the sysadmin will still recover. more>>
The project will lock regular files as well as programs in memory, and for programs, it can optionally lock all shared objects that they are linked against.
Enhancements:
- The daemon now writes a PID file.
- The restart option of the init.d script now starts a new instance unconditionally so that the new instance can kill the old one.
- This means that there is no time window when memlockd is not running.
Laplock 0.0.5
Laplock project locks your computer or laptop using a media card such as USB memory, SD, MMC, or a Memory Stick. more>>
INSTALLATION
you need: udev, the userspace dev tools. This does
not work with devfs.
you can execute everything you want, but a screensaver
would be the best. so install xlock or xscreensaver
1) just type make to compile laplock.
2) type make install to install the binary to /usr/bin
and the sample conf file to /etc/
(you can type make DESTDIR=what/ever/ install to
install it for packages or so.)
3) edit /etc/laplock.conf.example and move it to
/etc/laplock.conf.
and youre done. have fun.
CONFIGURATION
in version 0.0.3 you only need 3 variables to set.
DEVICE
the device to watch. fire up udevmonitor
and plug in a card into your reader. normally
there are 3 lines with add@ and many shit.
(also the device)
UUID
close udevmonitor and go to /dev/disk/by-uuid/
there is a new file with the unique id of your
card.
EXECUTE
this command will be started, when you insert
your mastercard. xlock is very nice and works
good.
Enhancements:
- Debug mode was implemented with laplock -d.
- A lot of code cleaning was done in laplock.c and udev.h.
- An application is started with fork() instead of with system() and bash.
- getopt_long is used for parameters now.
- Nice indent schemes were added to the Makefile.
Termlock 1.0.1
Termlock project blanks a curses compatible character terminal (e.g. xterm, eterm, PuTTY, konsole, dtterm, etc ...) and locks it more>>
Basically its like a password protected screensaver for character terminals. Written in pure Python it should be immediately usable on any machine with Python and curses (or a compatible library such as ncurses) installed.
Usage:
termlock [-p | --password]
The password switch prompts the user for a password (which must be confirmed) and uses this to create the ~/.termlock hash file.
To lock the screen simply call termlock with no options. If no ~/.termlock file can be found then an error prompting the user to create it will be displayed
Install:
Termlock uses the standard Python distribution utilities. So it should just be a case of uncompressing the archive and running:
./setup.py install
Obviously the user running this must have sufficient permissions to create a file in the install directory.
Lock Keys Applet 1.0
Lock Keys Applet (formerly Led_applet) is a GNOME 2 applet that shows the status of the Caps-, Num-, and Scroll Lock keys. more>>
This isnt especially usefull for normal keyboards, as they got leds for that. But some keyboards (especially wireless keyboards) dont have. One more feature of the applet is that it saves the status of the lock-keys and restores it, when starting GNOME.
Installation:
The `configure shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile in each directory of the package.
It may also create one or more `.h files containing system-dependent definitions.
Finally, it creates a shell script `config.status that you can run in the future to recreate the current configuration, a file `config.cache that saves the results of its tests to speed up reconfiguring, and a file `config.log containing compiler output (useful mainly for debugging `configure).
If you need to do unusual things to compile the package, please try to figure out how `configure could check whether to do them, and mail diffs or instructions to the address given in the `README so they can be considered for the next release.
If at some point `config.cache contains results you dont want to keep, you may remove or edit it.
The file `configure.in is used to create `configure by a program called `autoconf. You only need `configure.in if you want to change it or regenerate `configure using a newer version of `autoconf.
The simplest way to compile this package is:
1. `cd to the directory containing the packages source code and type `./configure to configure the package for your system.
If youre using `csh on an old version of System V, you might need to type `sh ./configure instead to prevent `csh from trying to execute `configure itself.
Running `configure takes awhile. While running, it prints some messages telling which features it is checking for.
2. Type `make to compile the package.
3. Optionally, type `make check to run any self-tests that come with the package.
4. Type `make install to install the programs and any data files and documentation.
5. You can remove the program binaries and object files from the source code directory by typing `make clean. To also remove the files that `configure created (so you can compile the package for a different kind of computer), type `make distclean.
There is also a `make maintainer-clean target, but that is intended mainly for the packages developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.
Enhancements:
- (almost) completly renamed everything to lock-keys-applet
File::lockf 0.20
File::lockf is a Perl module interface to the lockf system call. more>>
SYNOPSIS
use File::lockf;
File-Lockf is an interface to the lockf system call. Perl supports the flock system call natively, but that does not acquire network locks. Perl also supports the fcntl system call, but that is somewhat ugly to use. There are other locking modules available for Perl, but none of them provided what I wanted -- a simple, clean interface to the lockf system call, without any bells or whistles getting in the way.
File-Lockf contains four functions which map directly to the four modes of lockf, and an OO wrapper class that encapulates the basic locking functionality along with an additional utility method that iteratively attempts to acquire a lock.
Lock functions
The following functions return 0 (zero) on success, and the system error number from errno on failure. They each take an open file handle as the first argument, and optionally a size parameter. Please see your system lockf man page for more details about lockf functionality on your system.
$status = File::lockf::lock(FH, size = 0)
This function maps to the F_LOCK mode of lockf.
$status = File::lockf::tlock(FH, size = 0)
This function maps to the F_TLOCK mode of lockf.
$status = File::lockf::ulock(FH, size = 0)
This function maps to the F_ULOCK mode of lockf.
$status = File::lockf::test(FH, size = 0)
This function maps to the F_TEST mode of lockf.
OO wrapper
File-Lockf also provides a simple OO wrapper class around the locking functionality, which allows you to create a lock object for a file handle and then perform lock operations with it. All of the methods return 0 (zero) on success, and the system error number from errno on failure.
$lock = new File::lockf(*FH)
This function returns a new lock object bound to the given file handle. Note that you need to pass a reference to the file handle to the constructor, not the file handle itself.
$status = $lock->lock(size = 0)
This method calls File::lockf::lock on the bound file handle.
$status = $lock->tlock(size = 0)
This method calls File::lockf::tlock on the bound file handle.
$status = $lock->ulock(size = 0)
This method calls File::lockf::ulock on the bound file handle.
$status = $lock->test(size = 0)
This method calls File::lockf::test on the bound file handle.
$status = $lock->slock(count = 5, delay = 2, size = 0)
This method will attempt to lock the bound file handle < count > times, sleeping < delay > seconds after each try. It will return 0 if the lock succeeded, or the system error number from errno if all attempts fail.
vp-usb-lock 0.2.1
vp-usb-lock is a Linux kernel driver and PAM module that utilizes the PC wireless USB lock. more>>
It is easy to install, but needs access to the sources of the kernel and PAM to build correctly. It has been tested under Fedora Core 2 with a custom made 2.6.7-1.494.2.2 kernel, but it should also work with other kernel versions and distributions.
Enhancements:
- A lock daemon was added.
- A compilation error that was introduced lately by some changes to the Linux kernel was fixed.
- Support for kernel 2.4.x versions was added.
LockFile::Simple 0.2.5
LockFile::Simple is a simple file locking scheme. more>>
SYNOPSIS
use LockFile::Simple qw(lock trylock unlock);
# Simple locking using default settings
lock("/some/file") || die "cant lock /some/filen";
warn "already lockedn" unless trylock("/some/file");
unlock("/some/file");
# Build customized locking manager object
$lockmgr = LockFile::Simple->make(-format => %f.lck,
-max => 20, -delay => 1, -nfs => 1);
$lockmgr->lock("/some/file") || die "cant lock /some/filen";
$lockmgr->trylock("/some/file");
$lockmgr->unlock("/some/file");
$lockmgr->configure(-nfs => 0);
# Using lock handles
my $lock = $lockmgr->lock("/some/file");
$lock->release;
This simple locking scheme is not based on any file locking system calls such as flock() or lockf() but rather relies on basic file system primitives and properties, such as the atomicity of the write() system call. It is not meant to be exempt from all race conditions, especially over NFS. The algorithm used is described below in the ALGORITHM section.
It is possible to customize the locking operations to attempt locking once every 5 seconds for 30 times, or delete stale locks (files that are deemed too ancient) before attempting the locking.
Tie::DB_Lock 0.07
Tie::DB_Lock Perl module can ties hashes to databases using shared and exclusive locks. more>>
SYNOPSIS
use Tie::DB_Lock;
use DB_File;
tie(%hash, Tie::DB_Lock, $filename, rw); # Open for writing
$hash{key} = value;
untie %hash;
tie(%hash2, Tie::DB_Lock, $filename); # Default is read-only
print("Value is $hash2{key}n");
untie %hash;
This is a front-end for the DB_File package.
If you tie a hash in read-only mode, this module puts a shared lock on the database file, copies it to a temporary file, unlocks the original database, and then ties the tempfile using DB_File.
If you tie the hash in read-write mode, we put an exclusive lock on the database and tie it directly using DB_File.
The reason I copy the whole file every time I read from it is that this allows the program to read from the file for as long as it wants to, without interfering with other peoples writes. This works well if you typically have long, sustained reads, and short, bursty writes. See the README file for help in deciding whether you want to use this package.
You dont always need to call untie() explicitly - it will be called for you when %hash goes out of scope. And if all goes as planned, youll never know the temporary file ever existed, since it will evaporate when %hash goes away.
File::LockDir 0.01
File::LockDir is a Perl basic filename-level lock utility. more>>
SYNOPSIS
use File::LockDir;
INTERFACE
new
Initializes the class. Returns the singleton object.
nflock($file, $nap_till, $locker, $lockhost)
Locks the supplied filename. Only $file is required.
$file is the file to be locked; $nap_till is the total amount of time to wait before giving up; $locker is a name identifying the locker; $lockhost is the host requesting the lock.
nunflock($file)
Unlocks the supplied file.
nlock_state($file)
Checks the state of the lock for the supplied file. Returns a list: the first item is true if the file is unlocked, and false if not; the second item is undef if the file is unlocked, and the identity (name and host) is it is locked.
DIAGNOSTICS
%s already locked
Seen when youve already locked the requested pathname. Informational only.
No pathname to be locked
You didnt supply a pathname to be locked to nflock. Fatal.
cant write to directory of %s
The directory where the file resides cant be written, so the lockfile cant be created.
cant get %s: %s
The named lock cant be gotten: the reason is supplied. Failure occurs after ten tries to get the lock.
%s %s[%s]: lock on %s held by %s
The lock on the specified file is help by the noted locker. Informatory message, printed only when debugging is on.
close failed for %s: %s
The file containing the lock information couldnt be closed for the reason shown.
releasing lock on %s
Debug message; notes that the lock on the specified file was successfully released.
File::NFSLock 1.20
File::NFSLock is a Perl module to do NFS (or not) locking. more>>
SYNOPSIS
use File::NFSLock qw(uncache);
use Fcntl qw(LOCK_EX LOCK_NB);
my $file = "somefile";
### set up a lock - lasts until object looses scope
if (my $lock = new File::NFSLock {
file => $file,
lock_type => LOCK_EX|LOCK_NB,
blocking_timeout => 10, # 10 sec
stale_lock_timeout => 30 * 60, # 30 min
}) {
### OR
### my $lock = File::NFSLock->new($file,LOCK_EX|LOCK_NB,10,30*60);
### do write protected stuff on $file
### at this point $file is uncached from NFS (most recent)
open(FILE, "+<<less
Java::JCR::Lock 0.08
Java::JCR::Lock is a Perl module that can load JCR lock extension wrappers. more>>
SYNOPSIS
use Java::JCR::Lock
This loads the Perl classes mapped to the Java package named javax.jcr.lock.
Installation:
Installation can be a bit tricky because this library depends upon Inline::Java,
which didnt install without going through the process by hand. (I usually just
let CPAN do all the work.) You must first install Inline::Java.
Then, you must install libwww-perl, as I use that to download the Jar files. I
hope to remove this dependency in the future, but its there for now.
After installing both of those, you should be able to run:
perl Build.PL
./Build
./Build test
./Build install
I generally try to make my build scripts as standard as possible. If you prefer
using make, I have Module::Build distributing a makefile generator too:
perl Makefile.PL
make
make test
make install
record_locking 0.01
This product offers PHP/Ajax method of implementing dynamic application level record locking. more>>
record_locking 0.01 is yet another powerful package for web developers. It actually offers PHP/Ajax method of implementing dynamic application level record locking.
There has been a lot of effort to create enterprise grade multiuser LAMP applications, since this approach promises to solve a lot of major problems - such as platform independence, eliminating the overhead of maintaining software on the user's workstation, etc.
However, one of the dirty secrets of LAMP apps is that the record locking provided by the database server only functions for the duration of the transaction - which in the case of a browser based UI is only during a single html request/event. There isn't any established means of maintaining a record lock over multiple html "interactions" with the user - i.e: during the time while the user has the record in his browser window for editing.
A true multi-user app requires "application level" record locking to ensure that only one user can change a record at a time. Enabling members to change (parts of) their own records creates a non-zero possibility of race conflicts with the office manager or other authorized admins attempting to change the same record.
Each status check updates the lock timestamp, confirming that the user is still connected and actively editing the record. Locks are normally released when the user saves the record or navigates to a different screen. If the user fails to properly close/release the record - abandons the record or his browser crashes - locks go stale if not updated for 5 minutes. The next status request or attempt to lock the record will delete or overwrite any stale lock.
Saving a record requires a current lock owned by the user. This protects against obsolete cached data being resubmitted to the database. The user must remain in effectively continuous contact with the database in order to successfully change a record - emulating the behavior of a conventional "closely linked" application.
The user's background javascript process requests a special php file that manages the lock directory and generates a minimal html response back to the calling javascript process with the current lock status. The javascript process parses this returned html message and updates the lock status window. In order to avoid hammering the hard disk with lock traffic, the special php file and lock directory are loaded into a ramdrive mounted as the lock/ directory tree.
Gnome Wireless PC Lock 0.2
Gnome Wireless PC Lock is a Gnome applet that locks your desktop when you walk away from your desk. more>>
A small gnome program that locks your desktop when you walk away from your desk. It is tested with a Sitecom cn-129 Wireless PC Lock.