Saturday, March 16, 2013

Creating cards to study English in Surusu


Dictionary word:


Search for the word in the dictionary. Copy the entire meaning and examples.

Back: full dictionary entry, e.g.

slop·py  (slp)
adj. slop·pi·er, slop·pi·est
1. Marked by a lack of neatness or order; untidy: a sloppy room.
2. Marked by a lack of care or precision; slipshod: sloppy use of language.


Front: dictionary entry with any obvious clues to the word removed, and the word replaced with ######## e.g.

######## 

1. Marked by a lack of neatness or order; untidy: a sloppy room.
2. Marked by a lack of care or precision; slipshod: sloppy use of language.



Using deck: dictionary

[Add Card]




Sentence


Front: a short sentence, e..g

How old do people usually think you are?

Back: leave empty

Using deck: Sentence

press the [+English] button

[Create Cloze Cards]


Optional: before hitting the [Create Close Cards] button, add a translation in your native language to the front of card



Long Cloze:


Front: Find a long text (several paragraphs) about a subject that interests you

Back: find one word you don't know from the text on the front. Look it up in the dictionary. Paste the full definition on the back. e.g.

1. hook up
1. recieved a good or service as a favor 
2. to make out with someone 
3. to have sex with someone

Using deck: longclose

Base Clozetexts: the word *as it appears in the text on the front of the card*, e.g.

hooked up

Cloze Mode: Manual mode

[Create cloze texts]

then repeat for 2-3 more words on front

Thursday, March 14, 2013

Hotkeys for Surusu

My biggest usability requirement for surusu is some decent hotkeys so I can do reps. The default accesskeys were designed for pre-smartphone cellphones, and are not ergonomic on a keyboard. My preferred layout is based around QWERTY right hand home row: K both shows the back of the card and scores it 3 (a reasonable default should you hit on accident or be unsure how to score) L and SEMICOLON score 4 and 5, and are used to push cards you know further off into the future. In the other direction, J scores a 1 when I forget a card. On the rare occasions when I barely miss, middle finger up to I scores a 2. I don't use 0.

Chrome:

UPDATED Oct 2014 for new 3-button layout (although if you look at surusu's code it seems insanely fragile and likely to break again next time the page changes). Install the Keyboard-fu add-on, go to its settings, Import/Export Hotkeys, and paste the following:



{"globalFilters":"[\"-https:#mail.google.com/*\",\"-https:#reader.google.com/*\",\"*\"]","hotkeys":"[[\"2\",\"k\",\"Show Back / Score 2/3\",\"if ($('#questionDiv').hasClass('repback')) {\\n  $('input[value=\\\"2 (>_<)...(~_~) 3\\\"]').click()\\n}  else {\\n  $('input[name=\\\"showanswer\\\"]').click()\\n}\\n\\n\\n\",[\"http://surusu.com/question.php\"]],[\"24\",\"l\",\"Score 4/5\",\"$('input[value=\\\"4 (^_^)...(^-^)/ 5\\\"]').click()\",[\"http://surusu.com/answer.php\"]],[\"25\",\";\",\"Score 4/5\",\"$('input[value=\\\"4 (^_^)...(^-^)/ 5\\\"]').click()\",[\"http://surusu.com/answer.php\"]],[\"27\",\"j\",\"Score 0/1\",\"$('input[value=\\\"0 (0_0)...(x_x) 1\\\"]').click()\",[\"http://surusu.com/answer.php\"]]]"}




Firefox:

Install “custom keyboard bindings” greasemonkey script (21947)

NOT UPDATED for single-page or new button layout. Edit the script and add this to the list of bindings:

"surusu.com":{
"question.php":{
  k:'//input[@name="showanswer"]'
},
"answer.php":{
  j:'//input[@accesskey="1"]',

i:'//input[@accesskey="2"]',
  k:'//input[@accesskey="3"]',
  l:'//input[@accesskey="4"]',
  SEMICOLON:'//input[@accesskey="5"]'
}
 },

Friday, February 22, 2013

EON NAS Expansion and upgrade

EON NAS has served me well for a few years, but I am out of space. Also considering to upgrade EON, and perhaps ZPOOL and ZFS versions (options such as block-level deduplication are appealing, as it makes it easy to bulk backup tons of old disks which are largely older versions of my current repo, without worrying about wasting space by having the same file many times)

First order of business: expand from 9x2TB to 9x4TB drives.  Following refs such as:

http://www.itsacon.net/computers/unix/growing-a-zfs-pool/

I first check that all my drives are currently alive, the system is fully silvered, and then scrub to make doubly sure there are no errors.

My pool is raidz2, so in theory I could replace two disks at once, but obviously that leaves me vulnerable. Having dual parity allows me to swap one disk at a time, and still be protected again a disk failure mid-upgrade!

Start with "zpool status", which shows mediapool totally healthy.

"zpool scrub mediapool"

Says it'll take 50 hours to complete. Well, we wouldn't have gone out of our way to use ZFS unless we were paranoid about our data, so we'll suck it up and wait it out.

Okay, scrub completed successfully. Shut down, remove one of the 2TB drives and replace it with a 4TB drive. Verify at boot that the BIOS sees the 4TB drive.


media:1:~#zpool status
  pool: mediapool
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q
 scrub: none requested
config:

        NAME                    STATE     READ WRITE CKSUM
        mediapool               DEGRADED     0     0     0
          raidz2-0              DEGRADED     0     0     0
            c0t0d0              ONLINE       0     0     0
            c0t1d0              ONLINE       0     0     0
            c2t2d0              ONLINE       0     0     0
            c2t3d0              ONLINE       0     0     0
            c3t0d0              ONLINE       0     0     0
            c3t1d0              ONLINE       0     0     0
            c3t2d0              ONLINE       0     0     0
            c3t3d0              ONLINE       0     0     0
            390014080793031528  UNAVAIL      0     0     0  was /dev/dsk/c3t4d0s0

errors: No known data errors

#zpool replace mediapool c3t4d0s0
cannot open '/dev/dsk/c3t4d0s0': I/O error

cfgadm -s "select=type(disk)"
Ap_Id                          Type         Receptacle   Occupant     Condition
sata0/0::dsk/c3t0d0            disk         connected    configured   ok
sata0/1::dsk/c3t1d0            disk         connected    configured   ok
sata0/2::dsk/c3t2d0            disk         connected    configured   ok
sata0/3::dsk/c3t3d0            disk         connected    configured   ok
sata0/4::dsk/c3t4d0            disk         connected    configured   ok
sata1/0::dsk/c0t0d0            disk         connected    configured   ok
sata1/1::dsk/c0t1d0            disk         connected    configured   ok
sata2/2::dsk/c2t2d0            disk         connected    configured   ok
sata2/3::dsk/c2t3d0            disk         connected    configured   ok

So, the system sees c3t4d0. So then s0 does not exist probably. I can either replace with p0 to use the entire partition, or do a format to single slice and use s0. I don't recall why I used s0 before... probably so that I could upgrade some of the drives with larger ones with matching s0, then use s1 for extra space. Should be possible even with p0. Need to check my records.

Wait, that's not right. zpool replace should take a raw disk, format it, and resilver (according to http://docs.oracle.com/cd/E19082-01/817-2271/gbcet/index.html)

#zpool replace mediapool c3t4d0
cannot replace c3t4d0 with c3t4d0: device is too small

#format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@0,0
       1. c0t1d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@1,0
       2. c1d0
          /pci@0,0/pci8086,244e@1e/pci-ide@0/ide@0/cmdk@0,0
       3. c2t2d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@2,0
       4. c2t3d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@3,0
       5. c3t0d0
          /pci@0,0/pci1458,b005@1f,2/disk@0,0
       6. c3t1d0
          /pci@0,0/pci1458,b005@1f,2/disk@1,0
       7. c3t2d0
          /pci@0,0/pci1458,b005@1f,2/disk@2,0
       8. c3t3d0
          /pci@0,0/pci1458,b005@1f,2/disk@3,0
       9. c3t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0

There's the problem; my drive, which shows up as 4000GB to BIOS, shows up as 1.64 TB within EON Solaris. Why? Poking around the net, it should be


It is an odd point that the perceived size is exactly 2TB less than the actual size. I'm running 64-bit solaris. The BIOS reports the drive as 4TB (need to double-check this is currently the case, as I tried a few different slots trying to get it to work)

Answer: although I was not able to find documentation of this, early versions of EON did not have support for 3TB+ drives completely in place. Need to update to recent version.

After updating to EON version 1.0b,


media:1:~#format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0t0d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@0,0

The drive's correct size is seen.

Check pool status


media:2:~#zpool status
  pool: mediapool
 state: DEGRADED
status: One or more devices could not be used because the label is missing or
        invalid.  Sufficient replicas exist for the pool to continue
        functioning in a degraded state.
action: Replace the device using 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-4J
  scan: none requested
config:

        NAME                      STATE     READ WRITE CKSUM
        mediapool                 DEGRADED     0     0     0
          raidz2-0                DEGRADED     0     0     0
            14963257236115845187  UNAVAIL      0     0     0  was /dev/dsk/c0t0d0s0
            c0t1d0                ONLINE       0     0     0
            c4t2d0                ONLINE       0     0     0
            c4t3d0                ONLINE       0     0     0
            c5t0d0                ONLINE       0     0     0
            c5t1d0                ONLINE       0     0     0
            c5t2d0                ONLINE       0     0     0
            c5t3d0                ONLINE       0     0     0
            c5t4d0                ONLINE       0     0     0

and we're ready to replace

media:4:~#zpool replace mediapool c0t0d0
cannot replace c0t0d0 with c0t0d0: devices have different sector alignment

Crap.

According to this thread it is completely impossible to reaplce a 512k-sector drive with a 4k-sector drive. Oddly, it seems that ZFS will actually tolerate some level of mixage between aligments (and sector size?) at time of pool creation, or adding drives to a pool, but not when it comes time to replace a drive. The *only* option appears to be to back all the data up and create a fresh pool. A very unappealing prospect. I also means I will need 7x2TB drives.

Although the above thread seems authoritative, need to sleep on it and understand the situation a little better before taking action.

I have enough 2TB drives to make a complete backup, but some of them are in use in other ways. I might have a few which are already backups from an older state of the EON pool. I can overwrite those with the current pool contents. After that I have some matched master / backup pairs of data which is queued to enter pool.

Also worth noting: at time of writing, the cheapest 4tb drives ($210) are the same value as 2TB drives ($105) but could be saved for spares in the new pool. So any new drives purchased should be 4TB.

...

After backing all media up to UFS-formatted drives, I created a new pool from the 9 4TB drives and coping all the files back. I failed to upgrade the pool in-place, but did end up with all my data safe and sound in the new system.

Thursday, February 21, 2013

Update EON from snv_125

According to andre, best is to fresh install. Failing that:

I have a working windows -> USB install but not yet ready for release. USB install/image coming ...

For now what you can do is

Insert 2nd key(new) and run install.sh. Install to new key.

After it is done you will have a clone of the first key.

Then, use transporter with the new iso to overwrite the 2nd key that you just installed/cloned.

Now you have the new image installed on the new key.

so, let's try that.

First, list all the drives:

media:5:~#echo | format -e
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t0d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@0,0
...
       9. c3t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0

then plug in the USB key and try again:

media:6:~#echo | format -e
Searching for disks...
The current rpm value 0 is invalid, adjusting it to 3600
done

c4t0d0: configured with capacity of 14.80GB

AVAILABLE DISK SELECTIONS:
       0. c0t0d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@0,0

      10. c4t0d0
          /pci@0,0/pci1458,5006@1a,7/storage@5/disk@0,0
Specify disk (enter its number): Specify disk (enter its number):

I can clearly see that the 16GB USB key is c4t0d0

media:7:~#install.sh
This process installs EON ZFS Storage to a destination listed below:
[1] c0t0d0 (Unknown MB)
[2] c0t1d0 (Unknown MB)
[3] c1d0 (3816MB)
[4] c2t2d0 (Unknown MB)
[5] c2t3d0 (Unknown MB)
[6] c3t0d0 (Unknown MB)
[7] c3t1d0 (Unknown MB)
[8] c3t2d0 (Unknown MB)
[9] c3t3d0 (Unknown MB)
[10] c3t4d0 (Unknown MB)
[11] c4t0d0 (Unknown MB)
Enter destination choice[?]: 11
 ... lots of stuff, have to answer 'y' a few times
/mnt/install/boot/x86.eon:       OK
EON ZFS Storage install complete on /dev/dsk/c4t0d0s0

rebooting... as before, my system hangs when a bootable solaris system is present on USB. It doesn't even finish listing all the PCI cards. So have to try again, targeting a second CF card.

media:4:~#install.sh
This process installs EON ZFS Storage to a destination listed below:
[1] c0t0d0 (Unknown MB)
[2] c0t1d0 (Unknown MB)
[3] c1d0 (3816MB)
[4] c1d1 (Unknown MB)
[5] c2t2d0 (Unknown MB)
[6] c2t3d0 (Unknown MB)
[7] c3t0d0 (Unknown MB)
[8] c3t1d0 (Unknown MB)
[9] c3t2d0 (Unknown MB)
[10] c3t3d0 (Unknown MB)
[11] c3t4d0 (Unknown MB)
Enter destination choice[?]: 4

After it succeeds, I shut down, remove the old boot system from slot 0 of the CF card, and move the newly created one from slot 1 to slot 0. It boots okay, I am able  to log in with my previously created account, and verify that the pool is healthy and ip addresses are correct. Looks like the new install worked. Now I have a playground to update, and the safety of the old system on the other CF card.

Now it is time to upgrade to the latest and greatest. For versions of EON slightly newer than mine, the upgrade tool is/was transporter.sh - see this post - and elsewhere in comments Andre advises those of us using older versions without transporter.sh to simply download the script from the downloads page.

I download transporter.sh and scp it into /tmp/ on my eon box.
Download the latest CIFS ISO and scp it into /tmp/ as well

Then as root on my eon box:

#chmod +x /tmp/transporter.sh
#/tmp/transporter.sh -i /tmp/eon-1.0b-151-64-cifs-min.iso -d /mnt/eon0
 OK: lofiadm -a /tmp/eon-1.0b-151-64-cifs-min.iso /dev/lofi/1
 OK: mount -F hsfs /dev/lofi/1 /tmp/upgrade
 removing /mnt/eon0/boot
 copying /tmp/upgrade -> /mnt/eon0
  ...
 unmounting /dev/lofi/1
 OK: umount /dev/lofi/1
 releasing /dev/lofi/1
 OK: lofiadm -d /dev/lofi/1

Great, complete with no problems. But we're not done quite yet. The new system just installed contains none of the setup I made to the original system - ip addresses, accounts, and other config. Normally we run updimg.sh to write changes we've made to the running system into the stored image so that they persist across a reboot. But in the comments here Andre cautions that by default, that script will overwrite parts of the new system with the old one. So according to his advice, edit /mnt/eon0/.backup and comment out the three entries in /usr/bin/ to avoid reverting them. Then

#updimg.sh /mnt/eon0/boot/x86.eon 
Updating files in /mnt/eon0/.backup to x86.eon
backup in /mnt/eon0/boot/x86.eon.1
 /mnt/eon0/.backup:     OK
gzcat /mnt/eon0/boot/x86.eon > /tmp/x86.1336
lofiadm -a /tmp/x86.1336 /dev/lofi/1
mounting ... /dev/lofi/1 /mnt/upd
 copying /etc/svc/repository.db
umounting ... /mnt/upd
lofiadm -d /dev/lofi/1
mv -f /mnt/eon0/boot/x86.eon /mnt/eon0/boot/x86.eon.oem
gzip -f -9 -c /tmp/x86.1336 > /mnt/eon0/boot/x86.eon
/mnt/eon0/boot/x86.eon:  OK

At this point we should be ready to reboot and enjoy our new system!

Rebooting, GRUB displays the new EON logo as well as the version number 0.97
Before the login prompt there are some errors related to the crypto service
I am not able to SSH in. I can log in using one of the accounts I previously created. zpool shows no pool. ifconfig -a shows that the ip address settings were also lost.

Unfortunate. I still have the disk with the original system, so I could go through the whole process again, but it is probably easier to move forward and fix the config.

first, 

#zpool import

resurrects my pool. Everything looks healthy, although "zpool status" notes that I am using an older version of on-disk format (meaning that there is now a new version available but I have yet to upgrade).

Actually, the docs on the eonstorage google site don't mention such pedestrian configs as network addresses. Referring to the notes from my original install... I also glossed over those bits.

ifconfig fails with an "Object not found" error

svcs -xv shows:

svc:/network/physical:default (physical network interfaces)
 State: maintenance since (time of boot)
Reason: Start method exited with $SMF_EXIT_ERR_CONFIG.
Impact: 21 dependent services are not running:
  nfs
  smb
  etc

svc:/network/physical:nwam (physical network interface autoconfiguration)
 State: disabled since (time of boot)
Reason: Disabled by an administrator
Impact: 21 dependent services are running

svc:/system/idmap/default (Native Identity Mapping Service)
State: maintenance since (time of boot)
Reason: Start method failed repeatedly, last exited with status 1
Impact: 5 dependent services
  smb
  nfs
  etc

svc:/system/cryptosvc:default (cryptographic services)
State: maintenance since (time of boot)
Reason: restarting too quickly
Impact: 2 dependent services
  ssh
  milestone


Okay, that's a bit of a mess, but it seems that if I could get the network working the rest might fall into place. ifconfig -a does show both of my cards, so they seem to be working at the hardware and driver level. What is the recommended way to configure stuff in EON?

Well, /etc/hostname.rge0 does contain the IP address that I had previously configured. Looking at /usr/bin/setup, I try to reproduce it... all the relevant files seem to have the correct info from previous setup. The only missing step is to start the net service:

#/lib/svc/method/net-physical
/lib/svc/method/net-physical[73]: /sbin/ibd_upgrade: not found [No such file or directory]
ifconfig: cannot plumb rge0: Interface already exists
ifconfig: cannot plumb rge1: Interface already exists
configuring IPv4 interfaces: ifconfig: could not create address:Object not found
 rge0ifconfig: could not create address:Object not found
 rge1
Failed to configure IPv4 interface(s): rge0 rge1

it is true that /sbin/ibd_upgrade does not exist. Googling only turns up two results for "/sbin/ibd_upgrade: not found" neither of which offers a clear explanation

Reboot again and transcribe onscreen errors:

WARNING: No major number for driver mega_sas in class scsi
WARNING: failed to resolve 'scsa.probe' driver alias, defaulting to 'nulldriver'
WARNING: no randomness provider enabled for /dev/random. Use cryptoadm(1M) to enable a provider
Configuring devices
Failed to configure IPv4 interface(s): rge0 rge1
svc.startd[8]: svc:/network/physical:default: Method "/lib/svc/method/net-physical" failed with exit status 96.
svc.startd[8]: network/physical:default misconfigured: transitioned to maintenance (see svcs -xv for details)
... may have missed some, output too fast for video recording to keep up with
svc.startd[8]: svc:/system/idmap:default: Method "/usr/lib/idmapd" failed with exit status 1
... cryposvc
... failed to abandon contract 37: Permission denied


Okay, put that aside for now and continue with setup: edit /mnt/eon0/.exec and enter correct pool name.
zpool import -> success
updimg.sh /mnt/eon0/boot/x86.eon
init 6 -> reboot

my zpool is still not imported on boot, even though .exec contains my correct pool name. "zpool import" in the command line succeeds. It seems that .exec is not being run? Or it is run, but "zpool import -f -a" fails because SMB etc services can't be started.

So 2 main issues: networking fails, zpool doesn't load on boot. Need to seek help, and read through blog comments for any similar troubleshooting.

Andre suggests I just start over, so backup my upgraded img and copy the OEM one to /mnt/eon0/boot/x86.eon

So now I'm following the "new setups" instructions from here


cd /mnt/eon0/bin
./slinky r
./slinky c
setup
check poolname in .exec
add group and user for media per my notes from original setup
updimg.sh
skip the nfs setup (I don't think I ever actually used it)
skip the permissions/owner/acl stuff for zfs and zpool - should be set correctly on disk from before, and I made sure to use same group and user IDs
reboot - zpool is online with no errors

okay i lied, I use NFS from my media server. Try to follow the instructions in the faq but the paths don't work anymore. Perhaps they moved, or perhaps they're part of binary kit now?

Found the answer in the forums:

"With the move to Illumos /var/svc/manifest/*.xml changed to /lib/svc/manifest/*.xml
Please redo the steps with /lib/svc/manifest"
Repeat the steps in under /lib/ and all the imports succeed, but:


#svcadm enable -r nfs/server
svcadm: svc:/milestone/network depends on svc:/network/physical, which has multiple instances.

nevertheless, despite the warning I am able to connect via NFS

For now, this seems to be complete and successful.

Saturday, December 1, 2012

Openelec on ASRock VisionX

Install

Installed openelec 3.0 beta 1 with two USB thumb drives - one primed with the installer, the other blank, plugged in after booting the installer, and installed onto.

Network

Setting up wifi (system -> openelec -> network) was fairly straightforward, the main pain point was that changing the options in the menu had no immediate effect. Once I realized that it is necessary to reboot after every change to network configuration things got sensible and was up and running with wifi (using device wlan0) in no time. SSH access: on first boot, after plugging in an ethernet cable, I was able to ping, ssh, and guess the username and password. However the settings for "run ssh server" weren't checked, so I checked "run ssh server" and "disable password authentication". However after doing this, any attempt to ssh in was met with "Permission denied (publickey,keyboard-interactive)." so I unchecked "disable password authentication" and after a reboot I was able to connect again.

Unicode

Next problem: lack of unicode. In 2012, anything that ships without support for international languages should be considered broken. Perhaps there is a reason for this situation (font licensing costs?) but it's a bit embarrassing at this point that it hasn't been sorted out. In fact, even people looking for support in the forums were coming up emptyhanded! The post at http://openelec.tv/forum/72-xbmc/27400-unicode-support gave me an idea of where to start.
root ~ # mkdir /storage/.xbmc/userdata/fonts root ~ # cp Arial\ Unicode.ttf /storage/.xbmc/userdata/fonts/arialuni.ttf root ~ # ls -l /storage/.xbmc/userdata/fonts/arialuni.ttf -rwxr-xr-x 1 root root 23278008 Nov 28 22:13 /storage/.xbmc/userdata/fonts/arialuni.ttf
Under the Confluence skin settings I changed Fonts to "Arial based". After this, unicode characters started to be displayed! I actually have no idea whether copying the old standby arial unicode was even necessary. It is a significantly larger filesize than the arial font included with openelec, so there is a good chance it includes more characters. It worked fine until I rebooted. After rebooting, all my labels were blank! I had to use screenshots from the xbmc wiki to navigate the text-free settings menus and change the font back to skin default! Cycling through the fonts, the default and no-caps-default both worked, but selecting "arial-based" causes the labels to go blank. Before reboot:
root ~ # ls -l /usr/share/xbmc/media/Fonts/// total 5048 -rw-r--r-- 1 root root 633604 Nov 25 15:09 DejaVuSans.ttf -rw-r--r-- 1 root root 123096 Nov 25 15:09 Trebuchet MS Bold.ttf -rw-r--r-- 1 root root 83980 Nov 25 15:09 YanoneKaffeesatz-Bold.ttf -rw-r--r-- 1 root root 4221580 Nov 25 15:09 arial.ttf -rw-r--r-- 1 root root 105344 Nov 25 15:09 teletext.ttf
After reboot:
root ~ # ls -l /usr/share/xbmc/media/Fonts/ total 22736 -rwxr-xr-x 1 root root 23278008 Nov 28 22:13 arialuni.ttf
It seems that the folder I created, /storage/.xbmc/userdata/fonts, was pulled into the readonly filesystem at reboot and overwrote the full collection of fonts! The missing fonts seem to be gone for good:
root ~ # find / | grep ttf /storage/Arial Unicode.ttf /storage/.xbmc/userdata/fonts/arialuni.ttf /usr/share/fonts/liberation/LiberationMono-Bold.ttf /usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf /usr/share/fonts/liberation/LiberationMono-Italic.ttf /usr/share/fonts/liberation/LiberationMono-Regular.ttf /usr/share/fonts/liberation/LiberationSans-Bold.ttf /usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf /usr/share/fonts/liberation/LiberationSans-Italic.ttf /usr/share/fonts/liberation/LiberationSans-Regular.ttf /usr/share/fonts/liberation/LiberationSerif-Bold.ttf /usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf /usr/share/fonts/liberation/LiberationSerif-Italic.ttf /usr/share/fonts/liberation/LiberationSerif-Regular.ttf /usr/share/xbmc/addons/skin.confluence/fonts/Roboto-Bold.ttf /usr/share/xbmc/addons/skin.confluence/fonts/Roboto-Regular.ttf /usr/share/xbmc/media/Fonts/arialuni.ttf
This also suggests that

  1. My previous attempt to install arialuni had no effect
  2. The arial font included has pretty good support for foreign characters, so for most users simply selecting "arial-based" as the skin font should be sufficient
  3. By naming any unicode font to arial.ttf we can cause it to overwrite the original and thereby use any font we desire
  4. Some things on openelec require a reboot, some don't, it is hard to know which is which, and if you are trouble-shooting you may be better off rebooting every step of the way to ensure you're actually observing the effects of any change you made.

So, one more try:
root ~ # mv /storage/.xbmc/userdata/fonts/arialuni.ttf /storage/.xbmc/userdata/fonts/arial.ttf
and reboot, Settings -> Appearance -> Skin -> Fonts -> Arial based

It works, after 2 seconds the menu redraws with Arial, and browsing my international content all the extended characters show up. The other fonts seem to be lost for good, but it hasn't hurt my experience yet. If you find the need to install a custom font, I would start by copying everything from /usr/share/xbmc/media/Fonts/ into /storage/.xbmc/userdata/fonts/ so that you don't lose any of them. Just in case they turn out to be useful someday.

Confirming that the old standby ultra-complete unicode font I added is being used:
root ~ # ls -l /usr/share/xbmc/media/Fonts/ total 22736 -rwxr-xr-x 1 root root 23278008 Nov 28 22:13 arial.ttf

Adding network shares

System -> File manager -> Add source -> Browse -> SMB -> browse for net shares, select desired folder, edit name, etc

However after the above, they still did not appear as media sources. So next up was

Videos -> Files -> Add videos... -> Browse -> as above

Attempting to set the media type, I opted to browse the available scrapers, and trying to cancel that I backed out (probably by ESC) and found that the folder had been added with whatever default settings it had. Adding NFS sources was similar, except that I had to type in the locations, e.g.

Add Video Source -> Browse -> Add network location... -> "nfs://10.0.1.50/mediapool/media"

after which it shows up as a source when I Browse, and I could browse within that hierarchy and select the folders I wanted to add with various names.

Audio

Audio didn't work. Actually, it did seem to work via the analog out that was set up by default, but I preferred to send it over HDMI.

Settings -> System -> Audio output -> Audio output -> HDMI Audio output device -> HDA ATI,
HDMI Passthrough output device -> HDA ATI, HDMI

Blu-ray images

System seems to have no problem playing e.g. 1080p mkv files, but playing blu-ray files results in about 2fps performance. All available hardware decoding options are checked. Software vs. hardware decoding yields same results.

http://forum.xbmc.org/showthread.php?tid=129509&page=2 - many people are reporting that choppy/slow blu-ray playback is due to the new audio engine in XBMC. According to their advice, selecting AC3 rather the HD audio did improve playback to mostly smooth with some painful slowdowns now and then. Still not at the point where I can actually watch a BD image, but getting closer.

At some point after trying out different settings even normal DVD were stuttering.

After upgrading to openelec 3.0 beta 2 and taking the advice at http://forum.xbmc.org/showthread.php?tid=145277&pid=1239524#pid1239524 to enable all advanced format options (WASAPI is not relevant so I left output HDMI) and check video settings, everything seems to play smoothly. It does sometimes pause for buffering, I assume this is due to the high bandwidth I'm trying to push over wifi and should go away if I switch to a cable.

TBD

Doesn't auto-play video folders

My files are organized thusly:

Movies/Genre/Title - Director - Year - Misc/VIDEO_TS
Movies/Genre/Title - Director - Year - Misc/movie.iso

I should be able to click on a folder to play the movie within. Currently I have to click on the .iso file, or on the VIDEO_TS file and then on the correct IFO file within! Absolutely, a VIDEO_TS folder should be considered a target. And if a folder contains only a single video target (and perhaps a few image or .nfo files) that folder should play when clicked on. There is a similar problem at XBMC toplevel - I have to select video, then files, before I can even start browsing. I would like to have my video sources and audio sources listed right at the toplevel. Overall it take me perhaps 8 clicks to play something when it should only take 4. Playing things from "library" rather than "files" context might help this. Enabling "stack" option might help this. Enabling stacking helps somewhat, but also introduces new problems. For instance, if I have a few .iso files laying around in a high-level directory full of folders with different movie collections, stacking treats that high-level folder as a target and plays when I click on it. So I either have to turn off stacking, or audit my filesystem for loose .iso and VIDEO_TS instances and put them all inside their own folders. Default stacking doesn't seem to be quite smart enough to behave properly in a typical real-word disorganized collection.

Browsing a certain folder causes XBMC to hang

Will debug by splitting the difference until I figure out what in that folder is causing the problem. TBD TBD

Saturday, March 5, 2011

EON NAS ZFS troubleshooting log

Sometimes it will not boot - stuck at "verifying DMI pool" - this is a sign that boot device is not found/working. Check bios - sometimes TRANSCEND (CF card) loses its place in the boot priority list. May require reseating CF card.


NOTED: mar 5 2011 - one drive was offline. c0t1d0 ?? after replugging cables, it came back online. however if this keeps happening, drive might be dodgy

aug 2 2011 - drive / pool access was hanging, even after reboot. opened case and wiggled sata cables to make sure they were tight. pool back online after bootup. c3t4d0 needed resilvering


Dec 10 2011 - Volume was dropped (2 drives lost?) while copying data off of it.

Boot log:

Mem test
Detecting IDE drives ...
Detecting IDE drives ...



Serial ATA AHCI BIOS etc
Please wait...
Controller Bus#00, Device #1F (??)
Port-00: Hitachi
Port-01: ST32etc...
Port-02: Hitachi
Port-03: ST32
Port-04: ST32
Port-05: No device detected
AHCI BIOS installed


GIGABYTE Technology Corp. PCIE-to-SATAII/IDE RAID Controller
HD00: Hitachi
HD01: ST32

Sil 0600 ATA/133 Controller BIOS
Drive number: B TRANSCEND



Boot completes. zpool status shows:

DEGRADED
status: one of more devices has experienced an error resulting in data corruption.
action: Restore the file in question if possible. Otherwise restore the entire pool from backup
config:
mediapool DEGRADED
raidz2-0 DEGRADED
c0t0d0 ONLINE
c0t1d0 ONLINE
081420 FAULTED was /dev/dsk/c2t2d0s0
203842 FAULTED was /dev/dsk/c2t3d0s0
c2t0d0 ONLINE
c2t1d0 ONLINE
c2t2d0 ONLINE
c2t3d0 ONLINE
c2t4d0 ONLINE

errors: 1 data errors, use -v for list



zpool status -v:

/mediapool/media/etc/etc/Dragonzakura - ep09 (704x396) [RAW].avi

The good news is that the pool seems to be (barely!) safe, and the one file in question is clearly indicated (maybe I was deleting offloaded files when disks dropped offline??)

Shutdown, open case. Clearly, all the builtin-ports are working, both by the numbers and drive types. Not surprisingly, the missing drives are on the Addonics 3rd-party PCI card (which has two hitachis attached). In the past I reseated, but that shouldn't really be necessary.

Poking around in BIOS, there is no way to list PCI devices that I see, but hard drive boot order included the TRANSCEND CF card device (a PCI expansion) but lists only the 7 SATA drives above - no sign of the missing two drives on Addonics expansion card.

Reseated PCI card, booted - all drives back online, resilvered, no known data errors (presumably that means the one video file was checked against restored parity bytes and found to be correct?)

Resolved: need to replace card, or better yet find a drop-in replacement for motherboard with more SATA ports.


Problem: Windows mount of EON system has permissions to write new files, but certain existing folders can't be written to, and certain folder can't be moved. Windows' "file properties" shows "read-only" checked but greyed out. I can uncheck it, but next time I open it the box is re-checked. I used to have that old problem with the old system that had complex ACLs. I would solve it by re-applying the complex ACL from my notes from the original install. Now with the new simpler ACLs I am still seeing it. 

Workaround: re-apply the original ACLs

chmod -R A+owner@:full_set:fd:allow,everyone@:read_set/execute:fd:allow /mediapool/media
 

Thursday, August 12, 2010

Backup from EON ZFS NAS to hard drive

EON NAS is my primary data archive. However I'm trying to have two copies of every single file. So, as I add files to EON NAS, they get put into an "incoming" holding tank until I can make a second copy. Once second copy is made, they get filed. The plan is to occassionally make a full backup of all the sorted data, at which point the time-based offloads will be redundant and can be reused.

Don't have/want a second complete NAS system, so for now I'm backup up to hard drives. So what is the best way to get data onto an HD?

* could format NTFS, plug into windows, and drag-n-drop over network
** those backup drives could be read by any system which is convenient
** slooooow (100GB takes 3 hours, 2TB takes several days)
* could format ZFS, plug into NAS, blast data over esata
** drive only readable by OpenSolaris
** nice and fast to make backup
* format NTFS, plug into NAS, write via esata?
** does EON support NTFS write?

Ultimate decision: backup over network to windows box with NTFS filesystem - ability to easily access backups trumps everything else. If speed is demanded, set up Gb Ethernet between windows box and NAS.

Back up to disk attached to EON:


media:1:~#zpool status
  pool: mediapool
 state: DEGRADED
status: One or more devices could not be opened.  Sufficient replicas exist for
        the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-2Q
  scan: none requested
config:

        NAME                      STATE     READ WRITE CKSUM
        mediapool                 DEGRADED     0     0     0
          raidz2-0                DEGRADED     0     0     0
            14963257236115845187  UNAVAIL      0     0     0  was /dev/dsk/c0t0d0s0
            c0t1d0                ONLINE       0     0     0
            c4t2d0                ONLINE       0     0     0
            c4t3d0                ONLINE       0     0     0
            c5t0d0                ONLINE       0     0     0
            c5t1d0                ONLINE       0     0     0
            c5t2d0                ONLINE       0     0     0
            c5t3d0                ONLINE       0     0     0
            c5t4d0                ONLINE       0     0     0

errors: No known data errors
media:2:~#format
Searching for disks...done

c5t5d0: configured with capacity of 1862.95GB


AVAILABLE DISK SELECTIONS:
       0. c0t1d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@1,0
       1. c3d0
          /pci@0,0/pci8086,244e@1e/pci-ide@0/ide@0/cmdk@0,0
       2. c4t2d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@2,0
       3. c4t3d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@3,0
       4. c5t0d0
          /pci@0,0/pci1458,b005@1f,2/disk@0,0
       5. c5t1d0
          /pci@0,0/pci1458,b005@1f,2/disk@1,0
       6. c5t2d0
          /pci@0,0/pci1458,b005@1f,2/disk@2,0
       7. c5t3d0
          /pci@0,0/pci1458,b005@1f,2/disk@3,0
       8. c5t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]
No Solaris fdisk partition found.


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> current
Current Disk = c5t5d0

/pci@0,0/pci1458,b005@1f,2/disk@5,0

format> format
The protection information is not enabled
The disk will be formatted with protection type 0
Ready to format.  Formatting cannot be interrupted.
Continue? y
Beginning format. The current time is Fri Feb 22 03:21:16 2013

Formatting...
Format failed

Retry of formatting operation without any of the standard
mode selects and ignoring disk's Grown Defects list.  The
disk may be able to be reformatted this way if an earlier
formatting operation was interrupted by a power failure or
SCSI bus reset.  The Grown Defects list will be recreated
by format verification and surface analysis.

Retry format without mode selects and Grown Defects list? y
Formatting...
Illegal request during format: block 0 (0x0) (0/0/0)
ASC: 0x20   ASCQ: 0x0
Illegal request during format: block 0 (0x0) (0/0/0)
ASC: 0x20   ASCQ: 0x0
failed
format> partition
WARNING - This disk may be in use by an application that has
          modified the fdisk table. Ensure that this disk is
          not currently in use before proceeding to use fdisk.
format> quit
media:3:~#format /dev/rd
rdiskette   rdiskette0  rdsk/    
media:3:~#format /dev/rdsk/c5t5d0
No disks found!

media:4:~#format
Searching for disks...done

c5t5d0: configured with capacity of 1862.95GB


AVAILABLE DISK SELECTIONS:
       0. c0t1d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@1,0
       1. c3d0
          /pci@0,0/pci8086,244e@1e/pci-ide@0/ide@0/cmdk@0,0
       2. c4t2d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@2,0
       3. c4t3d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@3,0
       4. c5t0d0
          /pci@0,0/pci1458,b005@1f,2/disk@0,0
       5. c5t1d0
          /pci@0,0/pci1458,b005@1f,2/disk@1,0
       6. c5t2d0
          /pci@0,0/pci1458,b005@1f,2/disk@2,0
       7. c5t3d0
          /pci@0,0/pci1458,b005@1f,2/disk@3,0
       8. c5t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]
No Solaris fdisk partition found.


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> partition
WARNING - This disk may be in use by an application that has
          modified the fdisk table. Ensure that this disk is
          not currently in use before proceeding to use fdisk.
format> fdisk

             Total disk size is 60800 cylinders
             Cylinder size is 64260 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 Solaris2          1  60799    60799    100




SELECT ONE OF THE FOLLOWING:
   1. Create a partition
   2. Specify the active partition
   3. Delete a partition
   4. Change between Solaris and Solaris2 Partition IDs
   5. Edit/View extended partitions
   6. Exit (update disk configuration and exit)
   7. Cancel (exit without updating disk configuration)
Enter Selection: 6


format> label
Ready to label disk, continue? y

format> quit
media:5:~#newfs /dev/rdsk/c5t5d0
newfs: /dev/rdsk/c5t5d0: No such file or directory
media:6:~#newfs /dev/rdsk/c5t5d0s0
/dev/rdsk/c5t5d0s0: I/O error
media:7:~#newfs /dev/rdsk/c5t5d0s1
/dev/rdsk/c5t5d0s1: I/O error
media:8:~#format                
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t1d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@1,0
       1. c3d0
          /pci@0,0/pci8086,244e@1e/pci-ide@0/ide@0/cmdk@0,0
       2. c4t2d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@2,0
       3. c4t3d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@3,0
       4. c5t0d0
          /pci@0,0/pci1458,b005@1f,2/disk@0,0
       5. c5t1d0
          /pci@0,0/pci1458,b005@1f,2/disk@1,0
       6. c5t2d0
          /pci@0,0/pci1458,b005@1f,2/disk@2,0
       7. c5t3d0
          /pci@0,0/pci1458,b005@1f,2/disk@3,0
       8. c5t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> partition


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        ! - execute , then return
        quit
partition> print
Current partition table (original):
Total disk cylinders available: 60797 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)              0
  1 unassigned    wm       0                0         (0/0/0)              0
  2     backup    wu       0 - 60796        1.82TB    (60797/0/0) 3906815220
  3 unassigned    wm       0                0         (0/0/0)              0
  4 unassigned    wm       0                0         (0/0/0)              0
  5 unassigned    wm       0                0         (0/0/0)              0
  6 unassigned    wm       0                0         (0/0/0)              0
  7 unassigned    wm       0                0         (0/0/0)              0
  8       boot    wu       0 -     0       31.38MB    (1/0/0)          64260
  9 unassigned    wm       0                0         (0/0/0)              0

partition> quit


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> quit
media:9:~#newfs /dev/rdsk/c5t5d0s2
newfs: construct a new file system /dev/rdsk/c5t5d0s2: (y/n)? y
mkfs: bad value for ntrack: -1 must be between 1 and 2147483647
mkfs: ntrack reset to default 16
Warning: 3280 sector(s) in last cylinder unallocated
/dev/rdsk/c5t5d0s2:     3906815216 sectors in 968953 cylinders of 16 tracks, 252 sectors
        1907624.6MB in 6375 cyl groups (152 c/g, 299.25MB/g, 320 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 613152, 1226272, 1839392, 2452512, 3065632, 3678752, 4291872, 4904992,
 5518112,
Initializing cylinder groups:
...............................................................................
................................................
super-block backups for last 10 cylinder groups at:
 3900882720, 3901495840, 3902108960, 3902717984, 3903331104, 3903944224,
 3904557344, 3905170464, 3905783584, 3906396704
media:10:~#
media:10:~#
media:10:~#mount
/ on /devices/ramdisk:a read/write/setuid/devices/intr/largefiles/xattr/onerror=panic/dev=15c0001 on Fri Feb 22 03:10:45 2013
/devices on /devices read/write/setuid/devices/dev=8080000 on Fri Feb 22 03:10:41 2013
/dev on /dev read/write/setuid/devices/dev=80c0000 on Fri Feb 22 03:10:41 2013
/system/contract on ctfs read/write/setuid/devices/dev=8140001 on Fri Feb 22 03:10:41 2013
/proc on proc read/write/setuid/devices/dev=8100000 on Fri Feb 22 03:10:41 2013
/etc/mnttab on mnttab read/write/setuid/devices/dev=8180001 on Fri Feb 22 03:10:41 2013
/etc/svc/volatile on swap read/write/setuid/devices/xattr/dev=81c0001 on Fri Feb 22 03:10:41 2013
/system/object on objfs read/write/setuid/devices/dev=8200001 on Fri Feb 22 03:10:41 2013
/etc/dfs/sharetab on sharefs read/write/setuid/devices/dev=8240001 on Fri Feb 22 03:10:41 2013
/lib/libc.so.1 on /usr/lib/libc/libc_hwcap1.so.1 read/write/setuid/devices/dev=15c0001 on Fri Feb 22 03:10:44 2013
/dev/fd on fd read/write/setuid/devices/dev=8380001 on Fri Feb 22 03:10:45 2013
/mnt/eon0 on /dev/dsk/c3d0s0 read/write/setuid/devices/intr/largefiles/xattr/noatime/onerror=panic/dev=23c0000 on Fri Feb 22 03:10:48 2013
/tmp on swap read/write/setuid/devices/xattr/dev=81c0002 on Fri Feb 22 03:10:53 2013
/var/run on swap read/write/setuid/devices/xattr/dev=81c0003 on Fri Feb 22 03:10:53 2013
/mediapool on mediapool read/write/setuid/devices/nonbmand/exec/xattr/atime/dev=17d0002 on Fri Feb 22 03:11:04 2013
/mediapool/media on mediapool/media read/write/setuid/devices/nbmand/exec/xattr/atime/dev=17d0003 on Fri Feb 22 03:11:04 2013
media:11:~#fsck -y /dev/rdsk/c5t5d0s2
** /dev/rdsk/c5t5d0s2
** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
2 files, 2 used, 244131309 free (0 frags, 244131309 blocks, 0.0% fragmentation)
media:12:~#mount /dev/rdsk/c5t5d0s2 /backup
mount: Mount point /backup does not exist.
media:13:~#mkdir /backup
media:14:~#mount /dev/rdsk/c5t5d0s2 /backup
mount: /dev/rdsk/c5t5d0s2 not a block device
media:15:~#mount /dev/rdsk/c5t5d0 /backup
mount: /dev/rdsk/c5t5d0 or /backup, no such file or directory
media:16:~#mount /dev/rdsk/c5t5d0 /backup
c5t5d0p0   c5t5d0p2   c5t5d0p4   c5t5d0s1   c5t5d0s11  c5t5d0s13  c5t5d0s15  c5t5d0s3   c5t5d0s5   c5t5d0s7   c5t5d0s9
c5t5d0p1   c5t5d0p3   c5t5d0s0   c5t5d0s10  c5t5d0s12  c5t5d0s14  c5t5d0s2   c5t5d0s4   c5t5d0s6   c5t5d0s8
media:16:~#mount /dev/rdsk/c5t5d0p0 /backup
mount: /dev/rdsk/c5t5d0p0 not a block device
media:17:~#
media:17:~#
media:17:~#
media:17:~#
media:17:~#format /dev/rdsk/c5t5d0
No disks found!

media:18:~#format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0t1d0
          /pci@0,0/pci8086,3a46@1c,3/pci1458,b000@0/disk@1,0
       1. c3d0
          /pci@0,0/pci8086,244e@1e/pci-ide@0/ide@0/cmdk@0,0
       2. c4t2d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@2,0
       3. c4t3d0
          /pci@0,0/pci8086,244e@1e/pci1095,7124@1/disk@3,0
       4. c5t0d0
          /pci@0,0/pci1458,b005@1f,2/disk@0,0
       5. c5t1d0
          /pci@0,0/pci1458,b005@1f,2/disk@1,0
       6. c5t2d0
          /pci@0,0/pci1458,b005@1f,2/disk@2,0
       7. c5t3d0
          /pci@0,0/pci1458,b005@1f,2/disk@3,0
       8. c5t4d0
          /pci@0,0/pci1458,b005@1f,2/disk@4,0
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> quit      
media:19:~#mount /dev/dsk/c5t5d0s2 /backup





Here is formatting a brand new 4TB drive (probably don't need to touch the partition table at all actually)



media:4:~#format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]

format> current
Current Disk = c5t5d0

/pci@0,0/pci1458,b005@1f,2/disk@5,0

format> fdisk

             Total disk size is 60800 cylinders
             Total disk size is 60800 cylinders
             Total disk size is 60800 cylinders
             Cylinder size is 128520 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1                 EFI               0  60799    60800    100




SELECT ONE OF THE FOLLOWING:
   1. Create a partition
   2. Specify the active partition
   3. Delete a partition
   4. Change between Solaris and Solaris2 Partition IDs
   5. Edit/View extended partitions
   6. Exit (update disk configuration and exit)
   7. Cancel (exit without updating disk configuration)

[deleted partition 1, then recreated as EFI - probably pointless step]

fdisk>6

format> quit
media:5:~#
media:5:~#
media:5:~#
media:5:~#format
Searching for disks...done

c5t5d0: configured with capacity of 3726.02GB


AVAILABLE DISK SELECTIONS:
       9. c5t5d0
          /pci@0,0/pci1458,b005@1f,2/disk@5,0
Specify disk (enter its number): 9
selecting c5t5d0
[disk formatted]
No Solaris fdisk partition found.

format> label
Ready to label disk, continue? y
format> quit

media:7:~#newfs /dev/dsk/c5t5d0s0
newfs: construct a new file system /dev/rdsk/c5t5d0s0: (y/n)? y
Warning: 4512 sector(s) in last cylinder unallocated
/dev/rdsk/c5t5d0s0:     7814020704 sectors in 1271814 cylinders of 48 tracks, 128 sectors
        3815439.8MB in 8894 cyl groups (143 c/g, 429.00MB/g, 448 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 878752, 1757472, 2636192, 3514912, 4393632, 5272352, 6151072, 7029792,
 7908512,
Initializing cylinder groups:
...............................................................................
...............................................................................
...................
super-block backups for last 10 cylinder groups at:
 7805418016, 7806296736, 7807175456, 7808054176, 7808932896, 7809811616,
 7810690336, 7811569056, 7812447776, 7813326496


media:8:~#mkdir /backup
media:9:~#mount /dev/dsk/c5t5d0s0 /backup
media:10:~#df -k
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c5t5d0s0      3.6T   256M   3.6T     1%    /backup




Sunday, July 18, 2010

The BIG LIE of Japanese language learning.

Kanji don't have readings.

"Of course they do. My kanji flash cards have lists of readings for each kanji."

But that misrepresents the history and structure of Japanese.

Japanese began as a spoken language. For most of its history, there was no way to write down Japanese. Words were combinations of sounds, and certain sounds were used over and over to express the same concept in different words.

Then someone was hanging out in China and noticed they had a way of scribbling on bark to represent words. Certain characters related to concepts, and groups of characters represented words of the Chinese language. "Holy crap!" he thought. "That's the most useful things I've seen in my life." So he spent a while collecting a huge list of words - meanings and how they were written in Chinese characters.

He brought this big list of words back to Japan, and started assigning spoken Japanese words to written Chinese ones. For each Japanese word he'd try to find the best matching written Chinese word, and for each written Chinese word he'd try to find the best matching spoken Japanese word. Sometimes there would be several written Chinese words that mapped onto the same spoken Japanese word, sometimes several spoken Japanese words mapped onto a single written Chinese word.

So, back before written language, there was one Japanese word for "hot". Well, not really, there were all sorts of Japanese words for different levels of temperature in different contexts. But the sound "ATSUI" was widely used to mean "high temperature". Along come the big list of written Chinese words, which also had a variety of expressions for "hot". And the written Chinese word for "hot" as in "hot to the touch" and the written Chinese word for "hot" as in "it is hot outside" were both mapped onto the spoken Japanese word "ATSUI".

I've heard it explained that "Japanese has two different words for 'hot', they are written differently but pronounced the same" as if it were coincidence that two closely related words happened to be homophones. Bull. The correct way to express this is "The Japanese word 'ATSUI' means 'hot'. When you're speaking or writing a children's book in kana, that's all you need to know. But when you start reading and writing kanji, it gets more complicated, because there are several ways to write 'ATSUI'. If you mean 'hot to the touch' you write it one way, if you mean 'it is hot outside' you write it another. You'll have to remember which is which."

In languages with phonetic alphabets, words are related by CONCEPT <-> PRONUNCIATION <-> WRITING. This holds pretty well even for Chinese, which uses an ideographic alphabet - because the written and spoken language came from the same culture, the sounds that were reused to represent the same concept in various words simply became written ideograms reused to represent the same concept in various words. Thus, when you see a written word, you have a pretty good idea how it will be pronounced.

But because Japanese imported someone else's written language wholesale and grafted onto their spoken language, it is much messier. For Japanese words, CONCEPT -> PRONUNCIATION and CONCEPT -> WRITING. PRONUNCIATION and WRITING are only consistent to the degree that (spoken) Japanese and Chinese happened to have similar degrees of meaning, and reuse the same word-units in different words. For simple concepts and compounds, this happens a lot... in fact, it is surprising how well so much of the language lines up, considering that the alignment is basically coincidental. But the most basic kanji are also the ones used in the most different words, which is why 'fire' and 'water' have about a thousand readings each.

Bulk learning the readings of each kanji is a big waste of time - kanji don't have readings. Kanji represent words, and words have pronunciations.

Japanese starts to make a lot more sense when you realize this.

First off, the craziness of "kanji readings" makes sense when you realize there is really no such thing. Imagine there is a certain species of tree. In Chinese, this type of tree is called "Mountain Tree" for the location where it is found. However the Japanese gave it the spoken name "Green Tree" for its verdant color. When the kanji were imported to Japan, this species was identified, and so also it is spoken with sounds that mean "Green Tree", it is written with kanji that mean "Mountain Tree." So the kanji for "mountain" is pronounced "green" in the case of this species of tree - not because "it has that reading" but simply because the two cultures found different ways to describe that particular tree, and the written name was imported long after the spoken name was established. TODO: actual examples

You may even encounter AB vs BA - e.g. Chinese use the term "fireball" but Japanese use the term "ballfire" - so for that particular word the kanji "fire" is pronounced "ball", and vice-versa. TODO: actual examples

On the flipside, many words that seem unrelated when you look at the kanji, divulge their relationships if you use your ears. If you encounter two Japanese words that have a syllable in common, and there is some overlap in the meaning of the words, those words are probably etymologically related, even if the kanji used to write them are completely different. TODO: actual examples

For instance, there are a bunch of spoken sounds and written characters that mean "large" "big" "high" "great". Japanese might use the same sound for "tall" and "high priced", but "high speed" uses a different sound. Chinese uses the same character for "tall" as for "high speed". So Japanese has a handful of sounds for big/tall/great/high and Chinese has a handful of characters for the same... each has their own connotations, but there are so many words and compounds which make use of the general concept that it would be ridiculous to expect the Japanese and Chinese to have happened to pick the exact same variant for every single word. Instead, pretty much every combination of sound and writing occurs.

Specifically:

Chinese character 高 means high/tall. Used in Japanese word 高い たかい TAKAI meaning tall/high. This character is also used in a metric ton of Chinese words: 高原 highland, 高速 high speed, 高校 high school, 高価 high-priced. However in each of those cases, the Japanese spoken sound こう KOU is used for the concept of "bigness"... the pronunciations are こうげん KOUGEN, こうそく KOUSOKU, こうこう KOUKOU, こうか KOUKA respectively. Once we recognize こう KOU as a sound that Japanese uses for the concept of "bigness", we find other words that map this sound onto various kanji: "洪水 こうずい flood" obviously means "high water", the KOU in words such as "後期 こうき latter period" and "後半 こうはん second half" could well be related. Of course not all KOU sounds mean "high", there are various clusters of meaning including "travel", "school", and "public" that use the KOU sound.

In fact, rather than memorizing KANJI -> READINGS a much better use of your time would be to memorize SOUNDS -> CONCEPTS at a syllable/word fragment/concept level, eg

KOU -> high, etc
SHA -> car/carriage/vehicle, person, etc
SEI -> government, etc

Then when you hear an unknown word, you can make a pretty good idea of what the possible meanings are - context will often make completely clear which option is correct. Learning KANJI -> CONCEPTs via RTK will give you a pretty good guess at what a written word means - context will often make completely clear which option is correct. Brute force memorization of "kanji readings" will give you... what... a half-assed guess at how to read a word? Which context won't help with? Which is only useful if one of the possible readings happens to be a word you recognize when spoken? Besides, you need to be able to comprehend written Japanese, and comprehend spoken Japanese, to get anything done in the language. How often do you really need to read aloud from text?

SOUND -> CONCEPT is a natural, native Japanese relation. KANJI -> CONCEPT is a natural, native Chinese relation. KANJI -> SOUND is a freakish, unpredictable result of the frankenstein nature by which two different language systems were smashed together. Trying to learn to read by memorizing the sounds of each character is very foreign to the nature of the Japanese language - an arrogant attempt to impose a practice natural to other languages onto Japanese learning.

Eventually, to be fluent, you'll be able to read aloud from Japanese text. But that is best accomplished by mastering each of the spoken and written systems, and learning how they align - not by brute forcing the second-hand relationship between characters and sounds. After brute-forcing kanji via RTK, and brute-forcing listening comprehension via SRS drills, then learning to read will provide lots of "aha!" moments as the two systems reinforce each other by how they overlap.

TODO: museum, coliseum, library, apothecary
TODO: 戦[たたか]い war, match 戦[たたか]う wage war, fight - rather than SEN, obv related to tataku (hit)
TODO: お 陰[かげ] (thanks to) 影[かげ] (shadow, shade)

Tuesday, July 13, 2010

Unity notes

MONITOR

Multiple monitor output: seems to require desktop spanning.

http://answers.unity3d.com/questions/640/fullscreen-on-a-second-monitor
http://answers.unity3d.com/questions/7396/dual-monitor-support
http://answers.unity3d.com/questions/3899/using-multiple-monitors-video-outputs



Use camera viewports to place camera output at certain locations onscreen.
http://unity3d.com/support/documentation/Components/class-Camera.html


how to set app to non-standard size?

if "fullscreen" is only single monitor, how to draw across full desktop without decoration?

is there a way to find total monitor-spanned desktop size? size of second monitor? for now, ability for user to enter second monitor resolution, and using that to place the output viewport in upper right corner of screen, would work.

Supposedly full-screen-on-second-monitor for windows was addressed and would be available in future version (presumably by 3.0) http://answers.unity3d.com/questions/640

There is also a workaround for window: set app res to match monitor res, then place window so header and frame are exactly offscreen... this also addresses the pops-out-of-fullscreen-when-app-focus-changes problem. Even a util for it: http://gwr.orekaria.com/



VIDEO

Video: no position control in native Unity: http://answers.unity3d.com/questions/5197/how-to-create-a-slider-to-control-video-playback

is is possible to get video resolution: http://answers.unity3d.com/questions/18945/how-to-get-video-resolution

it is theoretically possible to access pixels of iplimage from OpenCV and copy to Unity texture: http://answers.unity3d.com/questions/15574/import-video-from-camera

opencv cross-platform support notes: http://answers.unity3d.com/questions/16460/plugins-on-osx-opencv-and-emgucv

hey, this seems promising: a cross-platform QT plugin! http://www.unifycommunity.com/wiki/index.php?title=QTPlayback it doesn't have position control, but includes (non-free) source for the plugin

PLUGIN

native implementations for OSX and Windows http://unity3d.com/support/documentation/Manual/Plugins.html

Sunday, July 11, 2010

Choosing a 3D engine

Creating own VJ / video installation software. Need to choose the right engine.

Requirements:

* unlimited layers
* physics
* paths/splines
* highres support
* multiscreen support (eg matrox out)
* audio input
* open source
* cross platform
** windows
** osx
** linux
** iphone
** consoles
* graphics card accelerated
* saleable
* real-time editing (see changes without restart)
* reasonable end-user GUI controls

Candidates:

* max/msp jitter
* max + ogre
* unity
* torque
* C
* neo axis engine
** ogre-based
** windows only, OSX is "in progress"
* http://www.rtsoft.com/novashell/
* http://game-editor.com/
* http://love2d.org/

Software design:

* source - clip art / pattern
** tiling, movement, etc
* objects
* paths
*

Test app:

* create layers
* assign clip art to layers
* position/scale of each layer