How to Protect Yourself from Viruses and Spyware

# Filed on by / reply

The number one best way to protect yourself against viruses, spyware, and other malware is to throw away your Windows PC and buy a Mac.  Malware is virtually unheard-of on Mac computers, partly because there are fewer Macs than Windows PCs, but also because the Mac is built on an operating system where security is a primary concern, as opposed to Windows where security has been an afterthought.  And nowadays you can have a Mac and also run Windows on it, either by dual-booting or via virtualization, so you can still use Windows whenever you need to.

The second best way to protect yourself from malware is to stop using Internet Explorer, and use Mozilla Firefox instead.  That’s because today, a huge percentage of malware infections occur through bugs in Internet Explorer.  Microsoft eventually patches these holes, but inevitably there’s a delay between the discovery of the bug and the distribution of the fix, which means there’s a period of time where you’re exposed.  The safest thing to do is to avoid IE entirely and just use Firefox.

What if you’re already infected with some nasty virus/spyware/malware?  First, if you don’t already have an antivirus program installed, then install one ASAP, such an Norton or McAfee.  Then make sure it’s fully up to date -- it will download new virus signatures daily, because new viruses are released daily.  Next install Windows Defender.  An AV program and Windows Defender will catch and remove a lot of stuff, but some things will slip through.  For those, you can try installing Spybot Search & Destroy, or, another program that I discovered today while disinfecting a family member’s PC, SuperAntiSpyware.

But even with all of those programs installed, it’s still possible to get infected.  Sometimes running a full system scan with each program will fix the problem, but some malware gets so deep into the system that the only solution is to format your hard drive and reinstall Windows from scratch.

Indeed, even if you can successfully remove the malware from your system, you can never be fully certain that part of it isn’t left hiding somewhere, just waiting to come to life at a later date -- or still running, silently & invisibly, and sending your personal information out to some bad guys somewhere on the net.  So if you really want to be safe, you might consider formatting & reinstalling anytime you get a malware infection.  Yes that’s a hassle, but would you really feel safe doing things like online banking or shopping on a system that had been compromised in the past?  I know I wouldn’t.

Upgrade to 64-bit Linux, Get Half a Gig of RAM for Free

# Filed on by / reply

About 18 months ago I upgraded my workstation from a Pentium III 850 MHz system to an Intel Core 2 Duo (2.4 GHz) system.  In addition to the giant CPU upgrade (triple the MHz and dual-core) I also doubled the RAM from 2 GB to 4 GB.

With 2 GB, my system was swapping quite often, because Firefox and Thunderbird are memory hogs, because I run Firefox with 30+ tabs constantly, and because I always have many, many xterms, gFTPs, and text editors (Adie) running.  With the upgrade to 4 GB of RAM, my system would run swap-free for a few days, which was a beautiful thing.

But inevitably FF and TBird’s memory usage would creep up, and the number of xterms/gFTPs/editors I was running would steadily increase as my system was up for weeks and months on end.  So after the first few days of uptime, the swap would slowly start being utilized again.

Well a couple weeks ago I finally got around to switching my system from the 32-bit version of Ubuntu to the 64-bit version.  I used the release of Hardy Heron as an excuse to wipe the system clean (which had been upgraded from Dapper to Edgy to Feisty to Gutsy) and do a new install using the amd64 ISO image instead of the i386 image.

Because of limitations inherent in running a 32-bit operating system, the maximum addressable RAM is something like 3.3 GB, so even though I’d had 4 GB installed, I could only use 3281 MB of it (as shown by the "free -m" command).  After installing 64-bit Hardy Heron, though, the available RAM jumped to 3887, over 600 MB more!  Between that and the fact that Hardy includes Firefox 3 (beta), which has a smaller memory footprint than Firefox 2, my system is now swap-free all the time.

Happy Half a Million!

# Filed on by / 5 replies

It’s not exactly a birthday, but yesterday, encodable.com hit half a million visitors since we started logging back in 2005 -- with VisitorLog of course.

That’s not half a million "hits" or "page views" but actual unique visitors.

In 2005 we received about 21,000 visitors; in 2006 it was 142,000; and in 2007 we had 259,000 visitors.  Can’t complain about that kind of growth, and thanks to great customers like you, we’re looking forward to the next half a million in the next year or two!

PSA For Web Developers Who Only Test in Safari

# Filed on by / reply

Here’s a Public Service Announcement for web developers who only test their websites in Safari.

Safari happens to do high-quality (but slower) image scaling, so that if the dimensions that you specify for an image don’t match the image’s actual dimensions, it’ll still look decent.  But other browsers do lower-quality (but faster) image scaling, which makes such an image recognizable, but jaggy.

This means that the 1000x1000 pixel image which you’ve stuffed into a 50x50 pixel spot on a web page looks like absolute crap in most browsers, even though it looks decent in Safari.  So instead of trying to stuff an image into a container of the wrong dimensions, you should rescale the image in your photo-editor first, then specify the correct dimensions in your web page.

Copy Videos from TiVo to iPod (or iPhone), Mostly Automatically, Using Linux, Mac, or Windows

# Filed on by / reply

If you have a Series 2 TiVo connected to your home network, then you can use its built-in web server to copy video files from the TiVo to a computer.  From there, you can convert the files to an iPod/iPhone-friendly format, then import them into iTunes or whatever other app you use to manage your portable device, and finally sync the videos to your portable device.

(Unfortunately, this functionality has apparently been killed in the HD Series 3 TiVo, thanks to the trifecta of stupidity that is Hollywood, cable companies, and government.)

The first step is to find your TiVo’s MAK (media access key).  This number is a security code, and it’s listed in your TiVo’s Settings menu under System Information.  The MAK is used as a password to access the files on your TiVo over your network.

Now you need to get the video files from the TiVo to your computer.  This is known as TiVoToGo, and there are a few dedicated apps that handle this, such as TiVo Desktop for Windows or Toast for Mac, or TiVoDecode Manager for Mac.  And actually, all of those apps will also take care of converting the file to an iPod-compatible format and even auto-importing it into iTunes, so for many people they provide the complete solution.

Those apps don’t help Linux users, though.  And although I have a Mac Mini that I use to manage my iPhone, it’s relatively slow (1.5 GHz G4 PPC) and small (80 GB).  My main workstation runs Ubuntu Linux, and is much faster (2.4 GHz Core 2 Duo) with much more space (let’s just say it’s more than a TB), so it’s much better suited to video processing and archival.  Based on these Geekbench scores, my Core 2 Duo system is probably about 4x more powerful than my Mini.

So to copy videos from the TiVo to a Linux system, we just need to access the TiVo’s built-in web server directly, by opening a web browser and going to https://tivo-ip-address/.  Alternatively, you can use the nowPlaying.xhtml file (found here and mirrored here), which gives a nicer interface to your TiVo’s web server; just adjust the IP address and the MAK near the top of the file, then load it into your browser from your local filesystem.  At some point, the server will prompt you for a login; the username is "tivo" and the password is your MAK.

The download links from the TiVo’s web server will give you files with a *.TiVo extension.  I name the files "Show Name - Episode Name.TiVo" or "Show Name - date.TiVo"; you should too.  Once the *.TiVo file is on your system, you just need to run my TiVo-to-iPod-backend script on it.  To make this simple, I use a Gnome right-click action on the *.TiVo file: just right-click on it and choose Open With, then select TiVo-to-iPod, which is a small launcher script that opens an xterm and then in turn calls TiVo-to-iPod-backend.  (Note: remove the .txt extensions from those scripts after downloading them; then put the scripts into your /usr/local/bin/ directory and chmod them a+x or 0755.)

Here’s what the TiVo-to-iPod-backend script does:

First, it calls tivodecode to convert the *.TiVo file into an MPEG2 (*.mpg) file.  As the instructions on the tivodecode page state, you’ll need to have put your MAK into the ~/.tivodecode_mak file for this to work.

Second, it calls ffmpeg to convert the *.mpg file into a *.mp4 file, resizing the video in the process to 480x320 for my iPhone’s screen.  You can adjust that number for your own iPod, and also adjust the bitrate parameter (which I have set to "-b 300k") in order to get higher quality or smaller file size.  I also use "-croptop 6" in the command because the videos coming out of my TiVo have a few pixels’ worth of noise/static at the top; if yours don’t, then you can remove this parameter.  For reference, this turns an hour-long 1.2 GB *.mpg file into a ~200 MB *.mp4 file in about 12 minutes on my Core2Duo system.

Third, it calls AtomicParsley in order to set the tags on the *.mp4 file.

Finally, it uses scp to copy the file to my Mac Mini; I had previously set up passwordless SSH keys so that on my local network this works without me having to type in the password.  Of course if you’re not copying to a Mac system then you can delete this part of the script.

At this point, the *.mp4 file is ready to be imported into iTunes or any other app that can handle syncing your iPod.  I wanted to automate this step too, so I created a small script called add_videos_to_iTunes.applescript on my Mac Mini.  I modified my crontab so that the system calls this script every 10 minutes.  The script simply scans a folder called /Users/me/video/todo -- the folder that my TiVo-to-iPod-backend script copies the files into -- then moves the files into /Users/me/video/iTunes, and finally tells iTunes to add the files to its library.

With all of this in place, all I need to do is visit my TiVo’s web server about once a day, download the videos that I want, then right-click on them and choose TiVo-to-iPod.  The 2 scripts (one on each system) take care of converting the files and adding them to iTunes, so all I need to do is put my iPhone in its cradle as usual, and iTunes auto-syncs my TV shows just like it does my podcasts.

NB: I’ll probably make the TiVo-to-iPod script into a cronjob too, and I could even automate the process of scraping the TiVo web server page and downloading the *.TiVo files, but for now, this system is reasonably automated for my liking.

Mac OS X Network Problem: Slow Remote Login (SSH): Fixed

# Filed on by / 1 reply

Sometime over the past few months, it started to take a really long time to SSH into my Mac Mini from my Linux system.  They’re both on a 100 megabit LAN, but from the time I’d type "ssh user@mini" on my Linux system, it took exactly 30 seconds for the "Welcome to Darwin" message to appear.  So obviously it was waiting for some kind of timeout to expire.

The fix was to edit the /etc/hosts file on the Mac Mini and add a line for the Linux system; now logging in via SSH is instant.  So it looks like the Mini was for some reason trying to do a reverse DNS lookup on the incoming IP, and timing out since I’m not running a local DNS server.  Various websites suggested disabling IPV6 on the Mac, but that didn’t help.

Live Search Referrer Spam

# Filed on by / 1 reply

Microsoft’s Live Search is really starting to irritate me.

As this log snippet from VisitorLog shows, I get about 30 separate hits per day from hosts named livebot-65-55-*-*.search.live.com.  The vast majority of them are bots, not real humans, as evidenced by the fact that they have no screen resolution (and therefore no screen), which while not a guarantee of botness, is a pretty strong sign of it, especially when combined with other bot-like characteristics such as having "livebot" in the hostname.

So far this is all OK.  However, the bot’s USER_AGENT string is set to IE7/Win2003, which is bogus [the full string is: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322)].  It’s clearly a bot, and possibly a spider, so it’s not a real IE7 browser; it should identify itself with an accurate user-agent string like a responsible internet citizen.

And what’s worse is that, unlike most bots/spiders, this one actually has a non-null HTTP_REFERER string: it claims to have come from Microsoft’s Live Search engine, searching for extremely generic single terms like "files" for which my site isn’t even in the first 10 pages of search results.  The only logical conclusion I see here is that Microsoft is doing some serious referer spamming to get hits back to its Live Search pages.

This has been going on since November 21st, but for months before that, the exact same thing had been happening except that the hostname was bl2sch1082113.phx.gbl (or similar) instead of livebot-65-55-*-*.search.live.com.

Now don’t get me wrong: spiders are good.  I like spiders crawling my sites, and I’d really like for Google to have some strong competition in the search space.  But faking your user-agent and spoofing the referer field with bogus data aren’t good practices for a search engine.  Someone please tell me there is a valid explanation for this.

How To Fix a Broken Mac

# Filed on by / reply

My Mac Mini system (1.5 GHz G4) suddenly refused to startup: it got stuck on the gray screen with the Apple logo in the middle and the spinning progress meter at the bottom.  I let it sit there for 30-60 minutes a few times, and overnight for about 8 hours another time, but it never got past that screen.  From other systems, I was unable to SSH into the Mini, so it was stuck somewhere before the network connection could be brought up.

I was able to boot into single-user mode by pressing Command-s (actually Win-s on my keyboard) at the startup sound, at which point I ran fsck, which claimed to fix a couple of minor-looking issues, but the system still would not start up fully.  Rebooting into single-user mode again and attempting to run "sh /etc/rc" as the screen suggested, I got the following errors:

[...]/IOKit ... Reason: image not found
couldn’t find root user ... sleeping and trying again

Those errors just repeated over and over on the screen.

I booted from my OS X installation DVD (by rebooting with the DVD in the drive and pressing c at the startup sound) and ran its "Repair Disk" and "Repair Permissions" tools, neither of which solved the problem.

I disconnected everything except for the keyboard, mouse, and monitor, but it didn’t help.

I booted into single-user mode and recreated the netinfo database, but that didn’t help.

I reset the PRAM by holding Command, Option, p, and r (really Win, Alt, p, and r) at startup, but that didn’t help.

I tried to boot into safe mode (by holding the shift key during boot) but the system still never got past the gray Apple-logo screen.

Finally I booted from the OS X installation DVD and did an "Archive and Install" which got the system working again.  This didn’t actually auto-import my users, settings, files, etc (the option was grayed-out), but it did preserve all the files from the previous installation (including all user files) in a new top-level directory called "Previous Systems."  So it was basically a new, clean installation, but I still had all my files.

search posts:

[ archives ]