Monday, October 26, 2009

My Steak Method

I posted this on Fark a bit ago, and figured since I typed it all out I might as well save it for posterity's sake.

1. The cut and quality of the meat are of significant importance. You really can't go wrong with a choice or prime T-bone. I like mine about 3/4 to 1" thick. Any bigger and it doesn't grill well.

2. It has to be room temperature before it's put on the grill. Let it sit out for 15 minutes or so before you put it on the grill.

3. Cooking time and temperature are important. I crank my grill up to high and do 3-4 minutes, flip, 3-4 minutes. That gives me a good rare-medium rare. Don't worry about any flames, it'll char the outside but won't be going for long enough to cause it to burn.

4. It has to sit for a few minutes after it's taken off the grill, the inside of the steak will cook from the heat of the outer parts. Take it off the grill, THEN get out any plates/flatware. Get your sides together, take your time, I give it 3-5 mins.

For seasoning, I use McCormic Grill Mates® Montreal Steak Seasoning. Work it on there with your hands so it sticks well, be generous but don't go overboard.

Raw steak is shitty, rare-medium rare is fucking amazing.

Friday, September 25, 2009

Awesomebars

The Smore meets the Rice Krispy Treat

1 jar of jet puffed marshmallow creme
1 brick of graham crackers
1 cup of milk chocolate chips
1 stick of butter

Crush the graham crackers (a plastic bag and rolling pin work wonderfully). Mix the marshmallow creme, graham cracker crumbs, and chocolate chips. It'll be somewhat stiff, but get the mixture to be fairly homogeneous. Melt the stick of butter in a separate bowl, I nuked mine for 1 minute and it was boiling a bit when I pulled it out. Pour the hot butter into the mixture and stir, it should start to stir more easily. At this point, the result should have a texture a lot like Floam.

Put it in the fridge to solidify.

I'm not sure if it'll hold together at room temperature, it's plenty tasty cold.

Video

Tuesday, May 19, 2009

Our future Agrarianism

I was working outside in my garden yesterday when I began thinking hard about the shape of society. I think the future of a sustainable society, ultimately lives in agrarianism. For most of us that means a semi-rural lifestyle. But how will that look for the average family?

Suburban residential lots will get larger, I'd guess at least quarter acre each. An acre (minus the square footage of the house and a few other things) can grow plenty of food for a family of 4 with a lot left over for selling/rainy day storage. Lots smaller than a quarter acre will probably eat up neighboring lots and our cities will be much less populated as a result. Most of us will probably have at least a few chickens, their low upkeep costs and high utility will make them a popular choice. Some of us may have goats (or sheep, climate permitting); call them rapid composters ;) We'll see a resurgence of organizations like 4-H and FFA for kids, and similar organizations forming for adults.

Some brilliant people are coming up with ways to garden with the least amount of inputs, while maximizing outputs. Our large scale agriculture is the brute force method, and the permaculture movement is proposing new methods production. These are generally, though not always, focused on smaller scale (read: homestead) agriculture. Large scale agriculture will probably refocus it's efforts on things that are hard to achieve in a single acre, namely ranching and utility crops like cotton and hemp. Nature has given us some great building blocks, and they work well enough for their own purposes. But that's not what we want, we're humans and by our ingenuity we can bend and utilize nature to better fit our needs.

My grandparents, who would've been about 80 years old now, had their own land and a significant garden. If you have relatives who are, or would have been about that age today, I suspect they would have been in a similar situation. That's how life was when they grew up, agrarianism was IT (though the industrial revolution was certainly churning away). I think it's a shame that way of life has waned. What's good for us, today, is we know more than ever about doing sustainable agriculture more easily. I'm glad I had that exposure, it's an absolute key to who I am today, it gives me that hickory smoked country flavor.

So why do I think this is the future of society; why post-industrial agrarianism? First and foremost is energy demand. The Asian countries (India included) are experiencing their industrial revolutions. Prices of oil and coal are going to go through the roof out of demand alone. Second, the yet to come spectacular failure of the US economy and all of us here are going to be in a bad way, unless or until we change. Third, it's a rewarding experience. I can spend many rewarding hours out in my garden, and it's not even growing anything right now! A fascinating connection to life, and nature is missing for most people, and it's time to revive that connection.

What examples are there for us to follow? Well, not many, but a good one is Cuba. When the Soviet Union collapsed Cuba was left to fend for itself. Not only did it's prime economic partner go out of business, as it were, the US has put increasingly tight sanctions on Cuba - to the point where it was essentially forced into self-sustainability. They have small scale agriculture all over, use essentially organic farming methods, and an overall sense of community is now much more pervasive there.

It's a shame that as a society, we've come to look upon an agrarian existence in such a bad light. I'm bringing it back to myself, with a modern twist, and I hope others will too. There's a groundswell of support in this movement; join us, for your sanity, for your humanity, for your future.

Wednesday, December 17, 2008

Java XML validation, "Cannot find the declaration of element"?

Many thanks to Santiago Pericas-Geertsen, who blogged about this exact problem earlier this year. If you can't figure out for the life of you why your document won't validate, even though you know it's valid, try setting setNamespaceAware(true) on your DocumentBuilderFactory:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);

Chances are that's all you need and you'll be up and running.

Programming is easy, it's all the gotchas that make it hard.

Friday, August 1, 2008

Netbeans-Apache Commons library importer

I threw together a script to download the latest version of all the Apache Commons components, and create the library files used for Netbeans. It's a little rough and short on docs, but easy enough to use. Some components can't be downloaded and processed easily (those with -e) and the signature of betwixt can't be verified because it's key is out of date, so we force it's acceptance (-f)

cd ~
mkdir JavaLibraries
wget http://www.apache.org/dist/commons/KEYS -qO - | gpg --import
./asfcommons2nb.pl --sig --dir JavaLibraries/Commons \
-e daemon \
-e httpclient \
-e jci \
-e latka \
-e attributes \
-f betwixt


When you're done, you'll want to copy the xml files from JavaLibraries/Commons/Libraries/
to ~/.netbeans/6.1/config/org-netbeans-api-project-libraries/Libraries/
Replace the bold part with the appropriate version.

It's pretty smart. It'll check to see that you have the current version and only update if you don't.

I like Netbeans' library feature, but keeping up to date on things sucks. If you don't care about docs, Ivy would suffice, but I do want instant javadoc access. That's why I'm using an IDE!

Anywho, it's public domain, feel free to send me enhancements or bugfixes.

Wednesday, March 19, 2008

CA signed SSL certs in glassfish, for lazy admins

So setting up CA signed SSL in Glassfish sucked, until I finally found the process for doing so. John Yeary outlines the process, but it's still manual and annoying.

Never do more than twice anything you can script, and so here we go. The script below is designed to work with CACert.org certificates. Save it to your local system and run it as a user who has access to write to the Glassfish installation.

#!/bin/sh
# Copyright 2008 Jeff Rodriguez [jeffrodriguez.com]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

/bin/echo "This script was designed to work with CACert.org."
/bin/echo "It may work with other sites, YMMV."
/bin/echo "USE AT YOUR OWN RISK."
/bin/echo -e "\n\n"

read -rp "SSL domain name [`hostname`]: " DOMAIN
if [ -z "$DOMAIN" ]; then DOMAIN="`hostname`"; fi

read -rp "AppServer domain directory [/home/`whoami`/SUNWappserver/domains/domain1]: " DIR
if [ -z "$DIR" ]; then DIR="/home/`whoami`/SUNWappserver/domains/domain1"; fi

read -rp "Keystore password [changeit]: " KSPASS
if [ -z "$KSPASS" ]; then KSPASS="changeit"; fi

# Make sure the domain directory is correct
KS="$DIR/config/keystore.jks"
if [ ! -e "$KS" -a ! -w "$KS" ]; then
/bin/echo "Your keystore ($KS) is not writable."
exit 1
fi

# Handy alias
KSCMD="keytool -keystore $KS -storepass $KSPASS"

# Generate the key
if ( ! $KSCMD -genkey -keyalg RSA -alias $DOMAIN -keypass $KSPASS -noprompt -validity 365 -dname "cn=$DOMAIN"); then
/bin/echo "Failed to generate key."
exit 1
fi
/bin/echo -e "\n\nA private key has been created in your app server's keystore."
/bin/echo "If this script fails at any point, and you wish to start over, you must delete this private key with the command: "
/bin/echo "$KSCMD -delete -alias $DOMAIN"
read -sp "Press enter to continue." REPLY
/bin/echo -e "\n\n"

# Create the CSR
if ( ! $KSCMD -certreq -v -alias $DOMAIN -file /tmp/$DOMAIN.csr); then
/bin/echo "Failed to create certificate signing request."
exit 1
fi

/bin/echo "Below is your Certificate Signing Request (CSR)."
/bin/echo "On the CACert.org website, go to Server Certificates -> New. Paste the text below into the form and submit it."
cat /tmp/$DOMAIN.csr
rm -f /tmp/$DOMAIN.csr

# Get the certificate
/bin/echo -e "\n\nCACert will generate a signed certificate. Paste it here, finish with EOF (CTRL+D)."
cat > /tmp/$DOMAIN.crt

# Fetch the CACert certificates
/bin/echo "Before you can use your certificate, it has to be imported to the app server keystore. To do that, we first have to import the CACert.org certificates."
read -rp "Would you like the script to automatically download the certificates? [y|N]: " DLCERTS

if [ $DLCERTS = 'Y' -o $DLCERTS = 'y' ]; then
wget -q --no-check-certificate -O /tmp/cacert_root.crt "http://www.cacert.org/certs/root.crt"
wget -q --no-check-certificate -O /tmp/cacert_class3.crt "http://www.cacert.org/certs/class3.crt"
else
/bin/echo "You have chosen not to automatically download the certificates. To do this manually,"
/bin/echo "Go to http://www.cacert.org/index.php?id=3"
/bin/echo "Save the Class 1 PKI Key Root Certificate (PEM Format) as /tmp/cacert_root.crt"
/bin/echo "Save the Class 3 PKI Key Root Certificate (PEM Format) as /tmp/cacert_class3.crt"
read -sp "Press enter to continue." REPLY
fi

if [ ! -e /tmp/cacert_root.crt -o ! -e /tmp/cacert_class3.crt ]; then
/bin/echo "CACert certificates weren't found in /tmp. Either automatic download failed or you have not manually downloaded the certificates properly."
exit 1
fi

# Import the certificates
if ( ! $KSCMD -import -v -alias cacert -trustcacerts -noprompt -file /tmp/cacert_root.crt); then
/bin/echo "Failed to import CACert root certificate."
exit 1
fi
if ( ! $KSCMD -import -v -alias cacert3 -trustcacerts -noprompt -file /tmp/cacert_class3.crt); then
/bin/echo "Failed to import CACert class 3 certificate."
exit 1
fi
if ( ! $KSCMD -import -v -alias $DOMAIN -trustcacerts -noprompt -file /tmp/$DOMAIN.crt); then
/bin/echo "Failed to import domain certificate."
exit 1
fi

# Cleanup
rm -f /tmp/cacert_root.crt
rm -f /tmp/cacert_class3.crt
rm -f /tmp/$DOMAIN.crt
$KSCMD -delete -alias cacert
$KSCMD -delete -alias cacert3

# Final instructions for the user
/bin/echo -e "\n\n"
/bin/echo "The certificate has been imported into your app server keystore."
/bin/echo "To use the certificate follow these last steps:"
/bin/echo " 1. Go to your Admin Console (http://$DOMAIN:4848), Configuration, HTTP Service, HTTP Listeners, http-listener-2 (or whatever your SSL listener is)."
/bin/echo " 2. On the SSL tab, set your Certificate Nickname to $DOMAIN, and click save."
/bin/echo " 3. Restart the app server."
/bin/echo "NOTE: Your certificate will expire in 1 year, you must update the certificate before then or browsers will receive SSL warnings; other programs may fail entirely."
/bin/echo "Mark your calendar. No, really."
/bin/echo -e "\n\n"
/bin/echo "If something went, or goes wrong, it could prevent your app server from starting. One possible remedy is to locate your SSL http listener in $DIR/config/domain.xml and disable it."

Though supposedly, it's technically possible to use an existing private key and certificate, you'll shoot yourself in the face before you finish. Cut your losses and just start over with a new private key and cert. You'll have to pardon me if the script is a bit rough around the edges. Send patches my way if you like.