Thanksgiving Turkey Brine

This year I decided to do something different with my turkey. Brining. This was something I had never heard of till this year and now that I know of it I will never cook another turkey any other way. So what I have decided to do is write up a little post describing the process I took. But before I get to that here is the basic recipe for a turkey brine. Now the items on this list can really be anything you want as long as the salt to liquid ratio is kept to 1 cup salt per 1 gallon of liquid. The amount of liquid will depend on the size of the turkey. You will want to have at least an inch of water above the turkey when you brine it. This is for an 18 pound turkey.

1 1/2 gallon water
3/4 gallon Pineapple juice
2 cups Kosher salt (very important! Cannot be iodized salt!)
2 cups sugar
Assortment of spices (I had 6 Bay Leaves, 2 tbl spoons of Cilantro, 5-6 pieces of
Peppercorn, 2 tbl spoons of onion powder)

Now here is the process I took.

Two days before the big turkey day I prepared the brine. I put 1 gallon of water, 1 cup of salt, and 1 cup of sugar into a large pot. I then brought it to a boil so the salt and sugar would completely dissolve into the water. Once this was complete I added half the spices and mixed them together. I then moved the mixture into a large container to cool. I then repeated the process with the remaining ingredients. The following pictures are the results of the mixture.

I then put these into the fridge to get cold over night.

Now to brine a turkey you need to purchase a fresh turkey. It cannot be a frozen or kosher turkey. This is because with frozen or kosher turkeys they pre-inject it with a salt mixture to allow for the turkey to be moist when cooked. If you tried to brine a frozen turkey it would come out way to salty to eat. With this in mind I purchased an 18 pound fresh and all natural Butterball turkey. You can find these in the fresh meat department in your local grocery store. The one that I go to (Publix) puts them out no earlier then a week before thanksgiving. You will also want to brine the turkey for at least 12 hours. A good rule of thumb is 1 hour per pound but no more then 24 hours. I think 12 hours is plenty of time for the job to be done.

So the next night around 10pm I was ready to put the turkey in the brine mixture. They sell bags specific for brining but I had a hard time finding them. You can use XL Ziploc bags as well but yet again I could not find them. I did not have the time to order them online so I purchased 3 of the oven bake turkey sized bags. I also bought a large drink cooler to store it in overnight. You can use anything as long as it is plastic and clean. A bucket will work just as good.

I lined the cooler with the three bags and poured the now cold brining mixture into the bags. I then placed the turkey in with the large hole facing down. This was so I could make sure all parts of the turkey was being covered with the brine. You want to also make sure their are no air bubbles left. I then closed the top of the bags and placed a ziplock baggie full of ice on top to keep the turkey fully submerged and cold. Here are some picks of this part of the process.

I left the turkey in the brine mixture inside my fridge for the next 12 hours. The next day I took out the turkey, cleaned off all the brine mixture, and pat dry the turkey to remove any remaining salts. I then cooked the turkey as normal. Four hours later I had a nicely done turkey! The turkey came out fantastic! It was moist, had an excellent flavor to it and even looked good among the rest of the food. Here are some pictures of the turkey after it was cooked.

Well there it is 🙂 My brining experience. I think the turkey came out better than ever and I am going to cook it this way from now on. I will be playing with the mixture of spices to get the perfect mix down! If you want to try this don’t hesitate! It is very simple and flexible. You can make any flavor you want.

– Miah


Happy Thanksgiving

I hope everyone had a wonderful thanksgiving!

As this week has been hectic getting everything ready for the big turkey day I did not have time to prepare my weekly PHP Functions post. I will be back on schedule next week. I am going to instead prepare a post on brining a turkey. I had for the first time this year bought a fresh (non-frozen) turkey and took the challenge of brining the turkey before cooking it. It came out fantastic! I will have a post up describing the actual process I took tomorrow.

For now I will leave you with this!

function happyThanksgiving() {
    echo "Happy Thanksgiving!";


PHP Functions 101 – array_push()

Hello and welcome back for my next installment of PHP Functions 101. This week I’ll be discussing the array_push() function. This is another simple function that I use often when dealing with arrays. Here is the definition from

Push one or more elements onto the end of array

This is a simple function. As the definition states above it simply pushes an element onto an existing array. You can push any kind of element; an object, simple variables, even other arrays. The function takes at least two parameters. The first being the array we are adding (pushing) the elements onto and the remaining variables are the elements to be added (pushed) onto the array. You can push as many elements on as you want.

Here are a couple examples. I’ll do a simple one then a more complex example.

// The big 'ol array that stores everything
$bigOlArray = array();

// Simple variables
$someString = "This is a simple string";
$someInteger = 42;
$configurationArray = array(
    "id" => "x302",
    "power" => "Asgard",
    "weapons" => true,
    "shields" => true,
    "shieldLevels" => 100
$strikeFirst = false;

// Push them all into the same array
array_push($bigOlArray, $someString, $someInteger, $configurationArray, $strikeFirst);

With this example we simple made the main array, $bigOlArray, and then created a bunch of different variables then pushed them all onto the one array. This next example will hopefully be a more practical use of the funciton. I will use it to read in a file and take all the configuration info from the file and combine it into an array using the array_push() function.

/* Open the file we want to read in */
$fh = fopen("/path/to/file/the_file",'r');

if (!$fh) {
    // Put error checking code here
} else {
    $elementData = array();
    $temp = array();
    $newField = false;
    $value = "";

    // Loop through the file
    while (!feof($fh) {
        $line = fgets($fh);
        if (strstr($line,'[END FIELD]')) {
            if ($newField) {
                /* Put the temp config array into the element array */
            $newField = false;
            $temp = array();
        } else  if (strstr($line,'[FIELD]')) {
            $newField = true;

        if ($newField) {
            /* Add the configuration line to the temp array */
            $ft = explode(" = ",$line);
            if (isset($ft[1])) {
                if (trim($ft[1]) == "true") {
                    $value = true;
                } else if (trim($ft[1]) == 'false') {
                    $value = false;
                } else {
                    $value = trim($ft[1]);
                $temp[$ft[0]] = $value;

/* Close the file */

What this script does is read in a file, then it searches for field definitions. Once it finds one it reads each line of the field definition into a temp array. Once it reaches the end it pushes the entire array onto the end of the main elements array. The script keeps this up till it reaches the end of the file where it then closes the connection to the file. PHP does have a function called parse_ini_file() which will do basically the same thing. It reads a configuration file and returns it as an associative array. I’m hoping though that the example above gave some insight in how you can use the function and the power it can have.

Well I hope this has brought something to a few readers out their. I haven’t decided yet what I will do for next week. Maybe It’ll probrably be one of the various string funcitons like strstr() or str_replace() or something similar. As always if you have any requests let me know 🙂

Thanks for reading!
– Miah

Easy MySQL Database Migration

Tonight I’m going to put down something I learned just yesterday. How to easily migrate MySQL Databases across servers via the command line. Now I’m a beginner Linux Admin as my focus is on PHP Development but ever since I got myself a dedicated box at Rackspace I’ve had to learn a few tricks. Over the past month I have learned a host of them due to migrating from one Rackspace box to another. My biggest challenge was moving some of my MySQL Databases. A couple of them were quite large and PHPMyAdmin was just not up to the challenge. So after some searching and one phone call to the excellent Rackspace support team I had my solution and I am going to share this tidbit with you all.

The solution is something that any MySQL guru probably already knows but I think beginners and amateurs in command line techniques will benefit. It consist of three commands. They are as follows:

mysqldump --database --opt [DB NAME] > [DST FILE NAME].sql

The first and last commands are mysql commands and the middle one is a Linux command. What these three commands basically do when used in this sequence is:

  1. Dump a DB to a SQL file
  2. Transfer the created SQL file to another machine. (scp = Secure copy)
  3. Fill a DB with the contents of a SQL file.

When you run the scp command you will be prompted for the password associated with the username you are trying to connect with. Now scp only works on the same network but you can get around this by downloading the sql file via FTP and then uploading it to the destination machine.

You will also need to create the DB before running the last command.

Now this is pretty straight forward and easy to accomplish and now that I have this knowledge I am able to move databases in less then a minute! This made my last night of migrating painless. Also it will make things easy when I need to synce the servers DB’s with my own local machine for development or bug testing.

Here are links to the documentation for each command if you want to delve deeper into any of the available options.

MySQL – The official website

All questions and comments are welcome!

– Miah

PHP Functions 101 – print_r()

Hello all, this will be the first in a weekly tradition I am starting today. Every Thursday night I plan on publishing an article on one PHP function. I will start with the ones I use most frequently then move onto the more obscure ones so I can digest and learn all I can while passing that knowledge to others.

So to start of this week I’ll go with a function I use quit often while I am building a website; print_r(). Here is the official description taken straight form the manual on what this function does:

Prints human-readable information about a variable

Now what does this mean exactly? It is really quit simple. The function takes a variable, it doesn’t matter the type. It could be an Object, Array, or a simple integer and it spits it out onto the screen so you can see exactly what it is. It is pretty useful when building and debugging a script.

One word of caution when using it though. Since it can and will most likely be displaying sesitive information about your application you want to use it in a secure environment if at all possible. If not then at least in a development environment (which should be secured anyways). If this is not possible I will use it on a refresh then quickly comment it out so it will hopefully not be seen by regular users. I hate doing this so in these cases I also add in an IF statement to only show the output to my IP address. The morale of this long rant. Be cautious, as you don’t want to allow any kind of security leak.

Now that my security rant is over lets move on. The print_r() function takes one required parameter and one optional parameter. They are as follows:

mixed $expression
bool  $return = false [optional]

The first parameter is the actual variable you are examining.

The second parameter is optional and defaults to false. All this does is tell the function to either display the results to the screen or return the results as a variable for later use. I have never yet had a reason to set this optional parameter to true. Now onto some examples.

We have just used the print_r() function to print to the screen an array of fruit names for an application we are working on. Here is the code:

$fruit = array('Apple','Mango','Banana', array('Strawberry','Blueberry','Cranberry'));

// The output of this call is as follows:
Array ( [0] => Apple [1] => Mango [2] => Banana [3] => Array ( [0] => Strawberry [1] => Blueberry [2] => Cranberry ) )

This is pretty useful if you have a complicated script and need to see what is inside an array or object that is set in another file or are the results of a DB query. The only problem I find with this is the output. With the example above it isn’t too bad but if you have a large array or object you are examining it can get very messy  and confusing to look at. What I have done to overcome this shortfall to the function is create my own modification of it. The function is rather quite simple. I have seen people do this trick but since I like to write as little code as possible whenever I can and to reuse my code I created a function to accomplish it. My solution to the output problem is this:

function print_a($a) {
    echo "<pre>";
    echo "</pre>";

$fruit = array('Apple','Mango','Banana', array('Strawberry','Blueberry','Cranberry'));

// The output of this call is as follows:
     [0] => Apple
     [1] => Mango
     [2] => Banana
     [3] => Array
         [0] => Strawberry
         [1] => Blueberry
         [2] => Cranberry

Now we have a much more readable output and can understand the structure of the array much easier.What makes this possible is by echoing out the HTML <PRE> tabs. What these tags do is allow for text to display correctly within the browser as it is written. It keeps all it’s formatting and white space  which is normally stripped out by the browser. With the function I created to accomplish this I can call print_a() in replace of print_r() any where in my code to have nicely formatted output with out any extra code.

For a wrap up. The print_r() function is a very useful function when building an application or debugging one. It allows you to examine any variable or expression to get a better understanding of it’s structure and what it contains. It is most useful when examining arrays and objects. You also have to be mindful of where you use it as you don’t want to expose sensitive data to the world. The function also prints the results, although readable, in an ugly format when not surrounded by the HTML <PRE> tags. Using a costume function like mine above you can get nicely formatted output without having to surround each call or print_r() with the <pre> tag.

I hope this has been helpful and any and all comments are welcome. If you know any more information you think should be added to this let me know and I’ll be glad to add it and give credit to the addition. Next week I’ll discuss another function from the PHP library that I use often, array_push(). If you would like me to discuss a certain topic please let me know.

– Miah

Fantasy Cartography

Well I’ve finally started to learn more then just the basics of Photoshop. I’ve for years have been able to scrap by with the bare minimum of knowledge with this vast program and to top it off my artistic skills are not the greatest when it comes to pen and paper.

With this in mind I am taking something I have always loved to do and using it to build up my skills. Making maps. I’ve always loved to sit down and draw out a world map, area map, or interior map for my fantasy/sci-fi RPG games. They were crude and done with graph paper mostly but they got the job done. Now however I am up for the challenge of making maps with a bit more flare and style.

I’m going through all the tips, tricks, and tutorials I can to help me along. One great site is the Cartographers Guild located at [link] They have a wealth of information to help map makers along. The vast amount of styles you can have for your maps can look overwhelming at first but once you get into actually making them the feeling passes quickly as you realize how many of the tricks can be used for the different styles of maps.

So here I am. Finally trying to improve my artistic skills. I’ll be using this to mark my progress and post all the maps I will be making!

Thanks for listening.