Thursday, November 10, 2011

New Blog

I created a new blog, Recipes of a Hearty Chef, for recipes. I've been wanting to post more recipes recently, but felt that Ramblings of a Computer Guy was an odd place for them. I'm hoping that, paradoxically, having two blogs will encourage me to post more often on both.

Saturday, December 11, 2010

Linux Mint 10

According to two articles on Linux Magazine, Linux Mint is the next big Linux distro. Taking the advice of the latter article ("Linux Mint 10: A Perfect 10?"), I decided to download the Linux Mint 10 install live DVD and give it a spin in a VirtualBox OSE virtual machine.

Unfortunately, it was quite possibly the most frustrating and dissappointing Linux live installer I have ever tried. I shall now enumerate the problems I encountered:

1. Metacity crashes

Or, at least, I think it was Metacity. The title bars would disappear from all open windows, and I could no longer change the window Z-order. I have seen this before, and it was repairable by restarting metacity. I cannot find a reliable sequence of actions to reproduce the problem, unfortunately.

Additionally, even the task bar would crash and restart itself, and I managed to crash the installer by choosing "Quit" from the first page.

2. No LVM

LVM is not installed in the live image, and the installer does not allow configuration of LVM. But even when I installed LVM using apt-get, the installer would not recognize the logical volumes I created. I can understand LVM configuration being a big task for an installer, but at least if it would recognize logical volumes, an advanced user could still set up the system properly.

3. Personal Information Page Broken

The installer page that takes personal information to create the first user refused to take any input in any of the text fields, either during or after the installation finished. By the way, I was very impressed by the installer collecting only the essentials and beginning the copying of the system while the rest of the information was collected. But then it stopped collecting information, and did not finish the install.

I was able to repair the install, but I would be surprised if many users would know or even think to manually repair a broken install. If such a user happens across this entry, here is how to make your system work if the installer fails before finishing:

Step 1: Put yourself into the installed system

Get a root prompt and set up a directory containing the new install:
$ sudo su
# cd /mnt
# mkdir root
# mount /dev/sda5 root
# cd root
# mount -t devtmpfs none dev
# mount -t proc none proc
# mount -t sysfs none sys
# mount /dev/sda1 boot
# mount /dev/sda6 home
# chroot .

Obviously, your partitions will likely be different. The above layout depends on a partition table that looks like this:
/dev/sda1 /boot
/dev/sda2 swap
/dev/sda3 [extended]
/dev/sda5 /
/dev/sda6 /home

Step 2: Create your user

Create a new user for yourself:
# useradd -d /home/jonathan -m -s /bin/bash -U jonathan
# usermod -a -G adm,dialout,cdrom,plugdev,lpadmin,admin,sambashare jonathan
# passwd jonathan

Step 3: Set up grub

Tell Grub to install itself. This is surprisingly easy with Ubuntu-based systems, as the update-grub2 command will do it all for you:
# update-grub2

You should now be able to reboot into your new system (don't forget to remove the disc).

4. Keyboard Layout Not Saved

I use the Dvorak keyboard layout because it feels like my fingers flow better than with the Qwerty layout. I can still use Qwerty, but it feels clumsy. So, when the installer gets to the keyboard layout page, I chose Dvorak. But it did not remember that choice when I booted into the new system, and instead was using the Qwerty layout.

Impressions

Once I had the system running, I really liked what they did with the menu (what I would call the Start menu if it was Windows). It has big icons for all of the important programs right on the first display, along with smaller choices for the other useful but less common programs. They realized something that most other environments have not yet: If you are using the system menu, you are not interacting with another program, so why not take advantage of the screen to display everything well?

I also liked the clean interface. From the boot splash screen to the standard set of sounds, everything is simple and clean, and seems to be inspired by Apple. The icon sets are attractive, and different enough from what you may be used to that they are actually worth looking at.

Conclusions

I will not be using Linux Mint 10 as my OS of choice. I was impressed with the concurrent install/extra setup info, and with the few pieces of the main system after I had it running, but my heart just wasn't in the exploration. Once I discovered that I would be unable to use LVM, I completely lost interest in actually using the system. LVM is to partitioning a hard drive as directories are to a completely flat filesystem, and I cannot live without it.

Perhaps I will try the Debian-based version, or Linux Mint 11 when it comes out, but I am quite satisfied with Kubuntu 10.04 LTS for now.

Wednesday, July 21, 2010

Oracle

I was browsing the Java API docs today and noticed that the Oracle favicon looks like the Eye of Sauron. Has anybody else noticed this?

Friday, May 21, 2010

Chili

I love chili. It's one of my favorite foods. The only problem, though, is that when I make it, I make a lot of it.

This isn't really a problem (I get to eat one of my favorite meals every day for the next two weeks!), except that once I've finished eating all of it, I'm so tired of it that I can't eat any more for a few months.

Anyway, that wasn't why I decided to post about chili. I figured that I've made it enough times to have a recipe that I'd like to share. It's based on my Mom's chili recipe, combined with some input from Alton Brown's chili recipe in The Big Chili and some input from my friend Matt.

This is the basic recipe, and I'll follow it with some options on how to augment it:

Ingredients:

The Beans

1 lbDry Black Beans
1 lbDry Red Kidney Beans
2Bay Leaves
2 tspKosher Salt
2-3 clovesGarlic, sliced thickly
2-4Dried chiles, sliced (optional)
~½ gallonWater
  1. Preheat the oven to 250° While it is heating...
  2. Boil the water. While it is heating...
  3. Sort the beans (remove any pebbles or weird-looking specimens)
  4. Rinse the beans (a colander works well)
  5. Place the beans in a large, oven-safe pot (I use a 2 gallon graniteware), along with the salt, bay leaves, chiles, and garlic.
  6. Once the oven is hot and the water is boiling, pour just enough water over the beans to barely cover them.
  7. Place the beans in the oven, covered, and set a timer for ~20 minutes.
  8. When the timer goes off, check the beans. They will likely need some more water. Re-boil the remaining water (bonus points if you started heating it a couple minutes before the timer went off) and pour some more over the beans (again, just enough to cover them).
  9. Set the timer for 30 minutes and repeat the previous step.
  10. Set the timer for 30 minutes. When it goes off, the beans should be nearly done. Remove them from the oven and drain them (they will be cooked some more later).

The Chili

1-2Large onions, diced
3-5 clovesGarlic, crushed and chopped
½-17oz can of chipotle peppers
314.5oz cans of diced tomatoes, any style
16oz can of tomato paste
215.25oz cans of whole-kernel sweet corn
1-2Fresh jalepeños, diced
1-2 tbspDried oregano
½-1 tspTurmeric
~¼ cupChili powder
~½ tspMSG (optional)
~12 ozDark beer, preferably home brewed
~4 handfulsTortilla chips, crushed coarsly
Salt & pepper to taste
  1. Much of this procedure can be performed while the beans are cooking.
  2. Preheat the oven to 300°
  3. Sauté the onions and garlic. If you are using meat (see below), cook them in the rendered fat from the meat (augmenting with olive oil if necessary). If not using meat, cook in olive oil (no need to use extra virgin, it would be overpowered by everything else).
  4. Dice the chipotle peppers.
  5. Briefly toast the chili powder in a dry skillet, until fragrant.
  6. Combine all ingredients except for the corn, in an oven-safe pot. The pot that the beans were cooked in should do nicely, once they are done and drained. Stir to combine. Add additional ingredients to taste, keeping in mind that the tortilla chips will give up quite a bit of salt as they disintegrate. Don't forget to include both the diced chipotles as well as some of the sauce from the can they came in.
  7. Bake for 1 hour, covered.
  8. Once removed from the oven, stir in the (drained) cans of corn.
  9. Serve, generally over rice with some shredded cheddar on top.

Accents

Depending on whom I expect will be eating the chili, I may go either for a vegetarian or a con carne version.

For the vegetarian version, I will generally add another pound of dried beans (small red beans, navy beans, ...; whatever looks good), along with one more teaspoon of salt and another bay leaf. In the chili, a package of fake ground beef works well, but it generally disintegrates in the oven and provides only a hint of flavor. Tofu chunks also go well, but remember that they will not provide any real flavor, only absorb it. If you use tofu, you may need to add more of some of the other seasonings, especially chili powder. You may also want to drain the tofu first.

For chili con carne, I like to use 1-2 lbs of meat, an equal balance of ground chuck (80-85% lean) and ground pork. Ideally I would use equal portions each of ground chuck, pork, and lamb, but I can never find all three at the same time, so I have never tried it. Brown the meat before cooking the onions and garlic, then cook the onions and garlic in the fat that rendered out of the meat.

In my latest batch, I managed to get my hands on some ground lamb, but I did not find any ground pork. Combined, I had about 0.6 lbs of 80% lean ground chuck and 1.3 lbs of ground lamb. The chili came out quite well, except that it tasted very strongly of lamb. Next time I would discard some of the fat that rendered out of the meat, as I think that provided most of the lamb flavor, and there was quite a lot.

Friday, July 31, 2009

Recession

There's one thing about the recession (and the economy in general) that really bugs me: Debt. Not personal debt so much, but debt owed by governmental bodies.

People complain about how we are becoming a nation of spenders, without saving any money. Where do you think this habit came from? Watching our government! The federal government as well as every single state (as far as I know) owes money to somebody, and is paying interest on those loans.

But, you say, how else would things get done?

Like they get done in the households of people who know how to save! If I want to buy a computer, I save money until I can afford it, and then I purchase it. The same thing goes for jewelry and virtually everything else less than the price of a car.

Loans exist to satisfy the impatience of people. I don't want to wait for 4 years saving money to purchase a new car, when I can purchase it today and pay for it over the next 6 years (notice the time difference there). This is especially true for houses; I don't want to save my money for 20 years to purchase a house, when I can buy it now, move in, and enjoy it while paying for the next 30 years.

But why are governments impatient? Sure that road needs to get paved today, but why not put money aside so that when it needs repaving in 20 years, we don't need to take out a new loan for it?

My problem with governmental debt really boils down to this: It is a black hole. If you borrow money to do something today, then you will need to not only pay back more than what you borrowed, you will also need to borrow more to do that same thing next year (or in five years, or ten years, ...).

So why don't governments save money? Why not tax a little more than you need, invest, and make money, rather than tax less, take out a loan, and lose money (which you will need to replace by taxing more in the future)?

Because elected officials want to lower taxes now, and do not care about the future. I would rather that my taxes went up by 5% today, the government stopped taking out loans, paid off their debt, and was able to drop taxes by 10% in ten years, than have my taxes increase by 1% each year out to the foreseeable future.

So here's my advice to government officials: Once we get out of the current recession, STOP TAKING LOANS! Pay off all of the debt, save some money, and lower taxes as the interest payments start going the OTHER way. It'll be a good model for your citizens, too.

Thursday, June 18, 2009

Bad Burgers

Recently, my company had its annual picnic. It's probably about like any other company picnic, really: A couple guys bring their grills, a couple others bring food, and the vast majority of people donate $5 so they don't need to think about it and can just eat.

Well, this year, only two grills showed up. And this is using the term 'grill' pretty loosely. Each was a tiny little propane-powered vertical vertical heater. Now, I don't have a problem with propane. My grill is propane-fired. But in this case, I realized that other people do have a problem with propane: One of the tanks was empty.

With charcoal, you can tell how much you have. You can't run out without noticing. But with propane... Well, the tank stays the same shape and size no matter how full it is. So if you don't really notice that it doesn't slosh when you pick it up, you might still think it's full.

So back to the story: There's one small grill roaring away, and one that has a tiny little flickering flame in one corner. The two chefs decide to use the grill that has fuel for cooking, and the grill with the pathetic little candle-flame for keeping food warm until it is claimed.

Then the CEO shows up and claims the dead grill.

Don't get me wrong, I really like our CEO. He's an amazingly nice, honest, and straight-to-the-point guy. Plus, he's the new replacement for the bad-tempered owner of the company who used to be the CEO. Think Steve Jobs from Pirates of Silicon Valley, but not so successful and without the great ideas to back up the temper.

So what does this mean? Well, at first it means that he stands there in his apron and laughs about the tiny flame. He flips the burgers that are on the grill a few times, and all is well. Then those burgers get claimed. And he throws a fresh, barely-thawed patty on.

What do you think would happen at this point? If I was cooking, the lid would go down for at least five minutes, then I'd open it and see if any cooking happened at all. Does the CEO do that? Nope. He watches the burger like a hawk for about thirty seconds, and then he mashes it with the spatula, hoping for the sizzle that you get when you squeeze a mostly-done burger on a hot grill. Instead, the patty spreads out a bit and just sits there, silently.

So he waits a bit longer, and mashes it again! It's still raw, there's no juice available to squeeze! The patty takes the abuse silently, spreads out a bit more, and starts to sink though the grate.

You'd think that at this point he'd stop mashing it and let it be. A couple of guys in line for food even mention this, pointing out how it is starting to fall through the grate. In response, he laughs and mashes it yet again!

The poor patty has completely lost its chance of ever being edible at this point, and there's nothing else on this dying grill, so the three guys in line (myself included) move to the line at the other grill, hoping to never see such burger torture ever again.

But unfortunately, the two "chefs" at this grill don't know a thing about cooking either. There is one done burger and three almost-done burgers, along with about six raw patties, two kielbasy, and some chicken breasts. One spatula-jockey just stares at everything, looking confused, while the other mashes the three mostly- or completely-done burgers mercilessly, and occasionally flips one over.

I don't know how many of you out there know how to cook a burger, but unless you're at a fast-food joint where the goal is to serve a tasteless puck of meat, you do not, under any circumstances, mash the burger. Not during cooking, not during formation, NEVER! It may make a cool sound when you squeeze all of the juices and flavor out of it on a hot grill, but that's exactly what you're doing: You're turning what had the potential to be a flavorful, juicy burger into a bland, tough, puck of meat.

So finally the guy in front of me points to the burger that's obviously done and conveys this concept of doneness to the guy manning the grill. The burger is immediately served to him, and he walks away. I continue to stare at the next burger, which by this point is completely done, as the anti-chef flips it over and over, as if expecting it to yell out, "I'm DONE!" when it is ready.

So I say, "That one's done," get my burger, and walk away.

Next year I'm bringing my grill, with the stipulation that I will be the chef on it. And I will spatula-block anybody who tries to squeeze my burgers!

Sunday, May 3, 2009

Basic Electronics

For People Who Don't Get It

From Someone Who Barely Does

Electronics are difficult to understand, especially for a beginner. One of the most difficult parts to understand is the difference between voltage and current, so I'm going to do my best to describe basic electronics using a simple analogy that I've found works well. I barely understand how electronics work, so hopefully my explanations will be clearer than those by professionals, who can make things complicated just by trying to be perfect.

So on to the analogy that I use: water. To start out, I will explain voltage, current, and resistance using the water analogy.

Water

Imagine a squeeze bottle full of water (contact lens solution is a great example, but really any squeeze bottle will work). As you squeeze, you are applying pressure, which forces more water through the nozzle. The pressure that you are applying is like voltage; increasing the pressure is the same as applying more voltage, perhaps by adding more batteries to a circuit. The nozzle is a like resistor, keeping you from emptying the entire bottle at once. Finally, the flow of water coming out is like current.

The squeeze bottle also gives you a simple way of thinking about the relationship between pressure, flow, and nozzle size (voltage, current, and resistance, respectively). As you increase pressure, with a constant nozzle size, you increase the flow through it. Similarly, with an electronic circuit, if you add more voltage (perhaps by using more or larger batteries), but the resistance remains the same, then the current through the circuit will increase. Current is what can destroy electronics, usually by generating heat as it passes, which is why you should never apply extra voltage to a circuit: It will force more current through the constant resistance of the circuit, burning out the components in it.

That wasn't so tough, was it? So let's move on to a few other electronic components that you may have wondered about:

Capacitors

Imagine that you have a rubber bladder blocking off a water pipe. It can stretch, but only so far before it simply stays put (assuming that you don't apply so much pressure that it blows out). This could be useful if you have an uneven source of water pressure; place one of these near the source (but not in the direct line of flow, just off to the side) and it will absorb some of the pressure whet it is high, and then apply some pressure (until it slackens) when the pressure source is too low.

Similarly in electronics, a capacitor helps to even out the sine-wave shape of AC (Alternating Current, like a wall outlet) into something flat. This is especially useful in combination with diodes (covered next), which can help convert AC into DC (Direct Current, what most electronic circuits run on).

Diodes

A diode is like a valve. A valve only lets water pass in one direction, but not in the other. If you've never seen one, it may look like a hole in a metal sheet. A rubber gasket sits on one side, and beyond the gasket is a circle of metal that is free to move against or away from the metal plate. As water tries to flow from the side away from the metal circle, the circle moves away from the plate and allows the water to flow through the opening around it. If water tries to flow the other way, though, it pushes the circle against the gasket on the plate and prevents any flow from happening.

Diodes allow electricity to only flow in one direction, blocking it when it tries to flow the other way. They are the main component of a circuit called a 'Rectifier,' which converts AC into DC. What you do is take four diodes, and you arrange them into a diamond shape, all pointing upwards. Your AC source connects to the two sides of the diamond (at the intersection of the diodes pointing up from the bottom with the diodes pointing up to the top), and your DC circuit connects at the bottom and top of the diamond, at the intersections where the diodes both point away or towards the intersection. Instead of the sine-wave of AC, you'll have what would look like the absolute value of a sine-wave. You can flatten this into almost a straight line using capacitors.

Inductors

An inductor is like a propeller sitting in a water pipe. As the water flows, it resists for a little while as it builds up speed, but once it is running at the same speed as the water, there is no resistance. Then, when you turn off the pressure, it continues to try to turn, pushing more water until it has stopped.

In an electronic circuit, an inductor resists changes in the flow of electricity, just like that propeller.

Transistors

These are the most complex pieces of an electronic circuit, and not only because they connect to three wires instead of the usual two. But I'll try to describe an analogous system using water.

Imagine a straight pipe, allowing normal water flow. Now, add to this a spring-loaded valve. But, instead of the direction of the flow affecting whether the valve is open or shut (or somewhere in between), there is a separate pipe. This separate pipe has only a pressure plate that pushes on the valve, but it does not actually lead anywhere. As the water pressure increases on the pressure plate, it pushes the valve open more; as the water pressure decreases, the spring mechanism pulls the valve shut.

A transistor works like this. The level of voltage applied to the Base terminal allows or restricts flow through the other two terminals.

To complicate matters, however, there are two main types of transistors: NPN and PNP. NPN works like you might expect, with a higher applied voltage on the base allowing more current to flow through the other terminals. PNP works the opposite way: Lowering the voltage on the base allows more current to flow.

Standard Uses

So what's all this stuff good for, anyway? Here's a basic list of applications:

  • Capacitors:
    • Smoothing out a rough flow
    • Storing energy to be released later (like a fast battery)
  • Diodes:
    • Rectifiers -- making AC into DC
    • Protection -- if you worry that someone using your circuit may plug it in backwards, this could keep more sensitive components from blowing up
  • Inductors:
    • Not really sure... I'm guessing that these could also be used to smooth out a rough flow, since they resist change
  • Transistors:
    • Amplifiers -- Apply the signal you want to amplify to the base, and apply a power source to the input terminal (the collector, if you are using conventional current (positive flows towards negative)). The output would be controlled by the signal on the base.
    • Digital switching -- the flow through the collector/emitter is very sensitive to the voltage applied to the base, so you can basically turn the flow on or off. This is how digital logic in computers and other electronics works.

I hope this was informative. If I got anything wrong, please leave a comment, but remember, I'm not trying to be perfectly correct here; that's what has made most basic electronics textbooks too difficult to understand. I'm trying to be accurate enough that people can understand, and perhaps have a better idea of what is going on if they try to learn more later.

Main source of inspiration: "Electricity" Misconceptions Spread By Textbooks, by William J. Beaty.