dabase

Kai Hendry’s other blog archives

What does a FAQ need?

  1. A table of contents listing the questions
  2. A way to hyperlink the question

Unfortunately most FAQs seem to fail to do this. To save you time doing this by hand, I highly recommend anolis

FAQ template, faq.src.html:

<h2 class="no-toc no-num">Frequently Asked Questions</h2>
<div id="tocwrapper"><!-- toc --></div>

<h3>How do I create a FAQ?</h3>
<p>Using HTML</p>

<h3>What's the best kiosk software out there?</h3>
<p><a href="http://webconverger.com">Webconverger</a></p>

Run anolis faq.src.html faq.html and boom:

<h2 class="no-toc no-num">Frequently Asked Questions</h2>
<div id=tocwrapper>
<!--begin-toc-->
<ol class=toc>
 <li><a href=#how-do-i-create-a-faq?><span class=secno>1 </span>How do I create a FAQ?</a></li>
 <li><a href="#what's-the-best-kiosk-software-out-there?"><span class=secno>2 </span>What's the best kiosk software out there?</a></li></ol>
<!--end-toc--></div>

<h3 id=how-do-i-create-a-faq?><span class=secno>1 </span>How do I create a FAQ?</h3>
<p>Using HTML</p>

<h3 id="what's-the-best-kiosk-software-out-there?"><span class=secno>2 </span>What's the best kiosk software out there?</h3>
<p><a href=http://webconverger.com>Webconverger</a></p>

Job done. Here is a better example FAQ

Here is Makefile I use a lot on my Websites:

INFILES = $(shell find . -name "*.src.html")
OUTFILES = $(INFILES:.src.html=.html)
TEMP:= $(shell mktemp -u /tmp/web.XXXXXX)

all: $(OUTFILES)

%.html: %.src.html
    m4 -PEIinc $< > $(TEMP)
    anolis $(TEMP) $@
    rm -f $(TEMP)

clean:
    rm -f $(OUTFILES)

PHONY: all clean
Posted

After installing Apache 2.4 in /usr/local/apache2/, I struggled to get my VirtualHost setup going.

After plonking in at conf/extra/virtual.conf:

<VirtualHost 127.0.0.1:80>
UseCanonicalName    Off
VirtualDocumentRoot /srv/www/%0
Options All ExecCGI FollowSymLinks +Includes
</VirtualHost>

Then enabling LoadModule vhost_alias_module modules/mod_vhost_alias.so and restarting the httpd, I kept getting these messages:

AH01630: client denied by server configuration: /srv/www/webconverger/

Turns out there seems to be a new permission model, whereby this policy:

<Directory />
    AllowOverride none
    Require all denied
</Directory>

Stops access to /srv/www. To alleviate this, after that “deny all” stanza above you add the exception:

<Directory "/srv/www">
Options All
AllowOverride All
Require all granted
</Directory>

Read the Access Control bit in the caniocial Apache httpd documentation for more.

Posted

Latest tips

#!/bin/sh -e
if test -f "$1" && grep -q ssh-rsa "$1" && test $(wc -l <"$1") -eq 1&& test "${1##*.}" == "pub"
then
        username=$(basename $1 .pub)
        echo Create account for $username ?
        read -p "Press [enter] to continue..."
else
        echo $0 requires a ssh pub key of the format username.pub
        exit
fi

sudo useradd -s /usr/bin/git-shell -m $username
sudo mkdir /home/$username/.ssh
sudo cp $1 /home/$username/.ssh/authorized_keys
sudo chown -R $username:$username /home/$username/.ssh/
sudo adduser $username git

echo ssh://$username@example.com/srv/git/test
Posted

Sort by third column using semi-colon as a delimiter:

wget http://weather.dabase.com/3day.txt -O /dev/stdout |  sort -n -t ";" -k 3

-n is for numeric sort.

Posted

Android in the United Kingdom

Sdcard

The “side loading” use case on Androids is a bit difficult to say the least.

LG Optimus with an sdcard mounted:

/dev/block/vold/179:17 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0

With it unmounted or removed /mnt/sdcard or /sdcard exist, but obviously not mounted. This can actually be a problem as some apps assume /sdcard are mounted and there to write on. Doh.

On a Galaxy S, where there is an empty sdcard slot we can see:

/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

With an sdcard inserted and mounted:

/dev/block/vold/179:1 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:9 /mnt/sdcard/external_sd vfat rw,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1015,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/external_sd/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0

Notice the weird external_sd bit. The Galaxy S mounts the physical sdcard on /mnt/sdcard/external_sd/ which is a bit daft unless they are trying to work around a problem.

The Nexus S from Samsung doesn’t have an sdcard, yet it still is mounted there:

/dev/block/vold/179:3 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0

In the menus, it’s called “USB storage”.

To conclude we can learn here that the physical sdcard has been deprecated really. I noticed a WRT that refused to install widgets from anywhere except /sdcard/, so when you didn’t have a physical sdcard installed, you’re kinda screwed. So now I guess Android has deprecated the sdcard, but unfortunately has kept the moint point name for historical reasons.

Without the physical sdcard, I must say it gets really hard to “side load”. For example I have never managed to “side load” with other non-internet technologies like bluetooth, which is a bit depressing. USB I gather won’t work because of the master slave model, though I don’t have a physical USB male to male to try.

Posted

Me & my new Nexus S

Upgrading from a Nexus 1 was particularly painful since I had to re-install all the apps. Furthermore the App metadata like where I am with “Angry birds” is not carried over. So I’ve must have lost many several hours of setup & game progression! :(

Network settings, Bookmarks, passwords, cookies, email accounts, all need to be re-setup. Under Privacy settings there is “Back up my data” & “Automatic restore” option ticked, but it didn’t seem to work! Most definitely seems to be an opportunity to sort out the Android upgrade path.

The Nexus S screen is much better than the Nexus 1, however the battery life seems just as bad as the Nexus 1, if not worse. The lock and home keys are re-mapped, which I’m getting used to. Tbh, I prefer the home key on the right, but it is worrying how this small aspect is so fragmented already across Android devices! Pick up an Android and you will need to get used it’s mappings. Pick up an Iphone and you’re A for away.

Cons

  • Slippery back. Place the mobile on my bed and it slips off!
  • Terrible battery life, though the display is on a 30 second time out!
  • Hard to tell when it’s upside down when taking it out my pocket
  • I have a little lip on my screen, turns out to be “physical damage” out the box, but Carphone warehouse accuse me of doing it :(
  • No Gtalk video enabled chat :( I want it, though this function kills my laptop, nevermind my mobile
  • NFC reader consumes battery :/ Can’t figure out the new Tags application even though a friend also has a Nexus S!

Pros

Posted