Saturday, December 3, 2011

Chrome OS ssh

We recently bought a Samsung Chromebook (v5) to replace a 3-year-old laptop. I must say, I'm impressed. It's not a Macbook Air, but it's surprisingly close considering the price ($350). It's small and light, boots quickly and has amazing battery life. 'course, it's basically just a Chrome browser, but, seriously, how much more do you need in a laptop?

Ah, yes, after two days of using it, I yearned for one more thing: ssh. But, Chrome OS is a bit more than advertised---it's easy to access a shell and ssh support is native. Press Ctrl+Alt+T to bring up a shell. Type "ssh user host" to ssh. Yup, it's that easy.

I like the fact that they chose Mac-style mouse controls. You have to push down to click, scroll is achieved by swiping two fingers and right-button is press with two fingers. One drawback compared to the Air is that scrolling isn't as slick. It's certainly more effort to get to the right place on a page versus using Chrome on an Air. But, the Chromebook doesn't seem to have the odd bugs that Mac OS X does, like the occasional inability to focus after logging-in.

Update 12/4/11: After reading this post I was afraid that my Chromebook might not do video chat (at least not without some effort on my part). My suspicions were proven wrong when I tried video chat today. It worked fine. The speakers and microphone seemed a little weak, and it took me a little while to realize that to maximize you have to hit the "full screen" button (in the top row of the keyboard next to the reload button), but it's fine for family video chats.

Sunday, October 16, 2011

Fixing Woodpecker Damage

Yesterday morning, I heard a rat-tat-tat noise while sitting in my study. I thought it might be some nearby construction, but wasn't sure, so I went upstairs to check. The noise was coming from the back of the house. "That's strange," I thought. Construction noises usually come from the front of the house. The noise was clearly coming from the back of my dining room. Now that I was closer, I knew what it was---a woodpecker. My first thought was to try to scare it off. I quietly opened a door to the deck, then walked to the back of the dining room and made a loud noise. I barely caught a glimpse of the bird as it flew away.

It was clear where the woodpecker had been---there was a 1"x3" hole in my wood siding. He had drilled all the way to the plywood. Not sure what to use to fill the hole, I went to Home Depot. They recommended Minwax High Performance Wood Filler. I brought it home and read the instructions. It recommends gloves and eye protection, so I got some latex gloves and safety goggles from high school chemistry class (somehow I've kept them over all these years...). I used a plastic bowl to hold the stuff and a plastic spoon to mix and apply the stuff (they recommend a plastic putty knife, but I don't think it would have worked any better). You definitely want to use disposable things---don't use your good putty knife. The filler looks like a grey goop and isn't that easy to remove from the container. It took me a few minutes to remove enough to my plastic bowl. Also, you'll probably want to do this outside---the wood filler *stinks*. I scooped out about half the filler, then mixed in about half of the hardener, which comes in a little plastic tube. I stirred until I couldn't see white streaks from the hardener, then climbed my ladder to apply.

The mixture was a pain to apply. It was easy in a tiny hole the woodpecker had created, but in the main 1"x3" hole, the stuff just wouldn't stay---it would gradually slither out. What's the point if it won't stay in place? I kept trying to push it back into the hole and after a few minutes, it started to hold a bit better. Then I realized that the mixture in my bowl was starting to harden. I tried to put some of the semi-hardened mixture in the hole and my patch started to harden-up. After another minute of futzing with the stuff, it finally looked like it was going to hold. Phew! I suspect that I should have mixed the goop better and waited a few minutes before trying to use it---it was just too liquid-like at first. But, it appears to have done the trick. I'll report back sometime later to let you know how it hold up. One plus is that the goop perfectly matches the color of my shingles :-)

Monday, September 19, 2011

Calibrating Sound Levels with ALSA

I'm trying to use a single headset for both listening to music and talking on the phone (via Google Voice). It's more difficult that it sounds! One big problem I found is that when talking on the phone, I have to jack-up the output volume (to close to 100%). But, at that setting, music playback is extremely loud---I prefer approximately 33%. Fortunately, there is a way to modify the volume of a particular application. Under Preferences->Sound->Applications, I found an "ALSA plug-in [ogg123]" control. I play music with ogg123. I can use this slider to control volume of music playback. By setting this slider to 33%, I can set the overall output volume to close to 100% and not have to switch volume back-and-forth when I go from listening to music to talking on the phone.

Thursday, September 15, 2011

Weather Percentiles

I just learned about It provides historical temperature information better than any other web site I've seen. The best part is the fact that it provides not just high/low means, but percentiles, so you can get a sense of how variable the temperatures are and whether-or-not the weather you're seeing is extreme. They overlay actual temperatures so you can easily compare actuals versus historical patterns.

Friday, September 9, 2011

How to Set the Font in New Emacs Windows

I frequently use C-5-2 to get a new window without creating a new emacs process. In emacs lingo, each window is called a frame. At some point, I was surprised to find that the new window had a font different than my default font. After some searching, I learned that emacs has a completely separate font specification for new frames. See the GNU Emacs Manual page on Creating Frames. At the bottom of that manual page is where you'll find the recipe:

(add-to-list 'default-frame-alist '(font . "6x13"))
I've used my favorite font name ("6x13") in this example, but that may be too small for many people. Many fonts are available. Try "10x20" for a larger size. Also see the GNU Emacs Manual page on Fonts

Tuesday, September 6, 2011

How to Take a Screenshot using a Mac


Note that this automatically saves a file to the desktop. You will not see any prompting or indication that the operation is complete. Just go and look for a file on your desktop.

Monday, September 5, 2011

Don't Freak Out if Your Baby Eats One Lily of the Valley Berry

Yesterday, I went on a walk with my wife and two kids (4 yo daughter, 1 yo son). On our way back home, my daughter picked a reddish-orange berry off what was likely a lily of the valley plant (we have a ton of them in Natick). My daughter loves picking berries. She does it almost every time we go on a walk. So, when we got home, my wife and I didn't think to be worried about the fact that she'd probably bring it home and leave it on the table in the playroom. Normally, that wouldn't be a problem since as of one week ago, our son wouldn't be able to reach such a berry. But, beginning about a week ago, our son has started pulling himself up. And, he loves exploring new sights and chewing on anything he can get in his mouth. So, the inevitable happened. One of us heard him coughing and came to check him out. Suspiciously, he wouldn't open his mouth. Normally, he lets us see inside with little prodding. We knew something was up. Then, we remembered---the berry!

After we stuck him in a high chair to keep him still, one of us managed to get a finger in his mouth and swipe out the skin and seed of a reddish-orange berry. My wife suspected Lily of the Valley (LotV) and recalled that the berries are toxic. I confirmed online that LotV has such a berry. I called the national poison control emergency line. They recommended going to the emergency room, but recommended that I talk to my local poison control first. The Massachusetts poison control told me not to worry---the berries are technically toxic, but one berry is not a problem for (even) a one year old child. She said we only need to worry if he starts acting strange---lethargic, nauseus, vomiting. Phew! We both heaved a sigh of relief. My wife didn't completely believe poison control and called our doctor. He said we did the right thing and, yes, we should believe poison control---there is absolutely nothing to worry about.

Note: When I called the 800-222-1222 number Sunday afternoon, I was transferred to the national center. They gave me the following local numbers, one of which connected me to the local poison control: 800-682-9211, 617-232-2120, 617-355-6607.

Sunday, August 28, 2011

City of Wonder Tips

I tried out the Google+ games on Friday. Boy is it a lot easier to pop pigs in Angry Birds at 40 frames per second with fine aiming control than it was on my phone at about 3 frames per second with the precision of finger painting. I also tried out City of Wonder (CoW). It's basically a Civilization copy-cat, but with lots of bonuses for getting your friends to play with you. I was addicted to Civilization and now I'm a bit hooked on CoW. What's a bit interesting about CoW is that everything is wall-clock based. Unlike Civ, you don't have to have the game running to make progress. But, every time you produce something, you have to claim it. The rates of production are very aware of this. You can produce more money from a goods facility by choosing the 5 minute option every time. But, to make that work, you have to check-in and click on the facility every 5-10 minutes. Even if you're at the computer all day, you can't do that while you're sleeping! There are longer options, including 24 hours, but the rate of production drops off quite a bit the longer period you choose. Another trade-off in the game is space. You start with 81 squares and don't automatically get more space as your population grows. You have to pay for more space, either in coin or by accumulating allies.

Anyway, what have I learned after two days of playing? Here you go.

  • Population: you are required to have one unit of happiness for each unit of population; if your population count exceeds your happiness count, you can't increase your population. So, make sure to place enough cultural and/or decoration facilities to support your population. Since you can't be at your computer all the time, it's better to buy residential facilities with longer waiting times between generation (especially since the rates don't differ that much).
  • Density: After a few levels and a few thousand people, you'll find that your space is a bit tight, especially if you buy the cheaper facilities. It's worth to pay a bit more to get more compact production/happiness even if the benefit per coin is lower.
  • Storing/Moving: One bit of flexibility you may not be accustomed to is that saving and moving facilities is free. If you bought some cheap facilities that you don't have space for, you can save them ("Put Away"). When you expand your boundaries, you can bring them back for no charge. Also, moving facilities from one location to another is free, so don't worry to much about optimizing placement.
  • Roads: As far as I can tell, roads are useless and merely waste space. I've read that other versions of CoW give you production benefits for placing facilities adjacent to roads, but I don't see any such benefit in the Google+ version.
  • Research: Always make sure you are researching something. This is how you unlock advanced facilities. Never spend all of your coin if you will need it to research the next item. Be very aware of how long until your next research item is complete. If you are close to completing some research which will open a more advanced facility, it may be better to wait instead of investing in a less advanced facility.
  • Goods: Unlike other production facilities, you get to choose the waiting time for each production batch. When I can check the computer regularly, I've found that a waiting time around half-an-hour is best. When you're away from the computer for longer, choose the waiting time that corresponds to the amount of time you expect to be away. Why? (1) Production rates are structured to be higher for shorter waiting times, and (2) a percentage of the final payout must be paid up-front to initiate production and will be lost if the production is cancelled. So, selecting too long of a production reduces flexibility and often leads to less overall production. But, if you pick a time that's too short, the produced goods may "expire", leaving you with nothing for your investment.

Saturday, August 27, 2011

No Hurricane, Just a Heck of a Lot of Rain

By the time Irene makes it to the Boston area, it will no longer be a Hurricane, but we're guaranteed to receive a ton of rain as a result of Irene. The first wave started about 1:30pm and it only took two hours to accumulate 1.5 inches. I'm a bit scared to see how much rain we'll get when the center passes west of us Sunday afternoon. The NWS only predicted 4-5 inches total for the western suburbs of Boston. But, if we get anywhere near 1/2 inch per hour for much of the 36 hours that Irene is affecting the area, we could easily exceed the 13.2 inches we got in the March 2010 floods. Before this storm started, we had already accumulated 5 inches of rain in August.

Update 8/29/11: We ended-up with only 3.77 inches of rain for the storm. Apparently that thunderstorm that hit early afternoon Saturday was unusual for even Irene.

Tuesday, August 23, 2011

My First Earthquake

No, no, no. I didn't cause an earthquake. :-)   I felt an earthquake for the first time---a few minutes ago, I felt the building moving. A short bit later, everyone on the floor was talking about how they felt the building moving too. Well, it turns out there was an earthquake at about the time we felt the building move, but it was near D.C. What?!?! Is that possible? My wife said she didn't feel anything. But, I'm sitting on the 10th story of a 10 story building. I didn't feel any shaking, only minor swaying. One of my colleagues says it's very possible since the waves are magnified the higher-up you are. Another colleague found a link to local seismic readings. The readings are off-the-charts (relative to what we normally feel here in Boston which is appx. nothing). Note that the earthquake occurred at 1:51pm and local readings spiked about 2.5 minutes later (red blob on right side below). I've included the image below since it may disappear after today.

Here's the wikipedia link.

Update (8/24/11): I discovered how to access a specific date in the archive and updated the above link to the seismogram

Monday, August 22, 2011

Producing Good PDF Presentations via LaTeX

I'm in the process of creating slides from LaTeX. Though LaTeX isn't as fancy as other presentation software, it seems to be the only decent solution for which runs easily on Linux. Below is a collection of tips:

  • Beamer seems to be the best LaTeX package for presentations. For example, Beamer makes it downright trivial to display a list one bullet at-a-time.
  • \pause before a list item will reveal later items after earlier items. If you want to reveal list items one-at-a-time, use
    to start the list.
  • To put two items side-by-side, use a minipage. For example, here is a template to display a list on the left and an image on the right:
    \item one
    \item two
  • Use pdflatex to generate PDF. One advantage is automatic usage of Type 1 scalable fonts (as opposed to bloated, ugly Type 3 bitmapped fonts which you may get if you convert from DVI or EPS to PDF). Note that you can check fonts in a PDF file by selecting File->Properties->Fonts in evince.
  • If you can't or don't want to use pdflatex, include \usepackage{pslatex} in your document preamble and use the -Ppdf option when running dvips.
  • If you use the AUCTeX Emacs package, you can run the pdflatex command easily from Emacs by configuring a pdflatex command via your .emacs file:
    (eval-after-load "tex"
      '(add-to-list 'TeX-command-list
    		'("pdflatex" "pdflatex %s" TeX-run-command t t :help "Run pdflatex") t))
    Note that you can reload a file in evince with Ctrl-R.

Here is a template:








\item First Topic
\item Second Topic
\item Third Topic


Thursday, August 18, 2011

Stocks Are Cheap

Don't believe me? Consider Dell which currently has a market cap of approximately $25.9 billion (stock price of $13.70 8/18/11 10am). This is effectively the price for Dell; if you buy a share now, you pay a small fraction of this price and gain ownership of an equally small portion of the company. Now, what does this $25.9 billion price tag get you? Well, a lot of cash, for starters. Dell has $14.5 billion in cash and short-term investments. These are assets that are highly liquid and not needed for day-to-day operation of the company. On the other hand, Dell has debt, $7.6 billion of it. Subtract net cash from that price tag and you arrive at an approximate enterprise value of $19 billion. This is the effective value of the business itself. How much money does this business generate? Current trailing-twelve-month income is $3.2 billion after tax. That works out to a yield of 16.8%. If Dell were to simply maintain and pay-out earnings, you'd double your investment in less than five years! (assuming you could reinvest pay-outs at the same yield) Dell will not do this; instead, Dell is likely to use some earnings to grow the company and other earnings to buy back stock. But, these actions aren't all that different from simply paying-out earnings. Buying back stock is roughly equivalent to paying a dividend---it reduces the pool of shares, making your shares worth more. And, though there are no guarantees and earnings/revenue have been flat for a few years, reinvesting earnings is likely to grow the company at a modest clip, increasing the earnings to compare against that enterprise value.

What I don't understand is why bond and stock prices are so out-of-sorts. Dell effectively pays a yield of 16.8%, yet, bond investors are willing to accept a yield of 3.57% on 30-year U.S. treasuries. Of course, the U.S. is guaranteed to pay interest on the bond (worst case they can print more dollars), whereas there is risk that Dell will reinvest earnings unwisely or be bested by other companies. But, 13.2 percentage points is quite a large margin considering the track-record of the U.S. economy and what a strong, prosperous company Dell has proven to be.

P.S. Net mutual fund flows help to explain why stocks are so cheap. $30 billion moved out of equity funds for the week ended 8/10/11. While this is a small fraction of the tens-of-trillions of equity in global stock markets, it is also the largest such negative move since the last major crash. Investors are scared. It's a great time to buy :-)

Wednesday, August 17, 2011

How to Install Debian Backports

I'm stuck on Debian oldstable (lenny) for the moment. I needed to upgrade to Firefox 3.5 which is available in lenny-backports. After a bit of searching and fiddling, it turned-out to be very easy. There is basically just one thing you have to do---add the following lines to /etc/apt/sources.list:

deb lenny-backports main contrib non-free
Of course, you'll need to change lenny to the stable verison you're using if you're not on lenny. After that update, do the usual apt-get magic:
apt-get update
apt-get install the-package-you-want-to-upgrade
Assuming it is in backports, it should "just work".

Note that the standard instructions tell you to add preferences so that only the package you want to upgrade is allowed from backports. But, if that package depends on later versions of anything, you'll need to add preferences for those packages, and if those packages depend on later versions, you'll need to add more preferences, etc. Seriously? I think the author is just being too darned careful. :-) Maybe it's better to comment-out that sources.list backports line after you've installed what you wanted...

Tuesday, August 16, 2011

Beware Google Chrome 13

I can't run Google Chrome on my work machine any more. Why, you ask? A few days ago, I noticed that a new Chrome stable was available. I had already updated at home so I downloaded the 64-bit deb and ran dpkg -i to install. To my surprise, it barfed-up a list of failed dependencies. No problem. I'll just go back to using Chrome 12, right? Wrong! dpkg overwrote my Chrome 12 install before it checked dependencies. Does anyone else see anything wrong with this?

Off I went in search of a Chrome 12 .deb package. After searching for a while and only managing to find an old Chrome 12 Windows package, I threw in the towel and switched to Firefox/Iceweasel. Boy do I miss Chrome. Why doesn't Google allow you to download old versions? I couldn't find a link anywhere. If anyone knows where I can find a 64-bit Debian Chrome 12 package, please let me know. It probably will only be a few more months before I can upgrade my machine to Debian stable (I'm currently stuck on oldstable which was current as of 6 months ago), but these will be a few months of painful web browsing.

Monday, August 15, 2011

Teaching Your Children to Read

My daughter recently turned four. While she enjoys it when I or my wife read to her, it is clear that she is just beginning to gain the skills necessary to read. We've taught her the alphabet and numbers. With a little help, she can even count to sixty. When I read to her a book she knows, she can "read" it pretty well, telling me most of the words. But, when we read a book that she doesn't know so well, it's clear that her skill is memorization, not reading.

Recently, a discussion at work pointed to, an educational reading web site. I sat down with my daughter one day and started on the learn to read section which focuses on letter combinations. She had a lot more trouble than I expected. What I hadn't realized is that she knew the names of the letters, but not the sounds they make. Today, I took a step back to the ABCs section. Perfect! She clearly didn't know the sounds, but quickly picked-up most of them with ease. There are still a number of letter sounds she doesn't know (especially vowels), but she enjoyed the Starfall lessons and games and was even able to do a few entire letter lessons by herself (moving & clicking the mouse) by the end.

I'm glad I found Starfall. Before, I didn't have a clear idea of the steps necessary to take my daughter from following along while I read to reading on her own. Now, the path is much clearer. Also, I'd like to compliment the authors of Starfall on the level of quality they were able to create without relying on ads/sponsorships/etc. Being a software engineer myself, I know how difficult it can be to put together the skills necessary to create the interaction they've created. Thank you!

Saturday, August 13, 2011

What's Wrong with this Monetary Policy?

Currently, the Fed is holding short term rates at historic lows; it has declared that it will keep rates extraordinarily low through mid-2013. Consider the context of this action:

  • Retail sales up 8.5% versus a year ago (July 2011)
  • Producer prices up 7.0% versus a year ago (June 2011)
  • Consumer borrowing up 1.7% versus a year ago (June 2011)
  • Jobs up 1.3 million versus a year ago (July 2011)
  • Durable goods orders up 7.9% versus a year ago (June 2011)
  • Personal income up 5.0% versus a year ago (June 2011)
  • Industrial production up 3.4% versus a year ago (June 2011)
  • Consumer price index up 3.6% versus a year ago (June 2011)
These look like classic signs of expansion to me.

The media seems to be upset that GDP growth has been "low" in 2011 (0.4% in Q1 and 1.3% in Q2), but those that whine about GDP growth don't seem to recognize the increased personal saving rate---it dropped from 12% to 2% between 1981 and 2007, but is now hovering around 5%. The rates of growth we're used to (80s, 90s, 2000s) are artificially high because they relied on a decrease in the savings rate. Now that the savings rate has increased, there just isn't as much money available for spending/growth. So, average GDP growth of 2% might be normal for the foreseeable future. Note that GDP is stated in "real" terms, i.e. inflation adjusted, so inflation can hurt just as much as a lack of economic activity.

Based on the above numbers, it seems to me that the Fed should be at least as concerned about inflation as it is about economic activity. Consumer prices are up 3.6% and producer prices are up a whopping 7.0%. Most national banks try to keep inflation around 2%. It was one thing to keep rates near zero when prices were flat-to-negative, but keeping interest rates so low while prices are moving up strongly is dangerous. It appears to me that this inflation is what is hurting GDP growth now. Though personal income has risen 5.0% in the past year, real income growth has only risen appx. 1.4% (due to the 3.6% increase in consumer prices). A year ago, GDP growth was much stronger because personal income was still around 5% but consumer prices were increasing at a rate of about 1%.

I doubt the Fed is listening, but if they are, consider this a plea: please raise the federal funds rate. If the above argument doesn't convince you, consider that you can't go below 0%. If the federal funds rate isn't increased and there is another shock to the U.S. economy in the next year or two, the Fed won't be able to help.

Sunday, August 7, 2011

How to Wire Cat5 Ethernet Cable for 100Base-TX

I'll answer your first question first: why not 1000Base-T? Well, the simple answer is that 100Base-TX requires 4 wires whereas 1000Base-T requires 8. While 4 more wires may not sound like much, I've found it exponentially more difficult. With 4 wires, I feel that I have good individual control. With 8, there always seem to be one or two wires with a mind of their own. And, how often do you need more than 10 megabyte transfer speeds?

Next, your second question: why would you want to create your own Ethernet wire? Why can't you just buy pre-made? This answer comes in two parts: (1) it's fun, and (2) I never seem to have the right length on-hand. When 14 feet is required, 10 feet doesn't cut it and 25 feet seems like overkill. Sure, in some cases, the right size can be ordered, but I'd rather make it on-the-spot than wait for delivery. And, some sizes simply aren't sold.

Do I have your attention now? Good. To make your own cable, you'll need 2-3 tools (in addition to some raw cable):

  1. RJ45 crimper (appx. $20)
  2. RJ45 connectors/jacks (appx. $10 for 100)
  3. wire cutters (appx. $20) (optional)
The crimper has blades to cut your wires, but I prefer a pair of good wire cutters like the linked ones. Once you have your tools, you'll need a good diagram of how to align the wires. I like the diagram in this How to Wire Ethernet Cables page. Hold the connector with gold pins up, opening close to you and release lever on bottom. Pin 1 is on your left, pin 8 is on your right. You only have to connect four wires (T568A):
  • pin 1: white/green
  • pin 2: green
  • pin 3: white/orange
  • pin 6: orange
You can cut off the four brown and blue wires---you don't need them for 100Base-TX. Once you've managed to align the wires into the correct pins, make sure the casing is in the connector far enough that it will be clamped inside the connector when crimped. Also, make sure the small wire extend all the way to the end of the connector---I check this by looking on the bottom of the connector (release lever side). If everything looks good, insert the connector with wires into the 8 pin socket of the crimper and press down hard. Be careful of the blades on the crimper. Do this on both ends and you should have successfully made your own 100Base-TX. Of course, it's quite possible (likely?) your first attempt will fail, so start with a short wire and test it. In my experience, it's easy after you've made one or two wires.