Archive for the 'Linux' Category

01
Jul
10

Of Synergy and cross-over cables

The last few months have been very eventful. I finished writing my thesis, did my thesis defense, graduated, moved, and started my new job.  I’m getting close to the end of my second week in the new position and during that time I’ve been gradually getting my office set up the way I want it.

My main work computer is a Windows 7 PC but I also have a Mac Mini that I use for cross-platform testing and other various activities.  I have two monitors attached to my PC and one connected to my Mac.  Since I have two computers but I only want to use a single keyboard and mouse, I had two options: using a KVM switch with the V part disconnected (thereby only using the keyboard and mouse) or use Synergy.

I’ve used a KVM switch before without the video switching and it’s incredibly confusing.  I’ve also used a KVM switch with video switching and it’s pretty inconvenient.  So, I decided to use Synergy.  Read on for how I got it all set up.

Continue reading ‘Of Synergy and cross-over cables’

Advertisements
19
Jan
10

Adventures in awk

I’ve been working on a literature review lately so I’ve been sifting through tons of articles.  In my search, I’ve come across a few bibliographies of papers on specific topics which were compiled by researchers interested in those topics.  When the bibliography is reasonably small (in the case of a very narrowly defined topic), it’s usually fastest to sift through it by hand to find articles that might be of interest.  However, the most recent bibliography I found contains 8342 papers.  I am definitely not about to print that out and go through it by hand.

This bibliography is available as an EndNote library file and as a Rich Text Format (rtf) document.  Apparently, if you have a recent version of EndNote installed you can use its search features to sift through the data.  However, the file won’t open in EndNote 6, which is what I have on my laptop.  Zotero wouldn’t import it either.  I tried using the built-in search capabilities in Word and even jEdit on the rtf but nothing could provide me with what I wanted.  Basically, I wanted the ability to export entries that matched a given search criterion to a separate file.  Presumably, there are programs that can do this for you, but I don’t know of them and don’t have them installed.

In the end, I decided to convert the rtf to a simple txt file.  This put each entry on its own line.  With each entry occupying a single line in the text file, I just needed some way to search for a given term and then output each line that contains that term.  I have used sed and awk a little bit in the past and I knew that there must be some way to do that with either or both of those, so I looked into their syntax online.  I found this awk tutorial and, using the examples there, I was able to put together a command that does exactly what I needed:

awk '/term/ {print $0}' < bibliography.txt > term.txt

where “term” is replaced by whatever term you want to match.  You can further automate this by putting a bunch of these commands into a shell script or writing a little Perl program that will take a command line argument and insert it as “term” in the command.

Now I have a list of papers related to all the terms I’m interested in and I’ve got a fast way to search for further terms in the future if I need to.  The approach is a little “awk”ward (groan!) because I have to run it in Linux and I use Windows most of the time.  I no longer have Linux installed as a virtual machine on my laptop and I don’t even have Cygwin installed anymore.  So, I had to upload my text file to one my research group’s Linux servers, run the scripts, and download the results back to my laptop.  Once I figured out what I needed to do it took me less than half an hour to do it, though, so even if it’s kludgy, it’s still a lot faster than reading through the bibliography manually.

UPDATE: I just realized that all I did was replicate the functionality of grep using awk.  That is, I could achieve the same result with the following code:

grep term < bibliography.txt > term.txt

Additionally, it turns out that you can produce this functionality with sed as well, using the following code:

sed -n 's/term/&/p' < bibliography.txt > term.txt

I guess I missed the fact that I could use grep because I started thinking about using sed or awk before I converted the file to plain text.  Each entry was spread over multiple lines so I was thinking about needing something fairly sophisticated.  I know that grep can do regular expressions but my first thought went to sed and awk, which are like one logical unit in my brain because of the O’Reilly books that cover both.

11
Dec
09

Windows 7 woes

We recently got a new computer to replace Rechner.  It came with Windows Vista but since MIT has a site license to Windows 7, I installed that immediately after receiving the computer.  It’s been running fine for about a week, I guess, but today it started acting up.  I was using it this morning and the system hung a couple of times for 20-30 seconds each time.  I didn’t know what the problem was, so I used the tried and true approach: reboot.

However, upon rebooting, I was greeted with a message that Windows Explorer had crashed.  I tried restarting Explorer but it crashed again.  I tried rebooting a couple more times but to no avail.

So far, each crash has been one of two types:

Problem Event Name: APPCRASH
Application Name: Explorer.EXE
Application Version: 6.1.7600.16404
Application Timestamp: 4a765771
Fault Module Name: ntdll.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5be02b
Exception Code: c000041d
Exception Offset: 000000000003d8db
OS Version: 6.1.7600.2.0.0.256.4
Locale ID: 1033

or

Problem Event Name: InPageCoFire
Error Status Code: c000009c
Faulting Media Type: 00000003
Damaged File Name: SyncCenter.dll
OS Version: 6.1.7600.2.0.0.256.4
Locale ID: 1033

The second one has been more prevalent by far.  Generally, if the first one is observed, it occurs first thing after a reboot.  All subsequent crashes are of the second type.  So, I searched for this information online.

Unfortunately, I haven’t been able to locate any information on this particular type of error.  A search of “Windows 7” + InPageCoFire + SyncCenter.dll returns no hits on Google.  However, I did find some general advice, suggesting that reverting to an older known-good restore point could help.

So, I got out the install DVD and used it to go back to an earlier restore point.  I noticed that there was a restore point from early this morning, just prior to a critical update having been installed. I figured this must of have caused the problem so surely, reverting to the restore point prior to the update would fix it.  Unfortunately, it did not.

I tried reverting to an even earlier restore point.  That still didn’t help.  So, I tried running the built-in memory diagnostics.  That didn’t appear to produce any errors but I can’t be sure because it’s supposed to give you a report once you restart the machine and log in to Windows.  I can never get far enough to see the report.

I just downloaded memtest86+ and I’m running that right now.  My current expectation, however, is that there are no problems with the memory.  Rather, I expect that somehow SyncCenter.dll (and possibly ntdll.dll)  got corrupted.  I don’t know how to fix that.  I had a similar problem back in Windows 95 with some corrupted DLLs.  I ended up solving the problem by copying the affected DLLs from a friend’s computer.  However, I don’t know if I’ll be able to take that approach this time because I can’t even use Windows Explorer.  Perhaps I could use a Linux Live CD and the necessary DLLs on a USB drive to make the switch.

Or, I could just reinstall the OS.  When I installed the OS, I partitioned the 640GB drive into two partitions: 150GB for the OS and programs (on C:) and about 450GB for my data (on D:).  This would enable me to wipe the C drive and reinstall without requiring me to recopy all my data.  We’ll see.  If I end up having to spend much more time on this, I’m just going to wipe the drive and start over.

If anyone reading this has any suggestions on things I could try, please let me know in the comments.  Thanks!

UPDATE 1: According to this site, SyncCenter.dll is statically linked to ntdll.dll and won’t run properly if ntdll.dll is corrupt or missing.  So, maybe SyncCenter.dll is OK and the real problem is ntdll.dll.  I’ll have to see if I can find a way to replace this file.  Also, memtest86+ completed with no errors, so the problem doesn’t appear to be RAM-related.

UPDATE 2: After a bit more digging online, I found some references to problems with Windows Explorer crashing because of a weird interaction with Firefox.  I tried to uninstall Firefox but Windows Explorer crashed too rapidly for me to even open the Uninstall Programs window.  So, I booted into Safe Mode.  I was curious to see whether I still got the crashes.  I did.  Fortunately, in Safe Mode I managed to uninstall Firefox.  I rebooted into regular Windows, but much to my chagrin, Windows Explorer crashed again.

Earlier in the evening I had posted my problem on a Microsoft forum but I subsequently decided that all this troubleshooting was for the birds and that I should just go ahead and reinstall the OS.  The last time around, I had used my university’s site license to install Windows 7 Enterprise.  However, with the possibility that my problem was due to the corruption of a file, I wondered about how reliable it was to download a nearly 3GB ISO file via wireless, burn it on a DVD and then install it.  Fortunately, I had also bought a copy of Windows 7 Professional from Win741.com for $30 earlier this fall.  I paid a bit extra and had them send me a disc.  I decided I would use this disc to reinstall Windows 7 since it was a pressed DVD and is probably more reliable from a data integrity standpoint than a downloaded 3GB ISO image burned on a DVD.

The installation went fine.  A clean install seems to generally take 20-30 minutes, which I think is pretty reasonable for an operating system.  I used Ninite to install a bunch of software we use.  Importing all my music into iTunes was easy – I had spent some time cleaning up my iTunes library with my last install and since I had put all that data on my data partition, it was easy to import again.

Importing photos into Picasa looks like it’ll take a bit more work.  The photos themselves are no problem; the problem lies with the face recognition.  When I copied all our pictures over from the old hard drive, the face “groups” were preserved (in the .picasa.ini files in each folder containing photos) but the names associated with those groups were not.  So, I didn’t have to do any obnoxious manual sorting like I did when I first installed Picasa on our old machine but I did have to input names to go with those face groups or at least connect those face groups to contacts from my wife’s set of Gmail contacts.

This time around, it looks as though the face who were connected to Gmail contacts have had those connections preserved while it looks like I’ll need to reenter the names of people (mostly children) who weren’t in my wife’s contact list and whose names I had entered manually.  I’m going to let it crank over night and in the morning I’ll see what needs to be done.

In any case, I hope the curious case of the crashing Windows Explorer doesn’t rear its ugly head again.  Though, if it does, hopefully, by then I’ll have received a useful answer to the question I posted on the forum.

30
Sep
09

Installing CUPS on Ubuntu 9.04 (jaunty)

In my last post I mentioned that I completed the migration of this blog from the old host machine (called imladris) to WordPress.com. This is part of a larger effort to retire that machine altogether. It had been hosting my blog, my photoblog, our family photo gallery, and my wife’s old blog for years. In addition, for the last few months I’ve been running a CUPS server on it so we could easily use our printer from any of our machines (we have 4 computers in the house, not including imladris). However, last night I pulled the plug on imladris. So, if we want to have our printer on the network again, I either need to buy a dedicated print server or I need to install CUPS on a different machine. Fortunately, we have another Linux machine in the apartment: orthanc, which I use as my MythTV machine.

I had installed CUPS on imladris only a few months ago, so the process should still be fresh in my mind. However, imladris ran Ubuntu 6.06 LTS, whereas orthanc runs Ubuntu 9.04. I’m not exactly sure whether 3 years* has made much of a difference but I’m going to try to follow online explanations to get it working. As I work on this, I’m just going to give an account of what I’m doing, where I found instructions, etc. until I get it working. If you’re interested in this, read on. If you’re not, maybe you can find a more entertaining way to spend your time, like playing Canabalt.

Continue reading ‘Installing CUPS on Ubuntu 9.04 (jaunty)’

11
Sep
09

Happy Birthday Rechner

My wife and I celebrated our 7th anniversary in August this year.  Since our wedding, we’ve resided in 3 different places and encountered numerous other changes.  However, one of the constants for most of that time has been our main desktop computer, which is called “Rechner” on the network.

I just checked my records and it shipped from Dell on September 5th, 2003.  We likely received it about a week later.  So, we’ve had it almost exactly 6 years.

Over the years, it has undergone quite a  few changes.  It’s a 2.4GHz Pentium 4 with a 800MHz front-side bus.  The processor, the motherboard, and the case are about the only components that are original but they have been a solid core around which to build.  A new graphics card required that I upgrade the power supply (now 500 W).  I expanded the RAM from 512MB to 1.5GB.  I’ve upgraded or swapped out hard drives a couple of times.  I’ve upgraded or swapped out optical drives a couple of times as well.  The floppy drive was replaced due to fatal dust intake but its replacement has also succumbed…

Despite the upgrades, the fact remains that it is a single core processor with an 800MHz FSB connecting to pretty slow RAM and it’s definitely showing its age in terms of performance.  When we finally retire it, it will likely find new life as a Linux machine for my daughter.  Until then, I expect it will continue to chug along like it has been doing almost uninterrupted for 6 years.  Thank you, Rechneer, you’ve served us well.

07
May
09

MythTV upgrade

In February of last year, I finally succeeded in installing MythTV on a computer that a friend gave me.  I used Mythbuntu, which (in my admittedly limited experience) is the best way to install MythTV.  It’s been working pretty well since last February but recently a number of issues cropped up that made me decide to do an upgrade of both the software and the hardware.  What follows is the reasons behind the upgrade, a description of the upgrade, and a few pitfalls and solutions that I experienced along the way. Continue reading ‘MythTV upgrade’

04
Sep
08

Migrating photo galleries

If you have kids and live away from your extended family, online photo galleries are pretty much a necessity these days. I’ve been running one on this server since 2004, when our daughter was born. I’ve been using Gallery v.1 and it’s worked out pretty well for me. However, as I get closer to graduating, I’m aware that my ability to host this site will change. Figuring out what changes to make and actually making those changes could be both time-consuming and headache-inducing.

Continue reading ‘Migrating photo galleries’




Calendar

August 2019
S M T W T F S
« Nov    
 123
45678910
11121314151617
18192021222324
25262728293031

Recent Twitterings

Follow Me on Twitter

RSS That to which I am listening

  • An error has occurred; the feed is probably down. Try again later.
Advertisements