Free graphics software for Windows

Even people who use Windows exclusively have probably heard of The Gimp, which Linux and Unix users often proclaim as the “free alternative to Adobe Photoshop.” While Photoshop is in no danger of being displaced in the industry, Gimp is certainly more than adequate for most use.

But installing it in Windows has never been easy, unless you knew a well-kept secret: the URL for Installers for Gimp for Windows. (The Windows page at gimp.org is pretty intimidating.)All you need to do is download both files, the GTK+ 2 toolkit and Gimp for Windows. Install GTK+ first, then install Gimp, and you’re golden. Although the current version 2.0 is still pre-release, it’s much nicer than the “stable” 1.2 release–it has more features and a better user interface, and frankly, I don’t find it any less stable.

You’ll almost definitely want to keep the link to Grokking The Gimp handy. It’s a professionally written book that’s freely distributable, or, if you prefer, you can buy a print copy. Gimp is easy enough to understand if you have a guide, but you need a guide. Given that book, even a drawing klutz like me was able to do some drawings that turned heads. (Paper buildings on a model railroad layout, in my case.)

The copy of GTK+ on the Installers for Gimp for Windows site is also the secret to getting the Win32 port of Sodipodi up and running. Sodipodi is a free vector drawing program, similar in function to Adobe Illustrator, Macromedia Freehand, or Corel Draw. While not as full featured as the current version of any of them, again, it’s good enough for most casual use. Don’t be put off by its low version number; its primary author is a perfectionist. It’s at least as stable as most of the commercial low-end graphics programs I’ve seen for Windows.

There is no equivalent to Grokking The Gimp yet for Sodipodi. This Sodipodi Guide will get you started.

If you want to play around with graphic design and can’t afford to buy Photoshop and Illustrator (even the educational prices can be a bit high for some people), playing with Gimp and Sodipodi is a good way to learn the basics in order to see if you even want to learn more about drawing with a computer. Who knows, the current or some future version may even prove to be all you need–saving you from ever having to buy the commercial software.

Optimizing dynamic Linux webservers

Linux + Apache + MySQL + PHP (LAMP) provides an outstanding foundation for building a web server, for, essentially, the value of your time. And the advantages over static pages are fairly obvious: Just look at this web site. Users can log in and post comments without me doing anything, and content on any page can change programmatically. In my site’s case, links to my most popular pages appear on the front page, and as their popularity changes, the links change.

The downside? Remember the days when people bragged about how their 66 MHz 486 was a perfectly good web server? Kiss those goodbye. For that matter, your old Pentium-120 or even your Pentium II-450 may not be good enough either. Unless you know these secrets…

First, the simple stuff. I talked about a year and a half ago about programs that optimize HTML by removing some extraneous tags and even give you a leg up on translating to cascading style sheets (CSS). That’s a starting point.

Graphics are another problem. People want lots of them, and digital cameras tend to add some extraneous bloat to them. Edit them in Photoshop or another popular image editor–which you undoubtedly will–and you’ll likely add another layer of bloat to them. I talked about Optimizing web graphics back in May 2002.

But what can you do on the server itself?

First, regardless of what you’re using, you should be running mod_gzip in order to compress your web server’s output. It works with virtually all modern web browsers, and those browsers that don’t work with it negotiate with the server to get non-compressed output. My 45K front page becomes 6K when compressed, which is better than a seven-fold increase. Suddenly my 128-meg uplink becomes more than half of a T1.

I’ve read several places that it takes less CPU time to compress content and send it than it does to send uncompressed content. On my P2-450, that seems to definitely be the case.

Unfortunately, mod_gzip is one of the most poorly documented Unix programs I’ve ever seen. I complained about this nearly three years ago, and the situation seems little improved.

A simple apt-get install libapache-mod-gzip in Debian doesn’t do the trick. You have to search /etc/apache/httpd.conf for the line that begins LoadModule gzip_module and uncomment it, then you have to add a few more lines. The lines to enable mod_gzip on TurboLinux didn’t save me this time–for one thing, it didn’t handle PHP output. For another, it didn’t seem to do anything at all on my Debian box.

Charlie Sebold to the rescue. He provided the following lines that worked for him on his Debian box, and they also worked for me:

# mod_gzip settings

mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_add_header_count Yes
mod_gzip_minimum_file_size 400
mod_gzip_maximum_file_size 0
mod_gzip_temp_dir /tmp
mod_gzip_keep_workfiles No
mod_gzip_maximum_inmem_size 100000
mod_gzip_dechunk Yes

mod_gzip_item_include handler proxy-server
mod_gzip_item_include handler cgi-script

mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/postscript$
mod_gzip_item_include mime ^application/ms.*$
mod_gzip_item_include mime ^application/vnd.*$
mod_gzip_item_exclude mime ^application/x-javascript$
mod_gzip_item_exclude mime ^image/.*$
mod_gzip_item_include mime httpd/unix-directory
mod_gzip_item_include file .htm$
mod_gzip_item_include file .html$
mod_gzip_item_include file .php$
mod_gzip_item_include file .phtml$
mod_gzip_item_exclude file .css$

Gzipping anything below 400 bytes is pointless because of overhead, and Gzipping CSS and Javascript files breaks Netscape 4 part of the time.

Most of the examples I found online didn’t work for me. Charlie said he had to fiddle a long time to come up with those. They may or may not work for you. I hope they do. Of course, there may be room for tweaking, depending on the nature of your site, but if they work, they’re a good starting point.

Second, you can use a PHP accelerator. PHP is an interpreted language, which means that every time you run a PHP script, your server first has to translate the source code into machine language and run it. This can take longer than the output itself takes. PHP accelerators serve as a just-in-time compiler, which compiles the script and holds a copy in memory, so the next time someone accesses the page, the pre-compiled script runs. The result can sometimes be a tenfold increase in speed.

There are lots of them out there, but I settled on Ion Cube PHP Accelerator (phpa) because installation is a matter of downloading the appropriate pre-compiled binary, dumping it somewhere (I chose /usr/local/lib but you can put it anywhere you want), and adding a line to php.ini (in /etc/php4/apache on my Debian box):

zend_extension=”/usr/local/lib/php_accelerator_1.3.3r2.so”

Restart Apache, and suddenly PHP scripts execute up to 10 times faster.

PHPA isn’t open source and it isn’t Free Software. Turck MMCache is, so if you prefer GPL, you can use it.

With mod_gzip and phpa in place and working, my web server’s CPU usage rarely goes above 25 percent. Without them, three simultaneous requests from the outside world could saturate my CPU.

With them, my site still isn’t quite as fast as it was in 2000 when it was just serving up static HTML, but it’s awfully close. And it’s doing a lot more work.

 

Easy and secure remote Linux/Unix file transfers with SCP

Sometimes you need to transfer files between Linux boxes, or between a Linux box and some other box, and setting up Samba or some other form of network file system may not be practical (maybe you only need to transfer a couple of files, or maybe it’s just a one-time thing) or possible (maybe there’s a firewall involved).
Well, you should already have SSH installed on your Linux boxes so you can remotely log in and administer them. On Debian, apt-get install ssh sshd. If you’re running distro based on Red Hat or UnitedLinux, you may have a little investigative work to do. (I’d help you, but I haven’t run anything but Debian for 2 or 3 years.)

The cool thing about SSH is that it not only does remote login, but it will also do remote file transfer. And unlike FTP, you don’t have to stumble around with a clumsy interface.

If you want to transfer files from a Windows box, just install PuTTY. I just downloaded the 240K PSCP.EXE file and copied it into my Windows directory. That way I don’t have to mess with paths, and it’s always available. Make sure you’re downloading the right version for your CPU. The Windows NT Alpha version won’t run on your Intel/AMD/VIA CPU. Incidentally, Putty.exe is a very good Telnet/SSH client and a must-have if you’re ever connecting remotely to Unix/Linux machines from Windows.

SSH includes a command called SCP. SCP works almost like the standard Unix CP command. All you to do access a remote file is append a username, followed by the @ sign, and the IP address of the remote server. SCP will then prompt you for a password.

Let’s say I want to move a file from my Linux workstation to my webserver:

scp logo.jpg root@192.168.1.2:/var/www/images

SCP will prompt me for my password. After I enter it, it’ll copy the file, including a nice progress bar and an ETA.

On a Windows machine with PuTTY installed, simply substitute the command pscp for scp.

I can copy the other way too:

scp root@192.168.1.2:/var/www/index.php .

This command will grab a file from my webserver and drop it in the current working directory.

To speed up the transfers, add the -C switch, which turns on compression.

SCP is more secure than any other means of file transfer, it’s probably easier (since you already need SSH anyway), and since it’ll do data compression, it’s probably faster too.

FTE – a DOS-style editor for Linux

I don’t remember what I was looking for, but I found another DOS-style editor for Linux and Unix.

FTE is another editor that harkens back to the look of the typical DOS app of about 10 years ago, similar to SETEDIT. For casual editing, either program will do very nicely, and provide a look and feel comparable to the QuickBasic-derived editor that came with DOS 5 and 6.

Read more

Time for a core dump

I’ve been keeping a low profile lately. That’s for a lot of reasons. I’ve been doing mostly routine sysadmin work lately, which is mind-numbingly boring to write about, and possibly just a little bit less mind-numbingly boring to read about. While a numb mind might not necessarily be a bad thing, there are other reasons not to write about it.
During my college career, I felt like I had less of a private life than most of my classmates because of my weekly newspaper column. I wrote some pretty intensely personal stuff in there, and frankly, it seemed like a lot of the people I hung out with learned more about me from those columns than they did from hanging out with me. Plus, with my picture being attached, I’d get recognized when I went places. I remember many a Friday night, going to Rally’s for a hamburger and having people roll down their windows at stoplights and talk to me. That was pretty cool. But it also made me self-conscious. College towns have some seedy places, you know, and I worried sometimes about whether I’d be seen in the vicinity of some of those places and what people might think.

Looking back now, I should have wondered what they would be doing in the vicinity of those places and why it was OK for them to be nearby and not me. But that’s the difference between how I think now and how I thought when I was 20.

Plus, I know now a lot fewer people read that newspaper than its circulation and advertising departments wanted anyone to think. So I could have had a lot more fun in college and no one would have known.

I’m kidding, of course. And I’m going off on tangent after tangent here.

In the fall of 1999, I willingly gave up having a private life. The upside to that is that writing about things helps me to understand them a lot better. And sometimes I get stunningly brilliant advice. The downside? Well, not everyone knows how to handle being involved in a relationship with a writer. Things are going to come up in writing that you wish wouldn’t have. I know now that’s something you have to talk about, fairly early. Writing about past girlfriends didn’t in and of itself cost me those relationships but I can think of one case where it certainly didn’t help anything. The advice I got might have been able to save that relationship; now it’s going to improve some as-yet-to-be-determined relationship.

There’s another downside too. When you meet a girl and then she punches your name into a search engine, if you’re a guy like me who has four years’ worth of introspective revelations out on the Web, it kind of puts you at a disadvantage in the relationship. She knows a whole lot more about you than you do about her. It kind of throws off the getting-to-know-you process. I’d really rather not say how many times that’s happened in the past year. Maybe those relationships/prospective relationships were doomed anyway. I don’t have any way of knowing. One of them really hurt a lot and I really don’t want to go through it again.

So I’ve been trying to figure out for the past few weeks what to do about all this. Closing up shop isn’t an option. Writing strictly about the newest Linux trick I’ve discovered and nothing else isn’t an option. Writing blather about the same things everyone else is blathering about is a waste of time and worthless. Yes, I’ve been saying since March that much, if not all, of the SCO Unix code duplicated in Linux is probably BSD code that both of them ripped off at different points in time. And now it’s pretty much been proven that I was right. So what? How many hundreds of other people speculated the same thing? How could some of us be more right than others?

I’m going to write what I want, but I’m having a hard time deciding what I want to write. I know I have to learn how to hold something back. Dave Farquhar needs a private life again.

For a while, this may just turn into a log of Wikipedia entries I made that day. Yes, I’m back over there again, toiling in obscurity this time. For a while I was specializing in entries about 1980s home computing. For some reason when I get to thinking about that stuff I remember a lot, and I still have a pile of old books and magazines so I can check my facts. Plus a lot of those old texts are showing up online now. So now the Wikipedia has entries on things like the Coleco Adam and the Texas Instruments TI-99/4A. Hey, I find it interesting to go back and look at why these products were failures, OK? TI should have owned the market. It didn’t. Coleco should have owned the market, and they didn’t. Atari really should have owned the market and they crashed almost as hard as Worldcom. So how did a Canadian typewriter company end up owning the home computer market? And why is it that probably four people reading this know who on earth I’m talking about now, in 2003? Call me weird, but I think that’s interesting.

And baseball, well, Darrell Porter and Dick Howser didn’t have entries. They were good men who died way too young, long before they’d given everything they had to offer to this world. Roger Maris didn’t have an entry. There was more to Roger Maris than his 61 home runs.

The entries are chronicled here, if you’re interested in what I’ve been writing lately while I’ve been ignoring this place.

How to remember lots and lots of stuff

I’ve been slogging away in nostalgiaville, writing obscure stuff over at Wikipedia again (once an addict, always an addict, even if the addiction hurts you), and I started wondering about something. Why is 20 years ago easier for me to remember than last week?
I think there are two reasons for that, but if I go off exploring those, I’ll never get back on track. I stumbled across a web site today called Supermem. It extols the virtues of repetition for memory. It’s really heavy reading and not terribly eloquent, at least I don’t think. I think the author’s strategy is showing off how much stuff he can remember and trying to make you jealous, in the meantime arguing that even ordinary people, given enough knowledge, can become geniuses. And maybe the people he cites in his stories are examples of people who became geniuses through knowledge.

And I’ve mostly summed up what he spent pages and pages saying.

The basic premise is that knowledge isn’t everything but it sure can add value to anything else you have, and from the outside, sometimes knowledge can look like everything. But we forget lots of things. The key to remembering things is repetition. The hard part is coming up with a strategy for repetition that works.

Of course he has a solution. As you might have guessed, he wants to sell you something. In this case, it’s a piece of commercial software.

The only reason I didn’t scramble for the back button right then and there was because old versions of the program–specifically, the DOS and Win3.1 versions–are now public domain. And the program inspired a similar Linux program called Memaid. So you can try it out without spending any money.

So here’s how it works. Take some things you don’t want to forget, then figure out how to phrase them in the form of a question. Then you enter those things into the program. It drills you. And it figures out how often you need to repeat something in order to retain it.

The idea is to establish a pattern. Seek out things you won’t want to forget. Then figure out how to restate those things in Q&A form. Enter them into the program, then spend 30 minutes a day with the program. If you do both–learn at least one new thing every day and drill on the old stuff–you’ll accumulate a body of knowledge.

Here are a couple of examples from my job:

Q: What’s the optimal Linux command to create/write images of floppy disks? (The device name will vary in other Unix-like environments)
A: dd if=/dev/fd0 of=(filename) bs=18k
dd if=(filename) of=/dev/fd0 bs=18k

Q: What’s the DOS command to rewrite the boot record on a hard drive that won’t boot or has been corrupted by a boot-sector virus?
A: fdisk /mbr

Q: What’s the web site I can go to in order to find the geographic location of an IP address?
A: www.networldmap.com

And I would do well to add some specific questions to the list as well, such as, “What’s the primary nameserver at our Sunset Hills office?”

So if you want to sound like William F. Buckley Jr. and not come off like an idiot–like one person I know who likes to pepper the dictionary.com word of the day into everything he can, except he frequently misspells or misuses it–add that. If your goal is to lose as many coolness points as possible, put things like Vanilla Ice’s real name in there. If I’d known about this program when I was in college, I’d have put my Spanish vocabulary words and verb conjugations in there, and today I’d be able to say more than just hablo pocísimo español without embarrassing myself. (And for all I know, you’re not supposed to put the -ísimo suffix on poco and when I do it, I come off like someone who would say no sabo. OK, so I guess I do remember a little Spanish, but not enough to hold much of a conversation.)

It’s an interesting idea. I think I’m going to give it more than just a try.

Putting every question I ask Charlie (along with the answer) in there would be a good start.

More on building under a small Linux environment

Well, I’ve been playing a little bit with Erik Anderson’s uClibc-based development environment mentioned in the previous two posts.
When I compile, I issue the command export CFLAGS='-Os -s -mcpu=i386 -march=i386' to create small-as-possible binaries. Using the default flags, the Links web browser balloons to nearly 2.6 megs on my dual Celeron, mostly due to the debug symbols. It drops to around 760K with those options. Specifying i386 binaries shrinks them down at the expense of some speed on some CPUs (especially 486s and first-generation Pentiums), so you have to set your priorities. It doesn’t matter nearly as much on newer CPUs. But I’m pretty sure if you’re interested in uClibc you’re not just running it on Pentium 4s.

For the record, Links compiles without warnings without doing anything special to its configuration and seems to run without incident (I immediately used it to locate and download more source code to compile). Samba’s more difficult, giving some warnings in various places. It may or may not require some special configuration in order to actually run (I didn’t have time tonight to test it), and of course that could result in some reduced functionality. The binaries total 9.3 meg, which isn’t bad considering it implements a complete Windows NT-compatible file server as well as some simple client utilities for connecting to NT shares on a network. The files themselves are about 20% smaller than on a stock Debian system.

Erik Anderson says the majority of Unix software will compile under uClibc, which is probably true. I generally see compiler warnings occasionally even when using a completely mainstream system.

That wasn’t the Sunday I had planned

I was hoping that by now I would be upgraded to WordPress, the successor to the b2 blogging program that I use, and that I would have a running DietLinux box on some system, and that I’d be coming back to you with some cool tricks you can do with a Knoppix CD.
I’m 0 for 3.

WordPress is up and running inside my firewall, and there are some nice things about it, but if I move, I lose some stuff. Such as? Most of the code I had Steve write for me won’t run under WordPress. No recent comments, no scoring whatsoever, and searching gives you the posts, rather than links to the posts, which could be deadly if you searched for the word “the.”

Seeing the entries right away when you do a search or hit a category link is fine on blogs that don’t have a lot of entries, but when I have 1,200+ of them, that’s bad. It’s better to return titles with links to the entries.

What do I gain? The ability to make entries and not publish them just yet. The ability to close entries to comments. Movable Type-compatible pingbacks and trackbacks. In a future version, multiple categories per post. That’s all worth a lot.

So I’ll move. Not just this weekend, sadly.

A big chunk of the day went to fixing Gatermann’s web server. The nice thing about Linux is you never have to reboot it. (If you run Debian, you can even upgrade across versions without having to reboot.) The bad thing about Linux is that since you never have to reboot it, if you power it down, you really don’t have much way of knowing if the system’s going to come back up. After jumping through way too many hoops, we got the thing booted with a rescue disk, and when I looked at it, I couldn’t figure out how the system ever booted the first time. For one thing, I couldn’t find a kernel. Obviously at some point in this system’s life, something went horribly, horribly wrong.

Nothing we could think of would repair it, so we ended up archiving all the important stuff like /etc, then wiped and reinstalled. I’m sure if we’d persisted, we could have brought it back to life, but from the time he got here to the time I started reinstalling, three CDs had played on my stereo. I can install Debian in 15 minutes on a fast system, and 35 minutes on a slowpoke.

Don’t get me wrong, I’m not mad or upset or anything. I’m a little disappointed that I wasn’t able to fix it in 10 minutes though. But then I remember that two of those CDs that played during that timeframe were by The Cure. If two hours straight of The Cure doesn’t make you feel a a little down on yourself, nothing will.

But I’ll have to give Bob and his revolving door of bandmates credit for making me think about it. There was a time when I would have given almost anything to be the biggest Unix guru in St. Louis. That’s over. These days system wizardry is a means to an end. It pays me enough money to give me a house in a middle-class neighborhood, and a car that’s practical yet draws looks, and leaves enough left over to do nice things for people. Although the job can be demanding, I have more free time than Dad ever had. I mean, I found out this morning that three of my friends have started a band and I got to hear a very early mix of their CD. I can get excited, because I’ve got enough time to at the very least go see them. And if they need someone to write some propaganda for them, I can do that.

After dinner, I re-tackled the WordPress project, but that part of my brain’s just fried. I had to laugh at a question Steve asked me in e-mail. He asked why weekends take more out of him than the workweek. I know the answer to that one. Since we’re low-tier aristocrats, we’ve always got stuff that needs to be done. And the stuff around the house can very easily be more draining than the stuff we do for 40 hours a week. And when the workweek gets to be too much, you just call up a friend and take a long lunch–make up the time at the end of the day after everyone else has left and the office is quiet–and talk about home ownership and other low-tier aristocratic things to get your mind off work.

So as much as I’d love to go find some vexing question and solve it and then turn it over to Google to direct people with the question to my answer, I just don’t have it in me. Not today. And thinking about work to try to escape the drains of low-tier aristocracy seems, well, sick.

A Peter Gabriel CD and a book would be really good right about now.

A text-mode download manager for Linux/Unix

Way back when, I used to use a program in Windows called Gozilla to speed up my downloads. The problem with it was that Gozilla was invasive and contained a spyware payload. Competing programs emerged, but it seemed like the biggest added feature was always more spyware. So I gave up on HTTP download accelerators.

Read more

DietLinux — a Linux that boots in under 10 seconds

The tinkerer in me just couldn’t stay away. I saw a reference on Linux Weekly News to DietLinux and had to look at it.
DietLinux is an example of a Linux distribution that can’t properly be called GNU/Linux, because the majority of its userspace didn’t come from the GNU project. GNU’s libc–the main API for Unixish systems, and I’ll call Linux a Unix just to hack off SCO–is replaced with an alternative, trimmed-down libc called dietlibc. It’s not feature-complete but it’s tiny. Those of you who programmed casually in the 1980s and 1990s probably remember a day when you could write a fairly sophisticated program in a few kilobytes. Under modern operating systems, a simple program that simply emits “Hello, world!” can take up 32K or more. Using dietlibc instead of GNU’s libc shrinks that program back down to a couple of kilobytes.

The majority of DietLinux’s userspace comes from Felix von Leitner, the author of dietlibc. Von Leitner reimplemented init–the program that bootstraps a Unix system once the kernel is loaded–and getty, which is the program that handles text-based logins. These unglamorous programs can eat up a fair chunk of memory, and since Unix systems typically go for long periods of time without being rebooted, it’s a bit of a waste unless you need certain features provided by the more traditional init and getty programs. He also wrote replacements for several standard utilities.

Obviously, not every program in the world designed for glibc will compile and run under dietlibc, so DietLinux won’t ever be a complete general-purpose distribution. But for network infrastructure glue-type servers providing services like firewalling, DNS and DHCP (all of which already function), it would be perfect.

I don’t know what the future plans for DietLinux are. The asmutils provide an impressive number of userspace and server utilities, written in assembly language with very low overhead, and would appear to be a nice complement to DietLinux’s infrastructure. Their use would limit DietLinux to x86, however. And the text editor e3 is tiny, full-featured, and emulates keybindings for vi, emacs, WordStar, and Pico, so it’s friendly to pretty much any command-line jockey regardless of heritage and takes little space.

It’s also not a newbie distribution. Installation requires a fair bit of skill and pretty much requires an existing Linux system to bootstrap it.

But it’s definitely something I want to keep an eye on. I’m highly tempted to put it on one of my 486s. I just wish I had more time to mess around with it.