Posted on May 27, 2009

Installing the Cisco VPN Client on Windows 7

This set of instructions exists more or less on more than one site, usually completed by a few follow-up comments. For my own sanity and future reference, these are the 100% reproducible set of installation instructions, which prevent a nasty BSOD when trying to use the Cisco VPN Client:

  1. If you tried previously to install the Cisco VPN client, uninstall it and reboot.
  2. Run the Citrix Deterministic Networks Update (DNEUpdate) that is appropriate for your architecture.
  3. Reboot.
  4. Take Ownership of and then delete c:\Windows\System32\drivers\ndis.sys
  5. Take Ownership of and then delete c:\Windows\System32\drivers\en-us\ndis.sys.mui
  6. Install the VPN Client. I used version 5.0.05.0290, but I have heard that 5.0.04.0300 works as well.
  7. Reboot. Allow Windows to repair itself. This takes about 30 seconds.
  8. Your PC will complete a final reboot itself.

This worked like a charm for me and, from what the rest of the interwebs are saying, works for most everyone else.

Update: As noted in the comments below, this only works for 32-bit installations of Windows 7.

Posted on Jan 16, 2009

Inserting video content into a LiveJournal comment

Yesterday I was looking for good instructions on inserting video content into a LiveJournal comment (for someone else) and couldn’t find any. So, after being successful, I felt it my geek duty to write up my directions in case, some day someone else needs them. It’s a calling, I guess?

lj-post-embedLiveJournal’s post editor very easily supports inserting media content into posts. There’s a semi-friendly GUI which lets you insert an <embed> block from any major video hosting site (e.g. youtube, photobucket, vimeo, etc.) quickly and easily. The comment editor, however, is just a textarea, so if you want any formatting you’re left to write the HTML yourself. This is no big deal for some, but even most HTML novices only know the basic five html 4.01 tags (a, img, b, i, u), which are fine for 99% of such situations.

As an aside, I would love to rid the world of the non-xhtml-compliant formatting tags, but perhaps that’s just me.

Youtube object embedding dialogPosting video is a tad more work, though youtube, for instance, makes it painfully easy. They provide a handy dialog to the right of any video with all of the necessary <object> code. You can even customize the background, size, inclusion of related videos, etc. I have to hand it to the folks at youtubegoogle for understanding that their videos should be able to be seen from anywhere, not just their main site.

Well, anyway, youtube wasn’t my problem. Photobucket was. They provide you with an <embed> link only, and while that’s fine for the LJ post editor, it’s incomplete. Here’s a few quick steps to add the code necessary to adapt what Photobucket gives you to what is needed for a video to show up in a LiveJournal comment.

Photobucket

<embed width="448" height="361" type="application/x-shockwave-flash" wmode="transparent" src="http://i32.photobucket.com/player.swf?file=http://vid12.photobucket.com/albums/abc/UserName/Video/fileName.flv">

Youtube

<object width="480" height="295">
	<param name="movie" value="http://www.youtube.com/v/9hIQjrMHTv4&amp;hl=en&amp;fs=1"></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<embed src="http://www.youtube.com/v/9hIQjrMHTv4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>
</object>

Using the Youtube code as a reference, you only have to make a couple of changes:

1. Replace the <embed src=""> code with what Photobucket provides:

<object width="480" height="295">
	<param name="movie" value="http://www.youtube.com/v/9hIQjrMHTv4&amp;hl=en&amp;fs=1"></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<embed src="http://i32.photobucket.com/player.swf?file=http://vid12.photobucket.com/albums/abc/UserName/Video/fileName.flv" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed>
</object>

2. Your photobucket video dimensions may be different, so you’ll need to fix the height and width in both locations: the <object> tag and the <embed> tag.

<object width="448" height="361">
	<param name="movie" value="http://www.youtube.com/v/9hIQjrMHTv4&amp;hl=en&amp;fs=1"></param>
	<param name="allowFullScreen" value="true"></param>
	<param name="allowscriptaccess" value="always"></param>
	<embed src="http://i32.photobucket.com/player.swf?file=http://vid12.photobucket.com/albums/abc/UserName/Video/fileName.flv" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="448" height="361"></embed>
</object>

…and that’s it. It’s not at all difficult, but if you’re someone (else) that doesn’t need or want to know the difference between an <object> tag and an <embed> tag and why you need both to properly display inline video, a couple of simple steps to make your online life easier can make all the difference.

Posted on May 31, 2008

Set Up WebDAV for iCal Sharing on ubuntu 8.04

Enabling WebDAV for iCal publishing/sharing is fairly straightforward:

0. Install apache2 (if it’s not already installed):

sudo apt-get install apache2

1. Create a WebDAV directory in your DocumentRoot with the proper permissions:

mkdir -p /var/www/webdav
chmod -R 777 /var/www/webdav

2. Edit Apache2′s dav_fs.conf file:

cd /etc/apache2/mods-available
sudo vi dav_fs.conf

DAVLockDB /var/lock/apache2/DAVLock


DAV On
DAVMinTimeout 600
DAVDepthInfinity On

AllowOverride AuthConfig
AuthName “DAV Restricted”
AuthType Basic
AuthUserFile /etc/apache2/.htaccess

Require valid-user

3. Create symlinks to the proper DAV module files:
(Some of these will already exist. Leave them alone.)

cd ../mods-enabled
sudo ln -s ../mods-available/dav.load
sudo ln -s ../mods-available/dav_fs.conf
sudo ln -s ../mods-available/dav_fs.load

4. Create the ‘AuthUserFile’ indicated in step 2:

sudo htpasswd -m -c /etc/httpd/.htaccess webcal

5. Restart apache:

sudo /etc/init.d/apache2 restart

6. Publish your iCal!

Your url for publishing should now look like http://mywebhost/webdav/iCal/. Enjoy!

Based on a guide for Fedora at millan.info.

Posted on May 17, 2008

Cygwin Prompt Here (for tcsh)

In a post I can no longer find, Scott Hanselman blogged about a registry entry to add a “Command Prompt Here” item to Windows’ right-click context menu. This has, many times, saved me almost 30 seconds of opening cmd.exe and typing out a ridiculous CD statement. Since then, however, I’ve found myself using Cygwin a lot more than cmd as it gives me a lot more power in an environment with which I’m much more familiar. (Some things are kinda wonky [pathnames, for instance] but it’s more user-friendly to me, and I can’t quite get into PowerShell like some of my more Windows-oriented friends.)

Because of my Cygwin-love, I’ve found myself using the Command Prompt Here context-menu item, and then immediately entering tcsh and doing what needs to be done. I can’, then, double Ctrl-D my way out of the window since cmd has no clue what Ctrl-D is. It’s annoying, but it means I have to take the extra two seconds to type ‘exit’. So, throwing any concept of cost/benefit out the window [though, those four seconds probably add up to like... 30 minutes of lost productivity a year], I investigated how to do the same thing for Cygwin.

Somebody figured this out already, so all that was left was for me to have it run tcsh instead of bash, and I was all set. This was painfully simple. Here’s the registry script I’m using:

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\TcshHere]
@="&Cygwin Prompt Here"

[HKEY_CLASSES_ROOT\Directory\shell\TcshHere\command]
@="c:\cygwin\bin\bash.exe --login -c \"cd '%1' ; exec /bin/tcsh\""

[HKEY_CLASSES_ROOT\Drive\shell\TcshHere]
@="&Cygwin Prompt Here"

[HKEY_CLASSES_ROOT\Drive\shell\TcshHere\command]
@="c:\cygwin\bin\bash.exe --login -c \"cd '%1' ; exec /bin/tcsh\""

Posted on Apr 20, 2008

Newseum: Today’s Front Pages

The other day, I caught a post on Signal Vs. Noise about using Automator in OS X to grab your favorite newspaper’s front pages from Newseum as PDFs and join them. This sounded like a great idea, so I set out to do just that.

Unfortunately for me, this particular workflow only works in OS X 10.5, and I have yet to upgrade my iMac past 10.4.11.

Undaunted, I replicated the same thing in perl. It turns out that the “Combine PDF Pages” automator action is a simple Python script. It looked semi-useful on its own, so I copied it from its normal home (/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/) to my personal bin directory for good measure. Perl source follows… please note that the >’s are rendering as literal &gt;’s. Silly Code Highlighter!

#! /usr/bin/perl -w

use locale;
use strict;
use warnings;

#############################
#  [01-31]      [yyyy-mm-dd]
my ($day,       $date,      $tmpdir,              $tojoin) =
(`date +%d`, `date +%F`, '/Users/shelton/tmp', '');
chomp($day); chomp($date);

my ($join) =
("python /Users/shelton/bin/join.py -o '/Users/shelton/Desktop/$date.pdf'");

########################
# Define PDF Links Here
#
my (%papers) = (
# Boston Globe
0=>"http://www.newseum.org/media/dfp/pdf$day/MA_BG.pdf",
# Chicago Tribune
1=>"http://www.newseum.org/media/dfp/pdf$day/IL_CT.pdf",
# Buffalo News
2=>"http://www.newseum.org/media/dfp/pdf$day/NY_BN.pdf",
# NY Times
3=>"http://www.newseum.org/media/dfp/pdf$day/NY_NYT.pdf",
# Wall Street Journal
4=>"http://www.newseum.org/media/dfp/pdf$day/WSJ.pdf"
);

######################################
# Loop through %papers
#  -> Determine tmp output file
#  -> Download the File
#  -> Add file to string for join cmd
#
foreach my $page (sort(keys %papers)) {
my $output = "" . $tmpdir . "/" . $page . ".pdf";
`wget -q -O $output $papers{$page}`;
$tojoin .= "'" . $output . "' ";
}

##################
# Join The Files!
#
`$join $tojoin`;

#############################
# Delete All Downloaded PDFs
#
foreach my $file (sort(keys %papers)) {
my $rm = "" . $tmpdir . "/" . $file . ".pdf";
`rm -f $rm`;
}

I suppose I could have picked more interesting papers (like, for instance, the Amazônia Hoje from Belém, Brazil). I stuck to papers from my current and previous home towns (and the NYC area, because they have interesting papers). Boring? I know…

I run this daily from cron at about 7am. Of note, I also redirect all output of the script to /dev/null because the python script throws a ton of meaningless errors that don’t mar the output.

Posted on Feb 21, 2008

Floppy Disk Pen Holder

2/20/2008Quite a while ago, my wife left me alone at home for an evening with nothing to do. Arguably, I could have cleaned or something, but I was feeling crafty, and had happened upon a tutorial on Instructables for creating a Floppy Disk Pen Holder. I looked at the first page, totally grokked the idea, and whipped up two of these utilitarian beasts of burden.

I must admit that this is an almost perfect re-purposing of “things I was going to throw away some day”. I’ve seen nifty uses for discarded recordable CDs and DVDs, as well as spindle containers. I usually recycle the latter and shred the former, but were I to ever actually require a bagel carrier, I know where I’d get one!

Speaking of re-use, I think I have five more floppies lying around somewhere, and should be able to construct a third pen cup at some point. It would have to be a gift since I have, at this point, max’d out my ratio of floppy-disk-pen-cups to desks.

Posted on Feb 20, 2008

Keeping SSH connections open (in PuTTY)

putty tcp keepaliveLifehacker posted an article this morning about keeping SSH connections open in Linux (which was just a re-posting of an article on FOSSwire).

This is helpful for all of those Linux users out there, but for those of us who have a Windows desktop with the same needs, the solution is a bit different. If you use PuTTY (or PuTTY Tray, like me), there’s a field for Seconds between keepalives on the Connection configuration pane. Check out the image at right for the rockin’ detail.