Half-Elf on Tech

Thoughts From a Professional Lesbian

Category: How To

  • Bugged

    While many Windows XP users are stressing over the major upgrade of SP2, Mac users got a tiny security patch, a small 10.3.6 upgrade, and a taste of our first, real virus. For years I got to brag about how my Mac would never get a virus and how I was safe because I didn’t have the flaws of Windows, or Outlook, or what have you. Then, right around Halloween, came the Opener malware script. It’s not a virus, but I’ll save that rant for another day. Opener has existed for Unix for years and since OS X is a Unix based operating system, it makes some small sense that Opener was adapted to a Mac platform. The benefit is that it’s a known entity and not all that hard to remove.

    Malware is software that does bad (mal) things. Opener is a shell script (similar to DOS) that attacks the root of your computer. Instead of emailing everyone you know, or deleting your user directory, Opener attacks your firewall, installs remote access software, plunks down a password decoder app (John the Ripper, of all things) and proceeds to take over your Macintosh. Pretty hefty for a first virus. Symantec calls it SH.Renepo.B, and their write up of it covers all its evilness in great detail.

    The blessing is that Opener has to be installed, either by hand or by another executable, and the safest way to prevent it from happening is to not install software you don’t get off a CD, lock your computer when you walk away, and use secure passwords. If you’re into filesharing, be it Limewire, Kazza or BitTorrent, be very careful. One of the ways this is distributed is in a PKG or DMG file, wrapped around the actually program you’re trying to install.

    None of this would have been possible if Macintosh hadn’t gone to OS X, the Unix based operating system.

    I hailed OS X as a fantastic leap forward for Macintosh. One of Mac’s many problems is the lack of software available. Sure, they have some of the best, native, handwriting recognition software ever (Newton 1.0 not withstanding) in Inkwell, and Microsoft 2004 is fantastic, but truly a fifth of the programs available for Windows can be found for Mac. By breaking Macintosh into the Unix world, suddenly Mac aficionados found themselves immersed in the open source world of Unix.

    Upgrading from System 9 to OS X was no mean feat and as with all upgrades, it’s not the sort of thing you should do on a whim. System 9 and OS X are as different as 95 and XP, just as System 7 to System 8 was giant Macintosh leap. The main problem everyone saw with OS X is that the majority of the software used had to be rewritten. To a degree, this backfired on Macintosh, as the prohibitive cost of upgrading hardware and software daunted a fair number of users. Apple built in a safety catch called Classic Mode, which let you run some (but not all) software via an emulator. I removed mine from my Mac after a year, having rarely used it.

    The other secret blessing was that Mac had been urging coders to move to a setup called ‘Cocoa.’ Cocoa apps had a fancier look and feel than the generic old school (classic) Mac, and a very different underlying structure. Microsoft, Adobe, and just about every major software company except Quark had jumped onto the Cocoa bandwagon, and many Mac users were pleasantly surprised at how much of their software simply worked natively on OS X.

    That was a very long digression to the heart of this tip, which is how to upgrade to Mac OS X.

    A lot of people are still on OS 8 or 9, and having been there, I tell you that you really need to upgrade. The actual upgrade process is not painless, and having heard the horror stories of XP SP2, I think they’re rather comparable. Unless you want to take your Mac to the Apple Store, you have to purchase the CD, and it’s not going to have the latest and greatest security patches. If you don’t have high speed internet, the upgrade will take a very long time (3 days on a 14.4 modem based on an upgrade I did last month).

    The first thing you have to know is that you must not, under any circumstances, simply throw in the CD and let it boot to the CD by holding down the magic C key. If your Mac didn’t come with OS X, the odds are that this will not work because your firmware is out of date. For most Mac users, this ‘firmware’ concept was new and unwelcome. I can count the times I’d ever done it on a Macintosh on one hand, and I’ve supported a lot of Macs.

    Apple.com has a great chart on which computers need an upgrade and where to get it. Surprisingly enough, the very new PowerMac G5s need an upgrade, while some iBooks from 2001 don’t at all. My rule of thumb is always to check if I need a firmware, as there’s no real way to know unless you memorize the list. If you happen to have OS X 10.0 or 10.1, you may have managed to upgrade without the firmware, and you’ll need to do it now to proceed. The catch here is that you have to apply these firmware bits with System 9. If you’ve already nuked your classic set up, you may be out of luck. Apple suggests that you start from System 9.2.2 at the lowest, though I’ve found you can upgrade from 9.1 in a pinch.

    Before you upgrade, remember to write down (or print) your internet settings. Yeah, I know it goes without saying, but having seen people call their ISP for tech support on getting a Mac set up at 3 AM, well, best to be safe. If you’re on dialup, go to Control Panels from the Apple menu, and then choose Remote Access from the submenu that appears. That’s where your ID, dial-up number, and password are kept. If you’re on DSL, check with your ISP, though I’ve found that my Macs auto-detect the setup very nicely.

    The next trick is actually upgrading. No matter what they tell you, don’t insert the CD and reboot, holding down the C key. While that might work for a new Mac, bought within the last two years, if your Mac is seriously older, you’re better off inserting the CD and clicking restart button from within the CD window that pops up. There are a few reasons for this, but the simplest one is that not all CD drives are created equal, and not all will reboot to the CD correctly. If you don’t start it from the CD, you may find yourself on a grey screen with a rainbow colored beach-ball, and a panic attack. Don’t worry, just reboot (unplug if you have to) and run it the other way.

    Once you get the upgrade started, go out for coffee. It takes a long time. Mac says 30-60 minutes. I say double it. After the whole thing was done, I still had about an hour or two of software updates, which was really frustrating. Even when I bought a new Mac from the store and asked them to run the latest updates, I found that I had a couple left when I got home. I chalk it up to bad timing, but it was really annoying. The software update feature’s been around since System 8, but I find it useful. I have mine set to check once a week (Thursdays, 7pm) and to download the update in the background. It slows my net imperceptibly, although I am on DSL, and when I tell it to install, it slashes the time for that considerably.

    Once everything is upgraded and done and configured, the actual ‘work’ takes less than an hour. Mac imports all your documents to their ‘new’ place, and if it didn’t, you still have access to the old sections. Most people I know did an ‘update’, leaving their old system files intact. I was the sort who backed up my documents and software, and did a full wipe the hard drive reinstall when I bumped to OS X 10.2. After all, I wanted the pure Macintosh feeling. The downside to that is you automatically loose Classic Mode, and any way of accessing the old Mac software. I didn’t find it a great loss.

    Mac has their own site all about why you should upgrade as well as one on why you should switch from Windows. I don’t think everyone should use a Macintosh, but I do think everyone who uses a Mac and can switch to OS X should. Mac’s aren’t for everyone, and while Mac pitches a hundred stories about people who love their Macs, I’m sure there are a hundred people who love their PCs. I’m not trying to start a flame war. I think people should keep an open mind. If all you want is email, word processing, and the web, a Macintosh may not be a bad idea.

    How to Upgrade: Switch to Mac

  • Hotlinking

    There are two questions I need to spell out for folks before I get into the code bits, and I’ll try to keep this as light-tech as possible. If you run a website, or have a free site, or just want to post your pictures on the web, you need to know this. If you have your own domain, you need to know this. If you post pictures to a bulletin board, you need to know this. Basically, if you use the internet at all, read this. I’ll let you know when you need to stop reading.

    Things everyone should know
    Things every webmaster should know
    Things every ISP should know


    Things everyone should know

    Bandwidth

    Bandwidth means, for computer users, the data transfer rate, or how much data can be transferred in a given time period. The easiest example here is how you access the net. If you use a modem for dial up (and I feel for you), then you use 14.4, 28.8, 33.6 or 54 kilobytes (kb) per second. To give you an idea how small a kb it, one letter (that is ‘a’ for example) is a kb, roughly. That’s not an exact science, but it’ll give you a rough idea. At 14.4, your email downloads at roughly 14 letters a second. Which is why dial-up sucks. In the world of computers, bigger bandwidth is better. The more bandwidth, the faster you can download the preview of the new Batman movie.

    In addition to speed, bandwidth also means how much data you can transfer in a given time period. This website has an allocation of 30 gigabytes of data per month, and we average about 5. My other website has the same allocation and averages 18. If I go over my data transfer for a given month, I can either pay out the nose for extra bandwidth, or I can let the site be shut down till the next month. The reason this is important to know, is if you run a website, every time a page loads, you use bandwidth. On a site like Yahoo! GeoCities, you get 3 GB/month. Yeah, you think that’s great, but it really sucks if you want to post things like a blog and people click here a lot. This aspect of bandwidth is the reason why most sites I design are low on the graphics. More graphics means more data transfered means more bandwidth used. In the case of data transfer allocation, bigger sites does not equal better, though bigger bandwidth is king.

    Then again, the bigger your site, the longer it takes to download, and the less time it takes for people on 56k to get pissed and tell you that you suck. Finding a webdesign that’s a balance between your dream design and speed is why people like me have jobs.

    In summation: Bandwidth controls how fast you can view the net from your home, as well as how much data a website can share with the world each month. Having more bandwidth is better all the time, but forcing users to use more bandwidth with image heavy sites and poorly coded web pages is not cool.

    Hotlinking

    Hotlinking is putting a link to someone else’s webpage’s graphic on your site. This is also called bandwidth theft. Directly linking to a website’s files (images, video, etc.) means that when someone accesses your website, they draw bandwidth from another. If you use an >IMG< tag to show a picture from someone else's page on your blog, forum post, or website, that's hotlinking. You're stealing their bandwidth. There is a case in which this sort of 'theft' is ethically permissible, though some webhosts don't like it. If you have multiple Yahoo! sites, and one is low on bandwidth, you can shuttle some of your content to the other site, and thus split up the bandwidth. This isn't always a good idea, as if it's against the Terms of Service on your host, they can kill you. Which is why you should always back up your websites on your on computer. If you own your own domains (like I do) and have multiple 'subdomains,' then it's okay to share an image. ipstenu.org is considered a different website that ipstenu.org/blog, so I have to tell my server it's okay to share between the two. But that's code geeky. What the common websurfer needs to know is this: direct linking to a picture, movie file, or any other content on someone else's site, unless it's a simple URL link to that site, is bad form, ethically asinine, and impolite. It’s akin to stealing electricity from your neighbor by plugging into their outlets.

    In summation: Hotlinking is stealing bandwidth from someone else’s website, and is considered to be unethical.

    Things every webmaster should know

    Now that you’ve gotten this far, we’re going into heavy geekitude. I have actually once had my site nearly shut down because someone was hotlinking to an image, and I had to figure out how to prevent it. This is the knowledge I share with you.

    Hotlink Prevention for Apache

    Apache is the de facto webserver for Unix. I don’t like IIS (Windows webserver) and so few people use Netscape’s webserver, I won’t even consider that anymore. Pretty much, I use Apache and if you don’t, I haven’t a clue how to help you.

    On Apache (and in theory this works on IIS, but as I said, I don’t use it), there is a file in the root of your html folder called .htaccess. This is an Apache directives file, or a config file, that controls how Apache handles the folders in the same folder as the .htaccess file. Your website has a folder, usually called public_html. Inside that folder you have things like a file named index.shtml and a folder named cgi-bin. Below is an example of what my webserver’s root public_html folder might look like.

        .htaccess    blog      index.shtml    images      cgi-bin   robots.txt
        folder1      folder2   foldern

    The .htaccess folder controls how the subfolders (blog, cgi-bin, folder1, folder2, and foldern) are handled. If I look at my .htaccess file, and you can open it up in your text editor of choice, I see this at the very bottom:

        RewriteEngine on
        RewriteCond %{HTTP_REFERER} !^$
        RewriteCond %{HTTP_REFERER} !^https://ipstenu.org/.*$      [NC]
        RewriteCond %{HTTP_REFERER} !^http://ipstenu.org/.*$      [NC]
        RewriteCond %{HTTP_REFERER} !^https://ipstenu.org.*$      [NC]
        RewriteCond %{HTTP_REFERER} !^http://ipstenu.org.*$      [NC]
        RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
    

    This means that I’m telling Apache to turn on the mod ‘RewriteEngine’ and to only permit my webpage (the HTTP_REFERER) to access the images. The images I list are in the ‘RewriteRule.’ I could use variables like ‘jp?g’, but I know what the file extensions are for the files on my server, and I cheat that way. If I wanted to be really mean, and didn’t worry so much about my bandwidth, I’d change the last line to RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ images/nohotlink.gif [L] so that when you try and link to /images/jojo.jpg, you’d get some witty image about how hotlinking is wrong.

    I actually do that on my other server, but the gif I use is 2k so it’s not something I worry about. It also makes it easy for me to later go back and see who’s been hitting that particular GIF and find the mean people. Yes, I have been known to send nasty notes to them.

    Keep in mind, as with any .htaccess rewrites, you may block some legitimate traffic (such as users behind proxies or privacy firewalls) using these techniques.

    Now here’s the big problem. Not all ISPs let you use the Rewrite mod! Half the reason I switched to my current provider was hotlinking (the other was SQL). The rewrite mod (module, don’t you know?) “provides a rule-based rewriting engine to rewrite requested URLs on the fly.” It’s totally magic, and I secretly adore it. It’s complex as fuck, though, and I still don’t really get all that it does. I do know that it works.

    Things ever ISP should know

    You’re a fucking bastard if you don’t let your users use mod_rewrite.

    Was that harsh? Sorry, I mean to say ‘You don’t give a rats ass about bandwidth if you don’t let your users use this.’ I’m well aware there are security ‘concerns’ about what mean people can do with it, but let’s face it, if someone’s smart enough to figure out everything you can do with mod_rewrite, then you’re in trouble anyway. There is a performance hit as every request is checked against the rewrite rules, so if you’re running an image intensive site, this can suck. But the trade off between performance and bandwidth are, to me, minimal.

    Look, if a user have a website with images, and some dickhead out there is hotlinking to that user’s images, then you, the ISP, have to handle the bandwidth crisis, and the pissy user asking you why he can’t use this feature to stop the dickheads?

    And speaking of security, I can’t find any hack for it. So if the fear is ‘really smart, but really evil people utilizing my server for nefarious purposes,’ I think that should be pretty low on the list. I’d put ‘spammer’ and ‘virus distributor’ ahead of it.

    Hotlinking can act like a DDoS attack, and if there’s ever a way to prevent it, by G-d, do it! The mod takes five fucking minutes to install.

    SimpleNet, I’m looking at you.