August 2006

Evil wget isn’t as evil as regular wget

Compiling wget for Windows is not a difficult task, but there is almost no good documentation out there to help. This guy has a decent guide. I use Visual Studio 2005, but Microsoft gives away a free version that will work just as well for this purpose. Wget depends on openssl (to connect to secure http servers) and openssl requires perl to build. You can skip the whole installing ActivePerl step and grab a pre-compiled version. (You’ll want to get the zipped precompiled copy of OpenSSL linked to on that page.)

After figuring this out, I compiled evil wget for Windows. You’ll need the OpenSSL DLLs in the same directory. Also, evil wget is improved. Now it fakes its User Agent to pretend to be IE 6. This means that clever admins who block by user agent are out of luck. Blocking by IP is always an option though. Source is here. There are also binaries for OS X and Linux. Both depend on OpenSSL.

By the way, anyone using wget to retrieve files from a web server with password authentication should be careful. Wget tries using basic authentication, then digest auth if that fails. Even if your web server is properly configured to use digest authentication, wget will send your password out base64 encoded first. Most sniffers will recognize the string is base64 encoded and automatically decode the username and password. Think first before telling wget to use authentication as your credentials will be sent out for anyone to sniff. Use something like curl (http://curl.haxx.se/) instead.

Computers

Comments (0)

Permalink

LSCOLORS=ExFxCxDxBxegedabagacad

By default OS X Terminal doesn’t have colored output enabled for ls. Some people love colors in ls (me), others hate them. I like them, but the default colors aren’t very useful. Directories are blue, meaning they blend in very well with a black terminal background. It’s even worse if you’re using a blue background (such as the default Aqua background) and a translucent terminal. OS X uses a different format for its LSCOLORS environment variable than Linux, so it’s hard to figure out how to change the default colors and googling doesn’t help much. I threw together a JavaScript LSCOLORS generator as an exercise. It probably works on most modern browsers (I’ve tested it in Safari and IE 7) but I make no guarantees. I included a preview of what the colors will look like in a terminal. The colors aren’t perfect, but it’s not bad for toying around. Also, a note about why I have a bold checkbox for background colors: bolding the background causes the color to be lighter (bold brown is yellow in most terminals). This is not reflected in the preview, mostly because I don’t know all the quirks about bold backgrounds.

If I’m particularly interested, I might add Linux LS_COLORS to this also. The options are much more complicated (colors for any file extension, blinking, underlining, and other formatting options) so it would probably take me longer.

Oh yeah, here’s a link to the thing.

Computers

Comments (1)

Permalink