Category: Coding

Aug 08 2007

BitTorrent Protocol and Source Closed

Now I guess it makes sense why Bram wanted to “buy all rights” from the other quasi-silent BT devs, in particular the protocol design. Shame, Bram. You should’ve been honest.

UPDATE 8/10: After a couple days to ponder this more, I’m even more disappointed than I was. While a large proponent of open source, I don’t much care what Bram does with it. The source code to BT isn’t where the value is, it’s the protocol. Closing a protocol, is like telling someone they’re not allowed to talk your language anymore. It would be the Bush Administration saying “Cubans are evil, so we’re not going to allow them to speak English anymore.” Given the historical ignorance of this White House, I’d have expected that BEFORE I expected Bram to close the BT protocol.

A protocol is a culture embedded in technology: It defines etiquette between systems; it defines grammar and speech; it defines nouns and verbs. You learn a lot about humanity when you read well-written protocols: It’s not like learning a new language, it’s like being immersed in a new culture. That culture has been taken to a private island, and no one is allowed to experience it unless you’re declared fit by the czar.

On the plus side, this will spur some new innovations. BT has some serious flaws: flaws that have been well known and accepted on the grounds of ease-of-coding and portability. The paradigm can change, the flaws fixed, and a new format can be created and in a Darwinistic dual, we’ll see which succeeds. Of course, this assumes that the czar doesn’t unleash the lawyer-hounds.

Protocols should never be exclusive. Never. They should be the most open parts of our technological society.

Dec 23 2006

RT/AT .. Not Your Father’s Imperial Walker

RT is quite possible one of the coolest web tools I’ve ever used. Yes, MediaWiki is very neat, and WordPress make blogging palatable… and let’s not leave off PGTK ;) But seriously, RT is an amazing Perl/Mason application that is so stupid easily customizable that it borders on suicidal… I have so many ideas for extensions and add-ons that it’s pretty much all I’ve been doing lately.

Then along came AT. AssetTracker is an add-on to RT that provides the same level of customization and flexibility that RT does… I’m considering moving a LOT of things over to it, including ARS. How cool would THAT be? Ok, I gotta go back to scheming. I haven’t been this excited about an application in a long time… Napster maybe? :)

Dec 23 2006

New Nagios Tray version

Nagios Tray version 2.0.5: Added handling of larger check interval times by way of a 60 second normalization timer. Said differently, all requests larger than 60 seconds are broken into 60 second or smaller increments and stacked. By request of Jan Saner.

Nagios Tray was blogged about here.

Dec 07 2006

New rofs version

As of 11/28/2006, there’s a new version of rofs that doesn’t leak. Thanks to Martin Pärtel for pointing out a memory leak (malloc() with no free()s). I’ve been running this in a high-use environment and it hasn’t grown a byte since then (not counting thread spawns): Believe solved.

Rofs was blogged about here.

Oct 19 2006

Thunderbird Drama, I guess

So I guess at some point Thunderbird stopped allowing people to be lazy and just use “username” instead of “username@yourdomain.com” in their Address Book. I also guess that some people are particularly in a tizzy about this. At the prodding of our MultiTech Steve, I wrote ThankSteve to quiet the masses. Originally it was only useful to @potsdam.edu’ers, but after a couple people on IRC  mentioned the utility, I built a version that has a text box to let you diddle the domain. Have fun… I guess.

Sep 28 2006

rofs – The Read-Only Filesystem for FUSE

I love being redundant. Long story short I needed a read-only file system that was:

  1. Lightweight
  2. Underlying filesystem agnositic
  3. Supported XATTR
  4. read XACLs/made access() calls

I didn’t find any I liked, and a remount of the filesystem using NFS wasn’t working as well as I liked (XACL problems). So I wrote rofs, the read-only file system for Fuse.

It requires Fuse API version 25, which shouldn’t be a problem on modern systems. Tested only on Fuse v2.5.3.

Sep 01 2006

Nagios Tray 2

Nagios Tray OptionsNagios Tray 2 is done and has been out the door for a few days now. It’s basically an 80% rewrite with several new features, the biggest and most obvious is a 100% registry key exposal via the new Options panel (image right). This puppy pops up the first time you install NagTray, and everytime you up or down -grade. Could still be bugs, but several people use it daily and haven’t balked yet.

Nagios Applet will have a new release soonish too, but not until I get some other projects finished up.

Aug 19 2006

Photo Licensing and Nagios-related Programs

I’ve formalized the licensing of my photos to use the Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Lately, I’ve been working on a number of projects, including a lot of Nagios stuff. I’ve got a category set up in the wiki for anyone who might care… Of particular interest could be Nagios Tray (for Windows) or Nagios Applet (for Gnome). TrapWrangler is also coming along nicely… Stay tuned. :)

Mar 13 2006

True moderation in phpBB

phpBB, one of the most popular forum systems, does not have proactive moderation capabilities. Proactive, or “true” moderation is forcing any post made by a “non-special” user gets queued until it’s approved by a moderator. While draconian, proactive moderation is a popular way of preventing inappropriate content in forums.

After a lot of thought, the least intrusive mechanism is to extend the “posts” table by a single tinytext field that will store the “forum_id,topic_id”. The forum_id and topic_id in the post record will be set to 0, and thus never be displayed. Once someone approves the messages, the tinytext field will take the forum_id component and set that, and if there is a topic_id, then set that. If there is no topic_id component, then it’s assumed this was a new topic, and one needs to be assigned.
I’m still in awe that phpBB has no proactive moderation……. Yet.

Feb 12 2006

CopyFS is now even cooler: Aka C is my Bitch once again

Some backstory: I used to write a LOT of code in the C programming language. I used to be actively involved in numerous open-source programs that used C. Hell, I even co-authored a book that was completely about C code, written in the format of the much-loved classic Lions’ Commentary on UNIX, and available in 6 languages. That was “back then”. I’ve gotten spoiled with Perl, Java and C++ over the last half-decade and haven’t written more than trivial patches in C in … 6 years. I still read C fluently… But not so much on the writing.

So going [almost] back to my programming roots, I took on a project that forced me to dive head-first back in C. And not just a wussy application… No sir. A filesystem. Some guys beta test backup software, and some guys use their laptop as a live debugger for filesystem enhancements.  Before I get into  the details of the software, let me say that I’ve  finally popped back into the world of seeing C solutions, and knowing exactly how to get what I want out of the code… I’m not at the level I’m at with Perl, where I can literally have a conversation with a person in the language itself, but my Cfu is, again, strong.
So enough about me. CopyFS is a FUSE filesystem that supports file versioning. v1.0 is a pure copy-on-write filesystem. Anytime you make a change, it makes a copy. If you change the metadata of a file, it makes a copy. You can list all of the versions of a file, and make any version the “current” version very easy. It really is a great tool.
I’ve been using CopyFS for a while now in various venues, the most active of which is my Eclipse development tree- Where nearly all of my Perl, Python, C++, Java… and now C code is developed. It allowed me to have my own little revision control system on my filesystem without the complicated mucking around with CVS/SVN/git/etc. repositories.
After using it for the quite-a-while I have been, the lack of certain features became a little painful. As CopyFS is open source software, I could just complain that the software doesn’t do what I want, write a snotty post to a mailing list and assert the entitlement that others seem to believe they have just because they downloaded a piece of software… Or I could enhance it. I could solve my own problems.

Problem 1: Text Diffs

By far, the largest problem I was having was determining WHICH of the 212 versions of a source file were the ones I wanted to revert too. Ok, I broke something in the latest version, where’s one that doesn’t have changes to that area? That was done with no core changes- just 90ish lines of additions and a couple changed lines in the fversion userspace application- All Perl.

Problem 2: Way too many versions

As I mentioned previously, any change to a file will trigger a copy. I have some files with hundreds of versions. For some files, this is great. For others… For example a pre-linked object file, this is unnecessary. While the sum of the code additions necessary to add this into CopyFS was a mere 200 lines, it took me thousands of lines of C over the past few weeks to get to that 200 lines. Using fversion, you can now tell the CopyFS daemon you want to purge the oldest N versions, or all versions, of a given file.

In progress…

  • Another piece to the problem 1 puzzle is the ability to search your versions for a string or a pattern. I’m workingish on that. I have it workingish in a pure-Perl solution, but I know it would be better to do it in C… I just love regular expressions in Perl, and know that if I wanted anything remotely that powerful in C, I would have to include PCRE which will bloat the project, something I’m not willing to do. It’s small and fast right now. I like it that way. This has been implemented… fversion -G pattern will now match whatever you put at it. 100% perl.
  • Another piece to problem 2 is the ability to purge individual versions, or version ranges. For example, I have a file that has 212 versions. I want to preserve v1.0 and v212.0. I want to purge 2-211. I can’t do that right now, so all 212 are there. Yes, I could lock v1.0 and then make a change to it, thus creating v213 which would essentially BE v1, and then purge 211 versions… But that’s not elegant, and I prefer to do things elegantly. I’m working on this now. It’s all C.

Braindump

  • Setting a special xattr that could mark a file as “don’t copy”… Better yet mark it with a number that is the number of copies you want to keep of this file… So if it was 1, you’d always have the current version plus 1. If it was 12… You get the point.
  • Along the same line, having a mount-time option that sets the maximum number of versions kept for all files on the volume. This would be useless for my uses, but useful if you only wanted to keep versions in order to restore a misdeleted file or something.
  • … same line, again. Maybe have a config file that lets you set certain file types differently: eg. all .o files (object files) never keep copies. All .pl,.cpp,.c,.java etc keep all. Everything else keep 3.
  • Web interface to allow users who don’t have shell access an easy way to restore old versions (thinking of user-servicable backups here )
  • Still need to implement directory handling/recursion for the purge.

WordPress Themes