Monday, June 19, 2006

Unix dates

I've been working on a project where I need to know all of the changes made in the past day to a closed database. Luckily, two of the fields are mdl_create_time and mdl_modify_time so I have a place to start. One of the values was 1140056407. Hmm, looks like epoch time. I asked the database's GUI, and it told me Thu 16 Feb 2006 02:20:07 GMT, so I verified the language. Now I need a way to bring that into a shell script. There's always the reference in Sys Admin magazine, but that seemed like more work than I should need.

Here's the simplest answer so far: to convert from a long number to a human-readable date, use date -r 1140056407. To generate that long number, use date +%s. (And of course, to see the current date in human-readable form, use date.)

Off to see if I can finish the job in shell!

Zip Tip

Problem: You might wonder why the zip and unzip commands aren't symmetric. After all, you can run unzip file.zip to extract a file, so why doesn't zip file compress it?

laptop:~ hope$ zip file

zip warning: missing end signature--probably not a zip file (did you

zip warning: remember to use binary mode when you transferred it?)

zip error: Zip file structure invalid (file)

Solution: The reason why is because zip wants a file name for the compressed file.

laptop:~ hope$ zip filename.zip file

adding: file (deflated 71%)

Aside: What will really mess you up is that gzip-gunzip and bzip2-bunzip2 don't have the hysteresis of zip-unzip. You can run gzip file and gunzip file.gz all day long!

laptop:~ hope$ gzip file

laptop:~ hope$ gunzip file.gz

laptop:~ hope$ bzip2 file

laptop:~ hope$ bunzip2 file.bz2

Happy compressing!

Sunday, June 4, 2006

Eleventh Month

Yep, this baby goes to eleven! He looks more like a person (less like a baby) all the time. He saw balloons for the first time this month, and he was overcome with joy! He gasped, his knees went weak, he trembled, and he reached for those balloons. He didn't care if he were holding a balloon or not, he just wanted to see them. Wonderful things, you know! He really enjoys playing with balls, especially those that fit in his hands, so maybe balloons remind him of balls.

He has new sounds, one of which I call the dying woolly mammoth. So that means his high-pitched scream is now the squeaky mammoth. He also babbles, says Da da, Mom mom, and ish in addition to the woolly and squeaky mammoths.

Development

He started cruising this month, sometimes going six feet away from where you set him down. He seems really determined to start walking soon. He'll let go of your hand, and reach down for a toy or balance or take three steps without help. When he gets excited, he starts jumping, either while walking or when in his jumperoo. He got much more serious about cruising and walking starting Memorial Day weekend, doing much more of it. That's when he started to complain that he can't see his feet while in jumperoo.

Layette

Since he's barely 18 pounds, he still wears all of his 6-9 month onesies. In fact, he still wears his Carter's 3-6 month onesies because those top out at 18 pounds. I buy his clothes by the weight range, not by the age range.

Feeding

He was not interested in food this month. For the entire month, he ate as much food as he did in the last two weeks of last month! We thought he might want to start solid food, but he sure doesn't eat much of it. Sometimes he has as many as 5 AlphaBits. He did eat some of my chicken sandwich this weekend, though!

Sleeping

He still doesn't sleep through the night. The definition of a good night is when he only wakes up once, he nurses, and he falls asleep again. Daddy was out of town for three nights in the middle of the month (ugh!), and Karston didn't want to sleep at all, so I had to find something. I put him on a contoured changing pad in our bed, and he loves it! So we're co-sleeping now, and we seem to have more good nights. With two new teeth coming in at the same time this month, we had more good nights with co-sleeping than I expected. I think the cozy shape of the contoured changing pad makes him happy, and he adores seeing us so close. Of course we stopped swaddling him to sleep a while ago.

Furniture

We borrowed a Kelty Kids backpack to compare to our Gerry backpack. I've heard that you should buy child-carrying backpacks from a backpack manufacturer for best ergonomics, so I expected to love the Kelty. The Gerry weighs 1.5 pounds and he sits very close to me (which he loves). The Kelty weighs 5 pounds and holds him away from my back (making quite the lever arm). It also hits my short torso even lower than the Gerry. Can you guess that I don't like the Kelty? The automatic kickstand means that you need a second adult to put it on, the air gap between baby and back means that his kicks can put me off-balance easier, and the added weight is significant. We're sticking with the Gerry even though it isn't as safe (no baby harness to hold him in, and he does try to jump out) because falling over with the Kelty isn't safe either.

Travel

We went to the beach, and learned that he likes to sleep in a cozy nest. We didn't bring the contoured changing pad, and we had to improvise one out of rolled towels so we could sleep through (most of) the night.

Mom

I'd love to sleep, but at least co-sleeping has more good nights than not. No time to exercise, but toting a kid seems to be enough exercise to keep my knees and back in reasonable condition.

Total weight change: holding at 10 pounds below.