Comments fixed again, I think
For all those of you who mailed me to say that comments were broken, thanks, and they should now be fixed. I think. Let me know if they screw up again!
sudo dpkg-reconfigure fontconfig-config on edgy (that might be just sudo dpkg-reconfigure fontconfig on other distros or dapper), and go through the questions (choosing the default answers), but tell it that you want to enable bitmapped fonts when it asks. Then download the ProFont (bitmap font) for Linux/UNIX (new version) and put the .pcf files in your .fonts folder in your home directory (which you might have to create). You'll have to restart any terminals you have open, but then ProFont will be available for you to use as a font (and in all your other apps too).
/proc? If making the tool requires you to put a huge database of all the motherboards in existence and their RAM types on a website somewhere, I can understand why it doesn't exist...
# First, make the partition available to LVM, by
# making it a "physical volume". This is LVM-speak for
# "a bit of a disk that I can use"
pvcreate /dev/hda3 # the big partition on the first disc
pvcreate /dev/hdb # and all of the second disc
# Now, create a "volume group". This is LVM-speak for
# "a big block of disc space all managed together"
vgcreate volumegroup /dev/hda3 /dev/hdb
# Next, create a "logical volume". LVM-speak: "something
# that looks like a disc drive, so you can mount it"
# First, find out how big it can be
vgdisplay | grep "Total PE"
Total PE 11833
# now create the logical volume at that size
lvcreate -l 11833 volumegroup -n logical1
# You now have a device /dev/volumegroup/logical1
# which you can treat as if it were a disc
# Create a dir to put it in
mkdir /space
# and add it to /etc/fstab so it gets mounted. Add the line:
/dev/volumegroup/logical1 /space auto defaults 0 0
After that complex little bit (again, if you aren't tight like me, do it with the GUI, it's easier), you will have a directory /space on the machine with loads of space in it. Install openssh-server and rsync, because we'll need them later.
/space
/stuart
/2006-10-24
/folder1
/file1
/file2
/newfile1
/folder2
/file3
/2006-10-23
/folder1
/file1
/file2
/folder2
/file3
and the 2006-10-24 folder should have all the files in it but only take up as much space as newfile1. Complicated, but part of the reason I specified this is because I know it's possible. (The main reason, of course, is that I'm tight and want to save disc space.) Making this happens involves two stages: making a hardlink tree, and using rsync.
cp -al folder newfolder, and that duplicate will look the same and be full of real files but not take up any disc space. My nightly backup therefore needs to do the following:
current which always points to the most recent backup. So, the above process actually becomes:
current folder to a new folder, named for the current datecurrent link so it points to the newly created most recent backup/space/begin-backup, made executable with chmod +x /space/begin-backup, and looks like this:
#!/bin/bash
PERSON=$1
BROOT=/space
if [ -z "$PERSON" ]; then
echo You must pass the name of a backup dir
exit 1
fi
PDIR=$BROOT/$PERSON/
# If person dir doesn't exist, create it
if [ ! -d $PDIR ]; then mkdir $PDIR; fi
# If there's no current dir, create an empty one and link it
if [ ! -d $PDIR/current ]; then
mkdir $PDIR/first
ln -s first $PDIR/current
fi
DT=$(date -Iseconds)
# Hardlink-tree the existing recent dir
cp -al "$(readlink -f $PDIR/current)" $PDIR/$DT
# and link current to the new hardlink tree
rm $PDIR/current
ln -s $DT $PDIR/current
We'll come back to how you run this in a minute.
rsync, which is complex but brilliantly clever. In essence, rsync is like copy (or cp), except that it compares the source and the destination and only sends the changes over. On my laptop, I can do
rsync -avz --delete -e ssh \
/some/folder/to/back/up \
myserver:/space/stuart/current/
and that will copy /some/folder/to/back/up over to the server. Importantly, if that folder is already in the backup space, in the current folder (because we backed it up yesterday) then it'll only copy the changes over. This is why we make sure that there's a folder called current with the contents of last night's backup!
Exactly how we run this rsync command we'll come on to in a minute. Patience, Iago.
dobackup.sh, which actually does the work, just does the above steps, and looks like this:
#!/bin/bash
# Do backups to the rsync server
# You must have already set up a passphraseless ssh key to the ssh server
# so that "ssh servername" just logs you in.
BK=$(dirname $0)
BKNAME=stuart
# First, tell it to clock over the backup
ssh servername /space/begin-backup $BKNAME
# Now, do the backup
python $BK/findemblem.py backup | while read fn; do
rsync -avzq --delete -e ssh "$fn" \
servername:/space/$BKNAME/current
done
All that remains now is to schedule this script to run every night, by editing your tasklist with crontab -e and adding the line
40 4 * * * /full/path/to/dobackup.sh
And, lo and behold, you have overnight backups. All done and dusted. Phew.
Anyway, I needed a way of establishing which files had a particular emblem from a script. So here's such a script. Call as follows:
aquarius@giles:~$ python findemblem.py money
/home/aquarius/Sam presents
/home/aquarius/Work/quotation.xml
The actual script is:
import re, glob, sys, urllib, os
from xml.dom import minidom
def grep(pattern, files):
search = re.compile(pattern).search
matches = []
for file in files:
for index, line in enumerate(open(file)):
if search(line):
matches.append(file)
break
return matches
def findEmblemedFiles(emblem):
metafilesWithKeyword = grep('<keyword ',
glob.glob(os.path.expanduser('~/.nautilus/metafiles/*')))
retfiles = []
for dirxmlfile in metafilesWithKeyword:
dom = minidom.parse(dirxmlfile)
filenodes = [x.parentNode.getAttribute('name')
for x in dom.getElementsByTagName('keyword')
if x.getAttribute("name") == emblem]
files = dict([(x,'') for x in filenodes]).keys()
# turn /home/foo/.nautilus/metafiles/file:%2F%2F%2Fhome%2Ffoo%2FWork.xml
# into /home/foo/Work/
dirname = urllib.unquote(os.path.split(dirxmlfile)[1])[7:-4] + '/'
retfiles += [os.path.join(dirname,urllib.unquote(f)) for f in files]
return retfiles
if __name__ == "__main__":
print '\n'.join(findEmblemedFiles(sys.argv[1]))
I could not get Reader to show me this mysterious unread item, or to acknowledge that it wasn't there. I tried a full refresh (just loading Reader again), I tried switching to Home, back to All Items, I tried showing the feed individually (which is what the screenshot shows). This also happened with other feeds; the only way I could get the supposed new items alert (the "1 new items" and the (1) in the left pane) to go away was to "View all items" (all of which appeared to be read) and then say "Mark all read". Now, though, I'm left with the lingering suspicion that there really was an unread item and now I won't ever get to read it.
(Plus: 1 new items? Hm.)
In terms of filing bugs: what should I do about that last one? I have no idea how to replicate it, I can't give instructions. I could say "look at my Reader page and you'll see it", but then I basically can't use Reader until I get an acknowledgement that the Reader team have diagnosed the problem, which I don't want to do.
Anyway, as soon as I've got my customisations done to Rawdog, I'm switching. Sorry, Google team. I have to say that Gmail is increasingly getting confused and having to be full-refreshed or just hanging on the "Sending..." bit when trying to send a mail (it's still an Ajax loading screen, even if it's just in the top right hand corner). Makes me sad. If Google can't make this stuff work, who can? Maybe I should look harder at the Yahoo stuff instead? They seem to be coming on strong recently.
Then it occurred to me that this book is not intended as a book for a seasoned Apache administrator. The book is written for people who, probably for the first time, have decided to take advantage of the power of both Linux and Apache and set up a web server on their own... [W]hen viewing this book in the light of its true target audience, I consider it a great piece of work. If you are just starting out with building an Apache web server on Linux, this is the book for you.That's exactly what we were aiming for. The review author, James Mohr, has hit the nail precisely on the head. The audience for the book, the typical use case, was someone who knows something about computers, maybe does a bit of admin on a couple of Windows boxes in their organisation, and wants to set up a Linux server on a piece of kit they've found in the basement to try it out, to see what all the fuss is about, and to see if it'll help their organisation. The idea is that someone like that hears about Linux, wants to give it a shot to see if it'll do what they want without having to go and buy an expensive server and another Windows licence, and wanders into a bookshop to grab a book explaining it. When they do that and see a book called "Run Your Own Web Server Using Linux & Apache", they'll (hopefully) think "aha! that's what I want to do!" and find the book useful. Looks like we got the pitch about right.
feeds.opml is the OPML you've exported from your existing aggregator:
for f in $(python -c "from xml.dom import minidom; dom=minidom.parse('feeds.opml'); print ' '.join([x.getAttribute('xmlUrl') for x in dom.getElementsByTagName('outline')])"); do rawdog -v -a $f; done
This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.