I wouldn't consider software I create for my own personal benefit useful if I didn't make its source available for other people as well. This is a collection of the few projects that I've assembled which are released under an open source license and can be freely used by anyone that wants them.
To check out some of my other projects, you can return to the main Projects page.
Available Open Source Projects
- SimBot - IRC Bot
- keyMMapp - Dell MultiMedia Keys in Linux
- SFTP without shell
SimBot
Latest Version: 1.0 alpha
Status: Alpha, Active Development
Language: Perl
License: GNU Public License
More Information: SourceForge Project Page
Several years ago, in response to the need (or possibly just desire) for an IRC bot in my channel, I created one, called SimBot in mIRC script. After a while, and may revisions, I decided to start making the bot respond to certain types of conversation, but quickly realized that, for all its power, mIRC is not good at manipulating large amounts of text. Instead, I turned to Perl and lots of regular expressions.
With the help of POE::Component::IRC (by way of a messy experience with Net::IRC), I created a bot that was able to interact with the channel, whose core focused on processing text input and playing with it. Though the bot does not focus much on contextual information, it does prove to be an amusing toy for channel-goers.
I vowed that I would eventually release the code under the GNU Public License and allow others to both use and modify it. I have done so, but no official "releases" of the code have yet been made available. Code is available in CVS.
Looking ahead, I hope to separate the "output" method (currently IRC) so that the bot can be easily moved to other mediums. I also hope to expand the conversational capabilities eventually, and augment it with "utility" features.
My project is now on SourceForge.net. See the project page for more information and access to the code.
keyMMapp
Latest Version: 1.0
Status: Inactive
Language: Perl
License: GNU Public License
More Information:
Source Code
I have a Dell USB Multimedia Keyboard. When I installed Gnome 2.2 I was reasonably excited about the addition of Acme, a tool that allows many MM keyboards to function properly in Gnome. However, I was disappointed to discover that I could not get my keyboard to work with Acme, nor find anyone else with a similar keyboard that knew how to make it work.
I then poked around my /dev directory and located a USB character device which appeared to be specifically for the multimedia keys on the keyboard. After attempting to read from it for a while, I also discovered that it sends 8 byte key codes on each keypress. Knowing perl as I do, I decided to write a script to process the codes. It assumes you have a gnome application called gdialog that opens a small dialog box on the screen when the script has something to say. It also expects "/dev/usb/hid/hiddev0" to be your keyboard device, but the open() function can be edited to make it work with any character device.
Given some time (or someone else's help), I'll improve the script's readability, and add some documentation. Please email me if you have comments, questions, and especially if you use or want to use the script, because that will motivate me to clean it up for you!
SFTP without shell
Status: Complete
Language: C
License: OpenSSH License, Non-Licensed Code
More Information:
Source Code
My roommate claimed it would be easy to make FreeBSD support a chrooted SFTP for users on a system where the users don't have a shell. Let me say right now that finding the right combination of tools to make this work on FreeBSD 4.7 was somewhat tricky. I accepted the "challenge" and now it's done.
The first component is a patch to the "sftp-server" application provided in OpenSSH. FreeBSD 4.7 runs an old version of OpenSSH (3.4p1), so this patch will apply most properly to version 3.4p1, and might not apply to any other version at all. The patch is based on Ebon Elza's patches, which may work for newer OpenSSH versions. My patch differs notably in that it uses the username, rather than the User ID to get the home directory. I'll explain that later.
The second component is an application, called "nonexistent" in this case. This program is based on William Ahern's program. However Ahern's code attempts a small impossibility: launching sftp-server after doing a chroot(). This is not possible, since the binary has become inaccessible. The job of this application is to pretend to be a shell that does only one thing: run sftp-server. It expects the SSH Daemon to launch it as "nonexistent -c /usr/libexec/sftp-server". In any other case, the program will return the message "You are not authorized to access this shell." This effectively prevents any user who has this application as his shell from logging in via any means other than SFTP. For this program to work, it needs to be set suid root, so that running it causes it to run as root and allow the sftp-server to drop privileges down to a normal user.
For the system I set this up on, we're running H-Sphere, a hosting control panel. When H-Sphere makes subaccounts for a primary customer, they are created with the same user ID as the main account name. As a result, the patch I created for "sftp-server" needs to look up the home directory by username, rather than user ID, otherwise the system will grant the user a chroot to the customer's entire site, even if the user in question is normally restricted to a subdirectory. H-Sphere also sets users without shells to the shell "/nonexistent" hence the name of the application.
"nonexistent" can be renamed and relocated however you like, and in the case you're using the patch on a different version of OpenSSH, you should consider the possible case that two users with the same ID may have different home directories, and try to look up the user's data by username.
Installation: Once the two programs are built, nonexistent needs to be placed in the location specified as the shell for "non-shell" users. Chmod the binary: "chmod u+s" and make sure it is owned by root. You may have to add nonexistent's path to your /etc/shells file. Back up and replace the old /usr/libexec/sftp-server with the patched sftp-server binary. Users should now get an error logging in via SSH, but should successfully log in via SFTP. This change will have no effect on users with normal shells at login time, however when they use SFTP they will get the same chroot, preventing them from wandering freely around the system.
If you have found any errors, run into problems, or discovered special cases please email me, and I'll try to update this information.
Projects: Open Source