GETTIN' SWOLE HECK YES - The Basics

Throughout the time I've spent on this planet, I've fulfilled a stereotype that is nearly crucial to every social circle.  We exist as a mechanism to afford others the chance to point and laugh.  We're funny, but mostly because we're like Chris Farley.

I'm fat.

It's been apparent to me for years that I'm overweight, unhealthy, and not a likely candidate for a long existence.  But it was only after I became single again that i realized how bad it had gotten.  This is why I've started a thorough diet and exercise program, and I've seen amazing results so far, and I'm pretty sure I'll continue to see pretty amazing results for some time to come because of my persistence.

At my peak, I weighed between 250 and 255 lbs, at least when I last used a scale before the lifestyle changes, and I stand at 6' tall.  That's a big problem.  I'll let you go do the BMI calculations based off of height.  Yes, it's scary as hell.

The cornerstones of weight loss are all there for me.  Diet and exercise.  This isn't that difficult.  I got some estimates on what my BMR probably was and created a nice caloric deficit.  I was sitting at around 2500/day for maintenance.  Going down to 1250 or 1500 a day won't be a problem, right?

Oh how I was wrong.

See, in all of the weight loss information available to the public, there's a serious lack of information, as well as a serious amount of misinformation.  Here's the low-down: the amount of calories you take in to your body must be less then the amount you expend.  Plain and simple.  However, it is possible to go too low.  That 1500/day made me groggy and put me in a sour mood.  My weight also didn't move the 2lbs that week that I'd hoped for.  I thought "Maybe the first week is just like that", and for some people it is.  But I then found out that I'd made a serious mistake.  I was eating too little, and my body had gone into starvation mode.  Suddenly, it was doing everything it could to expend as little energy as possible, as well as converting as much food as possible to fat while going to my muscles for energy.

This alarmist attitude may be a little extreme for a single week's worth of dieting, and I have no idea if it actually had that much of an impact.  But the fact that I realized this earlier, rather then later, has been key to everything up until now because it helped me realize that this isn't that hard.

That caloric deficit doesn't mean you need to eat less.  It could also mean that you just need to exercise more.  Or you could do a bit of both - give your body proper, balanced nutrition, and exercise regularly.

So then what's your success been so far?

I've lost 20 lbs so far.  A lot of that has been water weight, but a lot of that has been fat, too.  I've also put on some muscle, and I feel far better then I did before.  While these are extreme results, they have slowed down quite a bit.  Once I see the scale stabilize a bit more on a day-to-day basis, I'll be moving to weekly weigh-ins.  I've also started taking pictures to visually quantify my results.

Soon I'll post some stuff soon about the three cornerstones of my success: diet, weightlifting, and cardio.  I'll give you my personal advice and hopefully give somebody out there some ideas about how simple this is.

Until next time.

0 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Why Python Rocks Your Mass File Operations

I've been fooling around with Python for mass file operations for a while now.  It's been good so far, especially with how friggin' simple it is to do just about ANY file operation. 

At work, I sometimes get requested to run mass site updates.  Commonly, I'll be asked to do the same thing to over 30 sites.  In these instances, I've found that writing a Python script to handle at least some of that lifting is worthwhile.

In today's example, we're going to cover updating the source files for a bunch of sites.  These are dirty hacks, and Windows specific, but they work well enough for me.

First thing I needed to do was copy the latest version of our ASP.NET app to every site.  To handle this, I have this:

import os # needed for traversing remote directories
import shutil # needed for file copies and deletes

sn = raw_input( "Folder Name: " ) # ask for the folder name
shutil.rmtree( "\\\\testserver\\inetpub\\webroot" + sn) # completely remove the contents of the directory named for the site
shutil.copytree( "\\\\builds\\asp\\v.1.5", "\\\\testserver\\inetpub\\webroot" + sn) # grab the latest ASPX files for the site
shutil.copytree( "\\\\builds\\bin\\v.1.7", "\\\\testserver\\inetpub\\webroot" + sn + ".wip\\bin" ) # grab the latest DLLs for the site
shutil.copyfile( "C:\\webconfigs\\" + sn + ".config", "\\\\testserver\\inetpub\\webroot" + sn + "\\web.config" ) # copy the web.config for the site and place it
print "Copied!"

"How does this do massive amounts of work?  Looks like just one site to me!"  Yes, but the Windows console is nifty in a lot of ways.  For instance, copy/pasting has some weird quirks and is perfect when you don't want to write or use a parser.  Fire it up and go to the directory the script is in:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Gh0st_Preacher>f:

F:\>cd f:\scripts

F:\Scripts>dir
Volume in drive F is Gh0stData1
Volume Serial Number is E8F9-F338

Directory of F:\Scripts

01/14/2010  11:59 PM    <DIR>          .
01/14/2010  11:59 PM    <DIR>          ..
01/14/2010  11:59 PM               697 copy.py
01/14/2010  11:59 PM             1,954 fileupdate.py
01/14/2010  11:58 PM               268 setro.py
               3 File(s)          2,919 bytes
               2 Dir(s)  583,399,571,456 bytes free

F:\Scripts>

We're working with "copy.py".  Craft a file with a list of the names of the sites you're working with, and put the script before each name, like this :
copy.py
site1
copy.py
site2
copy.py
site3

Stupid, right?  Let's see what happens when I copy/paste that into the console window that's currently in F:\scripts:

F:\scripts>copy.py
SN: site1
Copied!

F:\scripts>copy.py
SN: site2
Copied!

F:\scripts>copy.py
SN: site3
Copied!

That's the actual echo.  The windows console will wait to paste each line until it has the ability to actually place that text somewhere.  Not only that, but it'll translate carriage returns the same as you hitting "enter".  Because of this, you don't need to write a file parser for dumb scripts like this.  This copy/paste system is stupid - I am wholly aware of this - but it's simple and easy.  No extra code.  No nothin'.  Just things working.  I can't really argue with results.

So how else can this be useful?  In my case, I have to modify a value in the web.config files I copied.  The value will be the same across all sites, since we just need to point the site to a different data machine to grab our head, header, and footer files.  here's what I did (credit to TOXiC for the original here):

import fileinput, string, sys # need these for everythang

done = "n"
while done == "n":
    sn = raw_input( "sn: " )
    fileQuery = "\\\\testserver\\inetpub\\webroot\\" + sn + "\\web.config"
    sourceText = "livedata.site.com"
    replaceText = "devdata.internal.com"
    def replacemachine(fileName, sourceText, replaceText):
        file = open(fileName, "r") # open in read-only
        text = file.read() # read the file and assign to a variable
        file.close() # close out the read session
        file = open(fileName, "w") # reopen the file in write mode
        file.write(text.replace(sourceText, replaceText)) # do the replace
        # and write the new file with the correction.
        file.close() # closes the write
        print "servicemachine updated"
    replacemachine(fileQuery, sourceText, replaceText)
    done = raw_input( "done? " )

Now, this time, I decided to get crafty.  See that loop in there?  You can just keep telling it "n" for "done" and it'll start over again.  Starting at F:\scripts, copy/paste a file formatted like this:

fileupdate.py
site1
n
site2
n
site3

Still simple, still stupid, but it still works.  Output?

sn: Site1
servicemachine updated
done? n
sn: Site2
servicemachine updated
done? n
sn: Site3
servicemachine updated
done? y

And our updates are done!

We could roll both of these up into a big script, but I'm lazy.  Seriously lazy.  Copy/paste lazy.

This is an example of duct tape programming.  It's dirty, but quick and effective.

Keep it simple, kids.

0 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Whiskey and Guitars - Sounds Like A Good Holiday Season

Woo for double-content posts!

My roommates Greebo and Diieu (those are their screennames - not about to post their real names) got me a Christmas gift that blew my fucking mind away.

Yamazaki 18 Year Single Malt Whisky.

I wanted to try Suntory whisky - it was the only Whisky I hadn't tried, and it pisses me off.  That's right, it makes me angry.  They got me a bottle of Whisky, and that pisses me off.

I had consistency in my life.  Whisky/Whiskey came from Tennessee, Kentucky, Scotland, Ireland, and Canada.  Nowhere else.  At least, not the good stuff.  But Yamazaki completely changed that.  It's smooth - smoother then anything else I've ever tried before, and it's got an amazing, mature, full flavor palette.  It's damn good.

So now my Whisky/Whiskey list, in order of preference to sip, is as such:

Scotch, Suntory, Bourbon, Tennessee, Canadian, Irish.

You see that breakdown?  Suntory is now preferred over bourbon for sipping.  See how wrong that is?  It's like the softer brother of Scotch.  While I have sincere appreciation for the rough edges of Scotch - as well as the other darker flavors contained therein, Suntory breaks that ideal and goes to the smooth edge.  All the flavor, but with a bit more of a refined feel.

God dammit.

Speaking of gifts, I'm recording as a gift this year, a continuation of last year, where I recorded a 6 song CD for a Christmas present to my family and friends.  I included 3 drum and bass songs, as well as 3 songs with guitar and other instruments.  All of them but one were original compositions.

This year, I'm going it again, but all the songs are going to be full-on guitars, drums, and bass.  I'm not doing electronic music this time around because I want to do the full recording deal.  It's been a challenge so far, but fun.  My track list is coming down to something like this:

1. Delé - New Hard Rock song with delay laced intro.
2. Walk - Solo acoustic piece written for Allison's graduation.
3. Goin' Down - Cover of a cover of a Freddie King song
4. Untitled progressive song here - think Vai-ish with Satriani hanging out, too.
5. Probably a blues/rock song here.
6. Probably a acoustic guitar / electric guitar thing.  Calm outro idea.

If I can muster a 7th song in time, I'm definitely doing it, but that track list seems to be the direction I'm heading.

I've learned a lot since last year.  My rhythms are much stronger, and my melodies are a bit better - though not by much.

My recording sensibilities are a bit stronger this year, as well.  I'm making better use of the stereo soundstage to get a bigger field, and I use doubletracking quite a bit for the first song to get a bit more of a ballsy feel.

I still have a lot of work to do - I just got the drums and bass done for the third track, but overall things are going will.

I hope you're all doing well.  If I don't post before, have a wonderful holiday season!

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Wait, They Were Actually Good?!

Ah, it's been long, friend.  Too long.  Let me spin a tale of my travels...

Or not.

NEW PHONE

Last week I scored a new phone - the LG enV Touch.  This is a step up from my old phone - an LG enV (1st version).  Honestly?  Gigantic upgrade.  My father footed the bill on buying one for me and getting a free one for himself through Verizon's new every 2 program.  Without going into a full-blown review, this thing is awesome.  Seriously.  I have almost no complaints.  It's that good.

BB KING IN CONCERT

I was lucky enough to be able to attend the BB King Concert in town.  Amazing show.  84 years old and he still brings down the house.  He can still sing and play as well as ever.  His interactions with the audience were priceless and humorous, and the music was amazing.  I was also so lucky as to be able to get his signature on my guitar through some connections.  While I did not get to meet him, I got his freaking signature on my guitar.  I'm really excited about it.

BORDERLANDS

Okay, this came out a while ago, but we were using this is hold us over until L4D2 to came out.  It's fun, all though the replayability is questionable.  The loots are where it's at.  Not much else to it.  The difficulty was a little disappointing, however.

MODERN WAREFARE 2

I got my hands on this.  The single player is extremely well done.  While there are a few small feasibility issues contained within, it's overall extremely well done.  The controversial "airport" scene was not as bad as I thought it would be when I saw it in context.  Still terrible, but not as bad.  The ending opens it up for a 3rd game, however.

LEFT 4 DEAD 2

Okay, Valve, I get it.  You really did improve it.  But is it $50 of improvement?  I don't know.  My disappointment with this still holds out on the fact that you never really gave us the DLC you promised for L4D1.  However, I bought it as apart of the 4-pack, so I only payed $35 for it in the end.  With that aside, this is my new favorite Valve game.  Really.

FINIS

I've got dinner ready, but I will hopefully return with more content soon!  I hope, at least.  I'll give a fuller review of L4D2 when I've gotten through the campaign and all the game modes.

Until next time!

1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

This is a phone test!

So I got a new phone. I've been testing it out, and so far, I really like it. It's the LG enV Touch. and it freakin' rocks. This is a test post using the device. Word.

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

The Power Hour

I bought a bunch of PBR to tackle one of my favorite drinking games.

The Power Hour.

For the uninitiated, a Power Hour one shot of beer every minute for an hour.

You can see where the good idea part comes in.

I was searching around for a good clock of some sort to give the 60 second countdowns for each minute, but the Internet failed me.  There were a lot of bad ones out there, so I made my own!

http://gh0stpreacher.com/media/powerhour/launch.html

Click the button, and you'll get a small window that displays a 60 second countdown timer, along with a handy clock to help you see the time.

I might change it later.

Woop!

1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Okay, so we're back from that interruption

Note to self:

Don't turn on VPN when remoting.  DURP.

1 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

More Site Updates

I forgot to mention that I made more updates to the site's CSS.

I made the template WAY too wide.  Impractically so.  I reduced it by a few hundred pixels, which seems to better suit the content.  I might set a maximum width of around 850px and then make it fluid if the viewport is smaller then that.  Maybe.

I also added borders to separate out the right rail from the main content, and posts from each other.  This seems to make things feel a little more organized.

I still have a desire to add more things to the right rail, but I feel like the Twitter feed is enough for now.  One of these days I'll go back through and tag all of my posts and add a tag cloud, as well as links to my personal favorite posts.

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Saturday Night? Yes Please.

Hello, internets.

It is a Saturday.  That means the following things will take place:

- Liquor
- Games
- Liquor
- Food
- Caffeine
- Liquor
- More games
- Liquor

As you can see, I have a terribly busy schedule on my weekends.

Also, Thnikkalodge.

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

CSS Updates

My terrible ability to design is showing once again in the latest design update!

The large majority of modifications are to the site's CSS.  I still haven't had the desire to go through and actually fix up the core stylesheet's poor organization and overall bloatedness.

I also removed a few things.  The calendar in the upper-right is no longer there, as well as the single ad call.  Since I don't really get any traffic, the ad was totally unnecessary.  And the calendar was totally unneeded because I don't post often enough to necessitate it.  Also, it provided a path to a redundant post listing page that was all ready covered by the Blog Archive.

The page is much wider.  I designed it for 1000px width.

I'm not 100% pleased with the new design, but it's much better than the template before.  Hopefully this one is actually readable, which is the biggest complaint I received about the last template.

The color scheme was driven by my desire to not use as little pure white and black as possible.  It's composed of blues and greys, which turned out well, mostly.

More updates will come, but for now, I'm happy.

Until next time.

3 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed