How To: Filter Lookup Field Values by Current User

I had been struggling with SharePoint 2007 trying to get the current user’s ID using SPServices and jQuery. I wanted to filter results based on a SharePoint user lookup field in a custom list. The issue I was struggling with, using SPServices, was that I wasn’t able to get the current user ID. I’m not sure, but I think it’s because I’m still using SharePoint 2007.

However, I stumbled across this solution which didn’t require me to know the ID of the user. And it worked like a charm (with one small change).

var userName = $().SPServices.SPGetCurrentUser({ fieldName: "Name" });
 
var query = '<Query>' +
                '<Where>' + 
                    '<Eq>' +
                        '<FieldRef Name="SharePointUser" />' +
                            '<Value Type="User">' + userName + '</Value>' +
                    '</Eq>' +
                '</Where>' +
            '</Query>'; 
 
$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "UserAccessList",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    CAMLQuery: query,
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
            // will return only results that match the current logged in user
            // in the 'SharePointUser' column
            console.log($(this).attr("ows_Title"));
      });
    }
});

How To: Unlock, Root, and Install a Custom ROM on a Galaxy Nexus (Verizon) Using a Mac

Purpose: unlock and root the Galazy Nexus (Verizon) using nothing but a Mac and Google’s Android SDK. We’re a Mac household (with some Linux underpinnings) and I had a hard time finding what I would call a definitive guide to approaching the task with my Galaxy Nexus (Verizon).  I had started with Droid Life’s Complete Nexus Guide but it was primarily for Windows users and I couldn’t get VMWare Fusion to play nice with the Samsung driver. So: here’s how I unlocked my Galaxy Nexus (Verizon) on my Mac.  It only took Google Search and a couple hours in front of the computer and was actually really, really easy in the end.  Much easier than on the PC and much easier than any Mac guide I coud find (which all required me to download a mythical fastboot if I could find it. I ended up just using the “fastboot” that came from Google in the SDK.  Wee!

Read the rest of this entry »

How To: Install Vim 7.x Locally on Site5

Purpose: upgrade your Vim distribution to 7.x on your Site5 account with minimal hassle. I had tried to follow this guide initially but kept running into problems with my $VIMRUNTIME files … anyway, this method works very easily utilizing a bash script and eliminating the problems I had.

Read the rest of this entry »

How To: Store iMovie ’09 Events and Projects on a Network Volume (NAS)

Purpose: while iMovie ’09 allows you to store your events and projects on physically attached hard drives (external or internal) it doesn’t offer an out-of-the-box way to store them on a network attached storage (NAS) device. I have a file serve and I want to use it.

Read the rest of this entry »

Script: clean_bzip – a command line program for clean directory compression

A simple command-line python utility that compresses a directory (or directories) and excludes certain unwanted files.

Read the rest of this entry »

django-hitcount: simple app to count hits/views for an object

django-hitcount: a simply django application that allows you to count hits/views on a per object basis. This app came about as an answer to my own question at stackoverflow.com. Am hoping that others will find it useful.

Read the rest of this entry »

Replacing the Capacitors on my Netgear GS108

I got back from vacation recently and found that my Netgear GS108 gigabit switch had died — or rather, it was flashing green lights at me left and right and — even worse — very inconsistenly, at that. Sometimes off, sometimes on … didn’t seem to matter what machines were plugged in.

Read the rest of this entry »

New Server: AMD 4850e with RAID 5

Well: the time finally came for me to bite the bullet and buy a new home server. This new machine is replacing my circa 1999 Dell Pentium III 550mhz box that has been running, faithfully I might add, in my basement for the last couple of years as a NAS.  It will also replace the laptop with the broken screen in the basement, which has been serving as my web server.  Since: my file transfer speeds were so appalling (~10MB/s), I am running out of hard drive space, and the box sounds like it is ready to take off at any moment (I don’t think there are any ball bearings left) I thought it prudent to bit the bullet and get a new server.

Read the rest of this entry »

How To: Test Connection Speed Between Two Machines

Purpose: as a quick diagnostic tool, sometimes it’s nice to know exactly how fast two machines can (theoretically) be connected.  I was having some slow downs on my NAS and using these command line tools, was able to determine that it was my NIC (and not my hard drives) that was causing the slow down.  I learned this from a thread at slashdot.

Read the rest of this entry »

How To: Automated Encrypted Incremental Backups on Amazon S3 with Duplicity (OS X or Ubuntu)

Purpose: setup an automatic encrypted off-site backup system that utilizes Amazon S3 with incremental backups by duplicity on the Mac (Leopard) or Ubuntu. Currently, I do have my own on-site backup system in place (nightly backups via rsync to external hard drive), but I am wary that some day my house may explode and I’ll have nothing left. Enter my new friend: the encrypted off-site backup.

Read the rest of this entry »