Tuesday, January 27, 2015

Remembering My Grandfather

My grandfather's funeral was one week ago. Some obituaries were published online (Herald-Sun and MRketplace; see also my uncle Shan's page about him). The weather was mild enough to be outside for the service comfortably.

Around 75 people were there; I wasn't in the center of the circle. I am thankful that my grandfather's nurses were invited to attend (that's tasteful), and honored that at least two showed up. I am especially touched that Anna told me he was such a sweetheart and she would miss him. Thank you for helping him age gracefully!

Many stories about him were told. I knew that he and my grandmother had a great love. My grandfather had remarked how much he enjoyed the article, interview, and photos by Valerie Schwartz about their love, so I'd say their love was known. I had not heard many of the other stories before, though.

One year, Lincoln High School called local car dealerships to borrow a convertible for their Homecoming parade. None agreed. My grandfather didn't like that, so their blue Skylark convertible was in the parade. Nice problem solving skills! Several reminiscences had that theme of someone with a problem, and my grandfather saying, "How are we going to make this better?" He didn't walk away from problems; he believed in community and contributing to his community. (Awesome!)

One conclusion, about my grandmother changing the flat tire on family vacation, that especially made me smile was that my grandmother had the gifted touch with tools, while my grandfather had a double dose of the social gift. I hadn't heard that story, but of course I knew their respective strengths.

I had not heard many stories about my grandfather's childhood. The way he told it, there was a lot of hard work. He didn't mention the poverty of the Jewish ghetto in Massachusetts, though. He and his father sold produce as well as odds and ends. His roots in hard work to move out of poverty, in retail and social connections, and in close-knit community go all the way. I agree with my oldest uncle that his success was The American Dream.

My mother said his last words to her were, "Make sure that order of 14 Regular comes in!" Yes, he was always thinking about selling clothing. He loved it, and it made him happy. Talk about a good career choice!

I don't want to forget his good points, especially his optimism! He went far with his smile and good attitude.

Friday, January 23, 2015

Nano Drivers

Today's Arduino lesson is that not all Arduino Nano v3 boards are the same (and this is probably true for other Arduino models when purchased from different sources). Let's skip over how long it took me to discover that, m'kay? I discovered this by looking in System Information, going to System Report, and looking at what was connected to USB. Get drivers for that, whatever it is.

My first Nano required PL2303 serial drivers. My second Nano needs the more standard FTDI libraries instead. Sparkfun has FTDI installation directions, and those drivers can also be downloaded directly from FTDI.

And just like that, sprinkling a little driver magic over it, this Arduino is now happy to talk to its IDE. Just as readily, all of the peripherals are now also working with the example code.

Thursday, January 22, 2015

Virsh

We all know how fun brain dumps are to read, so move along, nothing to see here.

Today was my second day arguing with learning virsh. Here's what I've learned so far (with some bruises).

Basic virsh

reference

You'll need to install various tools, but that should be readily search-able. I had the tools and some existing VMs as my starting point, but I had a lot to learn.

Create (build) a new VM

  • define (export) NEWVM, OLDVM, HOST, DOMAIN, and ME (assuming your VG, LV, and VM naming scheme matches mine; otherwise, watch out!)
  • sudo lvcreate -n vm_${NEWVM} -L 8192M /dev/vg_${HOST} # from http://virt-tools.org/learning/install-with-command-line/
  • The rest of this is mostly http://manpages.ubuntu.com/manpages/trusty/man1/virt-builder.1.html
  • virt-builder --list
  • virt-builder --notes ubuntu-14.04
  • From that, I learned that I want to add --firstboot-command "dpkg-reconfigure openssh-server" to virt-builder.
  • Create a file with your desired initial root password. Mine was /tmp/password.
  • virt-builder ubuntu-14.04 -o /dev/vg_${HOST}/lv_${NEWVM} --firstboot-command "dpkg-reconfigure openssh-server" --root-password file:/tmp/passwd --hostname ${NEWVM}.${DOMAIN}
  • Now I leverage that I already had some working VMs of the same OS type and version:
  • virsh dumpxml ${OLDVM} | sed 's/${OLDVM}/${NEWVM}/g' | grep -v "mac address\|uuid" > ${NEWVM}.xml
  • virsh define ${NEWVM}.xml # persistent VM
  • virsh start ${NEWVM}
  • Alternatively, 'virsh create ${NEWVM}.xml' is a transient VM that goes away when shutdown
  • Very awesomely, console access was available by default! If it weren't, you'll want to configure it.
  • virsh console ${NEWVM} # log in as root with the password set in the file
  • useradd -G sudo -s /bin/bash -d /home/${ME} -m -c "Your Name" ${ME}
  • passwd ${ME} # set your password
  • If console doesn't work, you'll need to use some brute force.
    • virsh domiflist ${NEWVM}
    • ipv6calc --action prefixmac2ipv6 --in prefix+mac --out ipv6addr fe80:: [that MAC]
    • ssh -l root [that IP]
  • Add DNS records for the new VM.
  • When you're done, virsh shutdown ${NEWVM}

Clone an Ubuntu VM

  • Read https://help.ubuntu.com/community/KVM/Virsh.
  • virsh list --all
  • virsh shutdown ${OLDVM}
  • virsh list --all # verify that shutdown completed
  • sudo virt-clone --original ${OLDVM} --name ${NEWVM} --prompt # first time, or
  • sudo virt-clone --original ${OLDVM} --name ${NEWVM} -m [previous MAC] --prompt # subsequently, if you're learning by breaking as I did
    • answer /dev/vg_${HOST}/vm_${NEWVM} to prompt if you named yours like mine
  • virsh list --all
  • virsh start ${OLDVM}
  • sudo virt-sysprep --hostname ${NEWVM}.${DOMAIN} --enable cron-spool,dhcp-client-state,dhcp-server-state,logfiles,mail-spool,random-seed,ssh-hostkeys,yum-uuid -d ${NEWVM}
  • virsh start ${NEWVM}
  • The clone has my user account and other niceties, but I don't know its address. Luckily I can use available information and link-local IPv6.
  • virsh domiflist ${NEWVM}
  • ipv6calc --action prefixmac2ipv6 --in prefix+mac --out ipv6addr fe80:: [that MAC]
  • ssh [replace with that IPv6 address]%br0 # replace with your local network interface after '%'
    • sudo dpkg-reconfigure openssh-server # if you get ssh errors and have to use console
    • grep "${OLDVM}\|${NEWVM}" /etc/hostname # always verify!!!
    • sudo sed -i 's/${OLDVM}/${NEWVM}/g' /etc/hostname
    • grep "${OLDVM}\|${NEWVM}" /etc/hostname # and check my work!
  • virsh reboot ${NEWVM}
  • Add DNS records for the new VM.
  • virsh shutdown ${NEWVM} # when you're done

Clone a CentOS VM

  • Read https://help.ubuntu.com/community/KVM/Virsh. This was a CentOS 7 clone.
  • virsh list --all
  • virsh shutdown ${OLDVM}
  • virsh list --all # verify that shutdown completed
  • sudo virt-clone --original ${OLDVM} --name ${NEWVM} --prompt # first time, or
  • sudo virt-clone --original ${OLDVM} --name ${NEWVM} -m [previous MAC] --prompt # subsequently, if you're learning by breaking as I did
    • answer /dev/vg_${HOST}/vm_${NEWVM} to prompt if you named yours like mine
  • virsh list --all
  • virsh start ${OLDVM}
  • sudo virt-sysprep --hostname ${NEWVM}.${DOMAIN} --enable cron-spool,dhcp-client-state,dhcp-server-state,logfiles,mail-spool,random-seed,ssh-hostkeys,yum-uuid -d ${NEWVM}
  • virsh start ${NEWVM}
  • The clone has my user account and other niceties, but I don't know its address. Luckily I can use available information and link-local IPv6.
  • virsh domiflist ${NEWVM}
  • ipv6calc --action prefixmac2ipv6 --in prefix+mac --out ipv6addr fe80:: [that MAC]
  • ssh [replace with that IPv6 address]%br0 # replace with your local network interface after '%'
    • grep "${OLDVM}\|${NEWVM}" /etc/hostname # always verify!!!
    • sudo sed -i 's/${OLDVM}/${NEWVM}/g' /etc/hostname
    • grep "${OLDVM}\|${NEWVM}" /etc/hostname # and check my work!
    • sudo vgrename centos_${OLDVM} centos_${NEWVM} # or use lvm, see below
    • grep "${OLDVM}\|${NEWVM}" /etc/fstab
    • sudo sed -i 's/${OLDVM}/${NEWVM}/g' /etc/fstab # only needed if vgrename used
    • grep "${OLDVM}\|${NEWVM}" /etc/fstab
    • grep "${OLDVM}\|${NEWVM}" /etc/default/grub
    • sudo sed -i 's/${OLDVM}/${NEWVM}/g' /etc/default/grub # only needed if vgrename used
    • Now is a good time to add the RHEL7 console tips below!
    • grep "${OLDVM}\|${NEWVM}" /etc/default/grub
    • sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    • grep "${OLDVM}\|${NEWVM}" /boot/grub2/grub.cfg
    • exit # log out of ${NEWVM} now
  • virsh reboot ${NEWVM}
  • Add DNS records for the new VM.
  • virsh shutdown ${NEWVM} # when you're done

Enable CentOS Console Access

Typically, you don't care about console access until it's the only way to get out of trouble. So enable it right away if it isn't working yet. Check with 'virsh console ${NEWVM}' and press return at least once to see if you get a login prompt.

The directions for RHEL6 are https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/sect-Virtualization-Troubleshooting_-Troubleshooting_with_serial_consoles.html. Edit the /boot/grub/grub.conf file to append this to the kernel line: console=tty0 console=ttyS0,115200

The directions for RHEL7 are http://www.daemonzone.net/e/17/, to add the following lines to /etc/default/grub:

GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0,115200n8"
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
Since mine already had GRUB_CMDLINE_LINUX (to apply it to all the menu entries), I just appended " console=tty0 console=ttyS0,115200n8" to that line inside the quotes, then added the next two lines. Next you need to rebuild the grub.cfg file:
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

LVM

[${ME}@${NEWVM} ~]$ sudo lvm
lvm> pvdisplay
lvm> vgrename centos_${OLDVM} centos_${NEWVM}
  Volume group "centos_${OLDVM}" successfully renamed to "centos_${NEWVM}"
lvm> pvdisplay
lvm> lvdisplay
lvm> exit

Loose Ends

sudo virt-inspector -d ${NEWVM}
sudo virt-filesystems -d ${NEWVM}
sudo virt-df -d ${NEWVM}
sudo virt-df
sudo virt-edit -d ${BrokenGuest} /boot/grub2/grub.cfg
sudo virt-rescue -d ${BrokenGuest}

Saturday, January 10, 2015

Canon MX870 Print Head "Repair"

I'm usually cranky when the directions I want are only available on YouTube because I can read much faster than the video plays, and I find the extra time to be excruciating. Seriously, please just tell me in words!

A few months ago, my Canon PIXMA MX870 printer decided that it would mostly print yellow: no cyan printing, and only sometimes the faintest magenta printing. I suppose the other colors weren't cheerful enough? Some searching indicated that the problem was the print head. I tried all of the printer's built-in cleaning routines to no avail. I looked at replacement printers (I mostly print kid pictures), but I decided to see if I could fix it. It wasn't useful the way it was, replacing it seemed likely, so I had nothing to lose for trying. After a while, all remaining hints pointed YouTube. I decided that removing a print head might be best described in a video, so (prepare yourself for the shock!) I watched YouTube videos about printers.

The video that worked for me was "How to remove and clean a Canon printhead" and it delivered on the promise of its title! I thought I might need to watch "The secret on how to remove the Canon print head" but the first video with some gentle but persistent jiggling was sufficient.

What I had to do was to remove the ink carts, then remove the print head. I rinsed the print head in warm water from my kitchen faucet at a low pressure for several days (in between bouts of going about my regularly scheduled life), until I no longer saw any ink bleeding out when I did so. Yes, I spent days rinsing the print head, but it was essentially a free experiment. La, la, la, several days of rinsing and a day of drying later, I re-installed the print head and the ink carts. And my printer worked again! I couldn't believe something so cheap and easy actually resurrected my printer, but it did! I'm so glad I didn't replace it hastily!

Thursday, January 8, 2015

Recycled and Reusable Produce Bag

I thought this was too simple to post, until two weeks ago. I was at the grocery store, and I handed my reusable shopping bags to the checkout clerk. He said, "I'm glad you remembered; sometimes I forget." I replied that's why the bags live in the back of my car, so I can remember them. Then he asked, "Where did you get these produce bags?" I explained that I ran some yarn through the top of plastic mesh bags, and the one he was holding right then was from the turkey I had cooked for Thanksgiving. After a moment of stunned silence on his part, he said, "That's awesome! High five!"

produce bag

So in case it's not completely obvious, start with a plastic mesh bag. For me, the larger ones are more useful, and the most plastic-y ones hold up better. I typically re-use these from bags of onions, but this turkey bag is bigger. Weave a long length of yarn over and under at the top until you've woven all the way around; I used a crochet hook for the weaving. Make sure the yarn is larger than you ever expect to open the expandable mesh bag! I have tried plarn and shoelaces, but yarn slides most easily on the bags I've made. So I don't have to weave the yarn in again, I knot the ends together. Store your produce bags with your reusable grocery bags.