Posts Tagged 'Guide'

May 30, 2011

Summer Tips to Clean Your Ride

Snowy Cars

Remember this? Your car does.

Now that Memorial Day officially marks the beginning of summer and the temperature is creeping back up, it's time to take care of that neglected car that battled the cold winter and the spring rains. Outside of work, a lot of fellow SLayers are into cars ... Some show them off, others focus on making them faster. And given the fact that we are professionally obsessive about keeping our data centers clean and tidy, that obsessiveness is pretty evident in how hard we work to keep our cars clean.

Since today is a holiday in the US, I want to take a break from the down-and-dirty server stuff to give you a quick glimpse at what many SLayers are doing today: Cleaning their rides. Like a lot of the technical troubleshooting we do, it's best to stick to a particular flow of steps to cover all the bases and get the best outcome. The following steps are the ones I take to bring back the showroom-floor shine. Since the typical car detail can run anywhere from $50-$300 this is a great way to save money every month ... so you can order another server or upgrade the hardware on an existing one. :-)

What You'll Need

  • Bucket
  • Soap
  • Sponge or Microfiber or Sheepskin Glove
  • Clay Bar
  • Wax and Foam Wax Applicator
  • Quik Detailer
  • Glass Cleaner
  • Tire Shine - Optional
  • Microfiber Towels - The more the merrier
  • Beer (or beverage of choice) - Optional ... also the more the merrier
  • Bonus: Swirl Remover - If you're using a rotary buffer
  • Bonus: Finishing Polish

Note: In all steps where washing is involved, rinse first to get any loose dirt off then gently scrub and rinse off. Car should be parked in the shade to avoid water spots. All steps after clay barring MUST be done in the shade.

Step 1: Washing the Wheels
Make sure your brake rotors have cooled before hitting them with cold water, otherwise you could risk warping them. Because of the dirt and grime wheels get, I recommend using a separate bucket and sponge for this step.

Step 2: Washing the Rest of the Car / Drying
Always work from the top of the car to the bottom, and the best practice is to do one panel at a time.
Frequently rinse your sponge or glove to release the dirt it picks up.
When scrubbing the side panels, it's better to go up and down instead of side to side or in circles.
Drying panels as soon as you've rinsed them helps prevent water spots.

Step 2.1: Tire Shine (Optional)
Try to keep Tire Shine on the tires only. If you get it on the wheel, it'll just allow dirt and/or brake dust to attach to the wheel.
Don't overdo this or it will just splash back onto your car when you start driving.

Step 3: Clay Bar
Spray Quik Detailer onto surface and gently rub the clay bar from side to side.
Fold the clay bar between sprays. This keeps the clay bar surface clean.
Dry leftover Quik Detailer with a microfiber towel.

Step 3.1: Swirl Remover then Finishing Polish (optional)
Best when used with a rotary buffer at high speed.
If doing by hand, using pressure, apply in small circular motions.
Remove with a microfiber towel.

Step 4: Wax
Using either a foam wax applicator or rotary buffer on low speed, apply wax as thinly as possible, otherwise it will be harder to remove.
When the surface looks hazy, remove with a microfiber towel.

Step 5: Quik Detailer & Glass Cleaner
Use Glass Cleaner on windows and mirrors.
Quik Detail the whole car again.
These steps clear off any leftover dust from waxing as well as remove any water spots from water that may have crept out after waxing.

Step 6: That's All!
Crack open a beer and gaze at your beautiful car ... *wipe drool off of face*.

The process can take as long as several hours to complete depending on how bad your car needs a cleaning. If this process has been completed recently, you can skip Steps 3 and 4, as clay barring is only needed ~2-3 times a year and waxing every 2-3 months.

If you're like us and you love showing off your car, after it gets all dolled up, post a link to a picture of it here in the comments!

-Tommy

January 12, 2011

'What\'s with These "Quote" Things?'

'We\'ve' . "all $een" . 'this' . $problem . 'before' . $and->it . ((1==1) ? 'seems' : 'dosen\'t seem') . sprintf('about time to %s things', 'clarify');

PHP string handling can be a tough concept to wrangle. Developers have many options: single / double quotes, concatenation and various string manipulation functions. The choices you make have a significant impact on the readability and performance of your script. Let's meet the line-up:

The Literal
Single quotes are used to define a string whose contents should be taken literally. What this means is that PHP will not attempt to expand any content contained between the ' '.

This is the way to tell your favorite Hypertext Preprocessor, "That little guy? Don't worry about that little guy."

In most cases this is the de-facto standard for strings. However, when a decent number of variables become involved it tends to become difficult to keep your quotes accounted for. When combining simple strings with variables and single quotes, the "." operator is needed between each variable/string. That "." is known as the concatenation operator.

Input:
$date = 'Yesterday';
$location = 'outside';
$item = array ( 'description' => 'lovely', 'name' => 'butterfly');
$content = $date . ' I went ' . $location . ' and caught a ' . $item['description'] . ' ' . $item['name'];

Output: Yesterday I went outside and caught a lovely butterfly

The Interpreted
Using double quotes will cause PHP to look a little closer into the string to find anywhere it can "read between the lines." Variables and escape characters will be expanded, so you can reference them inline without the need for concatenation. This can be useful when creating strings which include pre-defined variables.

Input:
$file = 'example.jpg'
$content = "<a href=\"http://www.example.com/$file\">$file</a>"

Output: <a href="http://www.example.com/example.jpg">example.jpg</a>

In previous versions of PHP there was a significant performance difference between the use of single v. double quotes. In later versions performance variations are negligible. The decision of one over the other should focus on feature and readability concerns.

The Thoughtful
Unlike single and double quotes, the sprintf function comes to the table with a few cards up its sleeve. When provided with a formatting "template" and arguments, sprintf will return a formatted string.

Input:
$order = array ( 'item' => 'RC Helicopters', 'status' => 'pending');
$content = sprintf('Your order of %s is currently %s', $order['item'], $order['status']);

Output: Your order of RC Helicopters is currently pending

When constructing a complex string such as XML documents, sprintf allows the developer to view the string with placeholders rather than a mish-mash of escaped quotes and variables. In addition sprintf is able to specify the type of variable, change padding/text alignment, and even change the order in which it displays the variables.

The debate over the most efficient method of string definition has raged for years and will likely continue ad infinitum. However, when the benchmarks show their performance as almost identical, it leaves you with one major question: What works the best for your implementation? Typically my scripts will contain all of the methods above, and often a combination of them.

print(sprintf('The %s important thing is that %s give them all a try and see for %s', 'most', 'you', 'yourself'));

-Phil

July 27, 2009

Cool Tool: find

Have you ever gotten an e-mail from your server that a particular partition is filling up? Unfortunately, the e-mails don't usually tell you where the big files are hiding.

You can determine this and many other handy things by using the Unix utility 'find'. I use the 'find' command all the time in both my work at SoftLayer and also for running some sites that I manage outside of work. Being able to find the files owned by a particular user can be handy.

The 'find' command takes as arguments various tests to run on the files and directories that it scans. Just running 'find' with no arguments is going to list out the files and directories under your current location. Real power comes from using the different switches in various combinations.

find /some/path -name "myfile*" -perm 700

This format of the command will search for items within /some/path that have names starting with the string 'myfile' and also have the permission value of 700 (rwx------).

find /some/path -type f -size +50M

Find files that are larger than 50MB. The '-type f' argument tells find to only look for files.

find /some/path -type f -size +50M -ctime -7

Find files that are larger than 50MB and that have been created in the last seven days.

find /some/path -type f -size +50M -ctime -7 -exec ls -l {} \;

The -exec tells find to run some command against each match that it finds. In this case, it is going to run an 'ls -l'. Moves, removes and even custom full scripts are doable as well.

There are many, many more arguments that are possible for 'find'. Refer to the man pages for find on your particular flavor of Unix server to see all the different options for the command. As with all shell commands, know what you are running. Given the chance 'find' will wipe out anything it can ( via -exec rm {}, for example).

Subscribe to guide