Banana Oatmeal Bread
24 July 2009 at 21:09
I made some very good banana bread tonight:
- Cream 1 cup of sugar and a half cup of butter and a healthy tablespoon of honey.
- To that, add two eggs, a teaspoon of vanilla extract, 3 ripe bananas, a pinch of cinnamon and a pinch of nutmeg. Drop in 4 tablespoons of sour cream. Beat it silly.
- While that is mixing, in another bowl mix 1 cup of whole wheat flour, 2/3 a cup of AP flour and a cup of quick cooking oats. Mix in a teaspoon of baking powder, 1/2 teaspoon of baking soda and a pinch of salt.
- Slowly add that to the mixing wet ingredients.
- Pour into a greased 8x8 baking dish.
- Chop together about a cup of oats, about a cup of brown sugar and 1/3 cup of butter. I added about a tablespoon of flax seed to this.
- Sprinkle that mixture over the top and bake at 350f for 40 minutes or until the center sets.
It's good alone and great with a scoop of ice cream or some peach slices. I think it could also be nice with a few nuts or raisins thrown in the batter.
Salting Passwords in plain sight
24 July 2009 at 18:57
Interesting method of creating a unique salt that can only be derived from the password being encrypted. If you used a salt created by an algorithm based on something known, an attacked who had access to the DB and the salting method could devise a cracking mechanism.
But with this, even if you have both of those you would still not be able to crack the password without trying every possible password against itself - a feat that approaches impossibilty.
Forking PHP
23 July 2009 at 16:10
Filed Under: coding, php
Interesting code used to fork long running processes in php.
The first script, prefork.php, is for forking a given function from a given file and running n children that will execute that function. There can be a startup function that is run before any forking begins and a shutdown function to run when all the children have died. The second script, prefork_class.php, uses a class with defined methods instead of relying on the command line for function names. This script has the added benefit of having functions that can be run just before each fork and after each fork. This allows the parent process to farm work out to each child by changing the variables that will be present when the child starts up. This is the script we use for managing our Gearman workers. We have a class that controls how many workers are started and what functions they provide. I may release a generic class that does that soon. Right now it is tied to our code library structure pretty tightly. We have also included two examples. They are simple, but do work to show you how the scripts work.from: http://brian.moonspot.net/php-fork
