December 1, 2009 by Nick Moore
GNU Wget is a free utility for non-interactive download of files from the Web.
Source available from http://www.gnu.org/software/wget/. I downloaded version 1.12.
Builds and installs on OS X 10.6 with no problems (./configure, make, sudo make install). The manpage (man wget) describes all the options but has few examples.
To get one page on its own:
wget http://example.com/
Some options:
-p also download requisite files for displaying each downloaded page such as inlined images and referenced stylesheets
-r recursive download (follow links on pages and download those pages)
-l depth maximum recursion depth (default is 5, specify 0 or inf for infinite)
-k convert links for local viewing
-L follow relative links only (default is to follow all links on same host)
-H follow links to other hosts (default is not to)
-np do not ever ascend to the parent directory (not sure how this differs from -L exactly?)
-P dirname specify directory for downloaded files (default is .)
-N check timestamp and only download newer files
--mirror useful for updating a mirror with new/change files only: turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings; equivalent to -r -N -l inf –no-remove-listing
Get part of a site for local viewing with recursion depth 10:
wget -rkLnp -l inf http://example.com/page/
Posted in Uncategorized | Leave a Comment »
December 1, 2009 by Nick Moore
Posted in Uncategorized | Comments Off
October 18, 2009 by Nick Moore
A rational number is an ordered pair of coprime numbers
Posted in Mathematics | Leave a Comment »
October 18, 2009 by Nick Moore
Euclid’s algorithm finds the greatest common divisor of two positive integers.
Start with two positive integers.
1. If they are equal, stop. You have the GCD.
Subtract the smaller from the larger.
You now have three numbers. Discard the largest. Go to 1.
It works because a common divisor of two numbers also divides their difference.
Posted in Mathematics | Leave a Comment »
January 30, 2009 by Nick Moore
The plan:
Part 1. Command line tool. Configure it with podcast rss/atom url(s), and a place to store the downloaded files. Every time you run it it checks all subscriptions, and downloads all new episodes to specified location. That is all. Name of tool… melvyn
Part 2. Script to copy podcast any files not on mp3 player to mp3 player. (Mp3 player is mass storage device.) Possibly run auto when mp3 player is inserted. Possibly delete podcasts from device according to some rule.
All this to listen to In Our Time.
Update 1: Growl notification of new downloads would be nice.
Update 2: Some way of listing files waiting to be transferred to mp3 player. Simple text file I imagine. Plugin? (For the growl thing too?)
Posted in Uncategorized | Leave a Comment »
January 27, 2009 by Nick Moore
Before I knew that OS X (Leopard) came with Apache pre-installed, I downloaded the source from the Apache website, compiled and installed it using all the default options.
Now there are two Apache installations. The original has its httpd.config file in /etc/apache2, and its ServerRoot set to /usr. The new installation has its config in /etc/httpd, and its ServerRoot set to /usr/local/apache2.
The executables (httpd, apachectl etc.) from the original install seem to be in /usr/sbin, and they appear in the path. The /usr/local/apache2 files are not in the path.
Of the two versions, one I can be started by using the command “apachectl” on its own, and one by explicitly calling /usr/local/apache2/bin/apachectl, both of which can apparently run independently of each other (but not at the same time).
Posted in Uncategorized | Leave a Comment »
January 27, 2009 by Nick Moore
Learning to develop on a Mac. Learning web development. And other observations. A place to put things I find out as I go.
Posted in Uncategorized | Leave a Comment »