Craig Thrall

Previous | Page 9 of 13 | Next

Column Guidelines in Visual Studio 2005

March 30, 2008, 8:53 p.m.

Thanks to <a href="http://blogs.msdn.com/saraford/archive/2004/05/05/257953.aspx">Sara Ford's awesome article</a>, I just added column guides to Visual Studio 2005 on my development machine.

Code File for Global.asax

March 26, 2008, 7:40 a.m.

Unlike a typical .aspx page, when I created a Global.asax page in my ASP.NET 2.0 project (Visual Studio 2005), I ended up with a single page with script in it. I wanted to put my code in a separate file, but it wasn't immediately clear how to correctly do that. <a href="http://aspadvice.com/blogs/kiran/archive/2005/12/11/14301.aspx">Kiran Chand has a blog post</a> that tells you how to do this, and it worked for me. Thanks Kiran!

Programming Will Always be Fun

March 19, 2008, 9:50 a.m.

From a <a href="http://www.linuxjournal.com/article/7035">Brian Kernighan interview in Linux Journal</a>: <blockquote>LJ: Could you say that you love computers (IT)? BK: No. There was a time when they were incredible fun to work with, and I really enjoyed programming and getting the machine to do things, but it was never my whole life. And modern systems are so messy and complicated that they are more frustrating than rewarding most of the time. It's still pretty easy to get completely wrapped up in trying to write a program, though; that will always be fun.</blockquote>

Blast From the Past

Feb. 14, 2008, 11:06 a.m.

<img src="http://images.apple.com/keyboard/images/wireless_keyboard20070813.gif" alt="Apple wireless keyboard" /> <img src="http://www.digibarn.com/collections/devices/pcjr-chicklet-keyboard/TN_Image13.JPG" alt="Freeboard" />

Using SSH Keys on Windows

Jan. 28, 2008, 8:55 a.m.

Install the OpenSSH and keychain packages in Cygwin. Then, run ssh-keygen. Don't make the mistake of not entering a passphrase. You will now have a private and public key pair generated in ~/.ssh. Use scp to copy your public key to the server you want to access, like this: scp id_rsa.pub username@server:.ssh Then, ssh to the Linux server and append your new public key to the authorized_keys file in ~/.ssh: cat id_rsa.pub >> ~/.ssh/authorized_keys Now, logout from the server and try ssh'ing back in. It should ask you for your passphrase. This means ssh on the server side found your public key in the authorized_keys file and wants to make sure it's you. Let's make it even easier. Edit (or create) a new .bash_profile in your home Cygwin directory. It should look something like this: # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs eval `keychain --eval id_rsa` That last line will run keychain, which is a wrapper for ssh-agent, with your private key. ssh-agent caches your ssh keys and will provide them to any clients (ssh, scp, etc.) who are connecting to a host that has your private key in the authorized_keys file. Now try closing your Cygwin window and opening a new one. If this is the first time you're running keychain since you logged into Windows, it will ask you for your passphrase. This is the password for the key you created with ssh-keygen. Enter it, then try to ssh to your Linux server. You shouldn't have to enter a password.

Copying Only New Files on Windows

Jan. 9, 2008, 3:43 p.m.

Something I've had to do a couple times is copy "new" files, where new files are defined as files created since some timestamp. Say the timestamp is today: <pre> for /f "tokens=2,3,4 delims=/ " %%i in ('date /t') do set TIMESTAMP=%%i-%%j-%%k xcopy /d:%TIMESTAMP% srcpath\* destpath >> logs\%LOGFILE% 2>&1 </pre>

IE6 Crashing on Startup?

Dec. 14, 2007, 9:25 a.m.

See <a href="http://support.microsoft.com/kb/942367">http://support.microsoft.com/kb/942367</a>. This just started happening to me after installing the latest batch of security updates. IE6 would open, start loading my home page, then crash. Following the instructions in that KB fixed my crash without having to uninstall any of the updates or disable HTTP 1.1.

Emacs and XML

Dec. 7, 2007, 10:47 a.m.

This is old stuff, but I just found it. Here's the <a href="http://www.xmlhack.com/read.php?item=2061#id5376111">blog post</a> that led me to <a href="http://www.thaiopensource.com/download">nxml</a>, a XML mode for Emacs written by <a href="http://www.jclark.com">James Clark</a> (author of <a href="http://www.jclark.com/xml/expat.html">expat</a>, an awesome XML parser I use very frequently). I can't believe I didn't find this before, it makes XML editing in Emacs much nicer.

Ubuntu and Windows Shares: PyNeighborhood FTW

Nov. 1, 2007, 9:41 a.m.

After a few years of using dated distributions, I am continually impressed by Ubuntu. I wanted to mount a Windows share on my Linux box. Googling led me to <a href="http://pyneighborhood.sourceforge.net">pyNeighborhood</a>. Before I installed it, I ran a <code>locate</code> and noticed I had at least one file (on a default Ubuntu install) with the name pyNeighborhood, so I tried running it. Ubuntu told me that it wasn't installed, and I should run apt-get to install it. I did, and it installed pyNeighborhood for me. Sweet. So far, I am liking apt-get way more than rpm. Of course, I'm just a developer/Linux hobbyist, not an admin who with a local repository that updates many machines. I found <a href="http://grumpymole.blogspot.com/2006/11/xubuntu-browsing-samba-shares-with.html">some instructions</a>, and created a mount point in my home directory I had write access to. Then I changed the mount point in the pyNeighborhood preferences. Voila! Now I can copy that huge file straight to my Linux box. Awesome.

Upgrade Ubuntu 7.4 to 7.10

Nov. 1, 2007, 9:01 a.m.

I recently upgraded my Linux box from Ubuntu 7.4 to 7.10, and it went pretty smoothly. There was only one hiccup: when I ran <code>update-manager -c</code> to check for a new distribution, I got a Python error that was along the lines of <code>global name 'dbus' is not defined</code>. I found <a href="https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/118862">this bug</a> that helped. Just go to <code>/usr/lib/python2.5/site-packages/UpdateManager</code> and edit <code>DistUpgradeFetcher.py</code>. After the line that reads <code>import urllib2</code>, add the following: <pre> import os import dbus </pre> Run update-manager again and you should be good to go.