css text-outdent

Outdented list items are useful for lists of links where some links wrap. When the links are outdented visitors get a good indication of which lines are continuation lines and which lines are new links.

Use the css text-indent property with a negative number. Add the same amount of positive left padding or left margin to move the whole outdented paragraph or li to back to where it should be. The outdented items must be block level or have display: block; set.

Here is a sample ul:

Here is the css for the samples above:

.outdent li, .outdent p{
        padding-left: 1.5em;
        text-indent: -1.5em;
}
.outdent li{
        list-style: none;
        line-height: 1.3em;
        margin: 0;
}

WordPress and jScrollPane

Some notes for getting WordPress and jScrollPane working.

I wasn’t interested in the plugin because it is out of date and seems to carry a log of baggage.

These links were helpful:

http://jscrollpane.kelvinluck.com/

http://jscrollpane.kelvinluck.com/dynamic_width.html

http://matthewruddy.com/using-jquery-with-wordpress/

My code in an add_action function to wp_head:

<?php
add_action( 'wp_enqueue_script', 'load_jquery' );
function load_jquery() {
    wp_enqueue_script( 'jquery' );
    }
?>

<!-- the mousewheel plugin - optional to provide mousewheel support -->
<script type="text/javascript" src="wp-content/themes/some path.../jquery.mousewheel.js"></script>

<!-- the jScrollPane script -->
<script type="text/javascript" src="wp-content/themes/some path.../jquery.jscrollpane.min.js"></script>

<script type="text/javascript" src="wp-content/themes/some path.../resize.js"></script>

<script type="text/javascript" id="sourcecode">
    jQuery(document).ready(function($) {
        // Code here will be executed on document ready. Use $ as normal.
        $('.scroll-pane').jScrollPane({mouseWheelSpeed: 30});
        });
</script>

I had to set the mouse wheel speed; it was way too slow, default is 3.

resize.js didn’t work without modification.

(function($) {
// added outer stuff to get resize working with js wordpress way 2013-05-13
$(function()
{
    $('.scroll-pane').each(
        function()
        {
            $(this).jScrollPane(
                {
                    showArrows: $(this).is('.arrow')
                }
            );
            var api = $(this).data('jsp');
            var throttleTimeout;
            $(window).bind(
                'resize load', //added load 2013-04-30 so the images would fit on android
                function()
                {
                    if ($.browser.msie) {
                        // IE fires multiple resize events while you are dragging the browser window which
                        // causes it to crash if you try to update the scrollpane on every one. So we need
                        // to throttle it to fire a maximum of once every 50 milliseconds...
                        if (!throttleTimeout) {
                            throttleTimeout = setTimeout(
                                function()
                                {
                                    api.reinitialise();
                                    throttleTimeout = null;
                                },
                                50
                            );
                        }
                    } else {
                        api.reinitialise();
                    }
                }
            );
        }
    )

});
})(jQuery);

The containing anonymous function was needed to get this working with WordPress. I added load because this prevents panes with photos loaded from a third party site from being incorrectly rendered. Without it the space they take up is not accounted for.

Sheevaplug Notes

My notes for getting from bare plastic to reliable boot with Fedora 17 and a SheevaPlug.

Getting /dev/ttyUSB0 Working on my F-17 Laptop

Kempy suggests connecting by running
sudo chown uucp /dev/ttyUSB0; sudo cu -s 115200 -l /dev/ttyUSB0
Although this works, I prefer to add myself to the dialout group. Best way on F-17 seems to be:
usermod -a -G dialout your-username.
Now I can connect as an ordinary user like this:
cu -s 115200 -l /dev/ttyUSB0

Modem-manager kept taking over the port so I would get:
cu: /dev/ttyUSB0: Line in use
when I tried to connect to my device.

The cleanest fix I found after much Googling is to add a custom file to /usr/lib/udev/rules.d. I called mine
77-mm-usb-cust-device-blacklist.rules. Perhaps this file would be better placed in /etc/udev/rules.d.

# edit this file, it will not be overwritten on update

ACTION!="add|change", GOTO="mm_usb_device_blacklist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end"
ENV{DEVTYPE}!="usb_device",  GOTO="mm_usb_device_blacklist_end"

# Custom for Sheevaplug: Product: SheevaPlug JTAGKey FT2232D B
ATTRS{idVendor}=="9e88", ATTRS{idProduct}=="9e8f", ENV{ID_MM_DEVICE_IGNORE}="1"

LABEL="mm_usb_device_blacklist_end"

Installation

I installed Fedora-17-arm-kirkwood-mmcblk0.img.xz accoring to the instructions on the Fedorra site. Although I followed the steps carfully a couple of times, I couldn’t get my plug to boot. I remembered reading and ignoring something about updating u-boot to the DENX version from the Marvell version provided with the plug. I followed Martin Michlmayre’s clear instructions for u-boot update. After this update, everything as detailed on the Fedora site just worked. Note that a newer (2012.04.01-2) version of u-boot would not boot the image either.

For the Sheevaplug change usb 1:1 to usb 0:1 in the bootloader commands on the these lines:

set loadInitrd 'fatload usb 0:1 0x7400000 uInitrd-kirkwood'
set loadImage 'fatload usb 0:1 0x6400000 uImage-kirkwood'

I had to set the time by hand (date MMDDhhmmYY and hwclock -w)to get networking (and ntpd) working. This issue recurred whenever the plug was cold booted and turned out to be due to a dead RTC battery.

Changing the RTC battery.

Pry out the four feet on the bottome and remove four screws underneath. I had to pry up one metal tab on the batery holder to slide the battery out. A firm push with a screwdrive was required as the battery had leaked and was stuck in place. I cleaned the holder before installing the new battery. The original battery was an LR1130. AG10 is another part number for the same battery. 389 is the same size and specs but silver not alkaline. The first two numbers cost pennies a piece but are not available locally. A 398 was almost $6 at Radio Shack and seems to work fine other than the damage to my wallet.

yum update

I ran yum update and the updated system was not bootable. The cause of the un-bootable system was a bad kernel, see bug 834977. Update: happily, 3.7.3-101.fc17.armv5tel.kirkwood does boot.

I discovered that the problem was the 3.5.6-1 kernel by mounting the by USB stick on my laptop and reverting to the old kernel. Here’s a listing of the boot partition after yum update:

total 39824
-rw-r--r--. 1 usr usr       71 Jun 18 05:53 boot.scr
-rw-r--r--. 1 usr usr       62 Dec  9 04:28 klist.txt
-rw-r--r--. 1 usr usr      436 Jun 18 05:53 README.txt
-rw-r--r--. 1 usr usr  3291896 Jun 18 05:58 uImage-3.4.2-3.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr  3350824 Dec  9 04:27 uImage-3.5.6-1.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr  3350824 Dec  9 04:27 uImage-kirkwood
-rw-r--r--. 1 usr usr 10112646 Jun 18 05:58 uInitrd-3.4.2-3.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr 10308294 Dec  9 04:28 uInitrd-3.5.6-1.fc17.armv5tel.kirkwood
-rw-r--r--. 1 usr usr 10308294 Dec  9 04:28 uInitrd-kirkwood

Because the partition is fat you can’t ln to change the uImage and uInitrd-kirkwood to point to the old files. So I used cp -a:

cp -a uImage-3.4.2-3.fc17.armv5tel.kirkwood uImage-kirkwood
cp -a uInitrd-3.4.2-3.fc17.armv5tel.kirkwood uInitrd-kirkwood

System boots. Another way of doing this should be to change the values of loadImage and loadInitrd to point the the specific image and initrd.

Booting from an SD Card

The USB stick was at risk of being unplugged by curious fingers so I dd‘d the system from the USB stick to a an SD card.

U-boot commands for the SD card were gleaned by looking at this Debian page and applying to the fedora instructions. These u-boot instructions set up u-boot to boot the system from the SD card. mmc init is repeated because it fails the first time on a cold boot. Booting should be tested under all conditions: reboot from the OS, after hardware reset and cold boot.

Marvell>> set loadImage fatload mmc 1:1 0x6400000 uImage-kirkwood
Marvell>> set loadInitrd fatload mmc 1:1 0x7400000 uInitrd-kirkwood
Marvell>> set bootcmd 'mmc init 1; mmc init 1; ${loadImage}; ${loadInitrd} ; bootm 0x6400000 0x7400000'
Marvell>> saveenv
Marvell>> boot