Archive for the ‘Technical Jargon’ Category

Me vs. Linux – Round 2

Monday, June 2nd, 2008

Ok, I’m back, and the penguin and I are going head to head again.

I still want to make the change over to Linux full time, but I just keep reverting to Windows due to the familiarity.  But not anymore.  I’ve instituted a “no windows in my house” rule.  So, while my machine is still dual boot, I refuse to go back into vista business.

So, I’m adjusting.  I wiped my linux partition and did a fresh install of Hardy Heron.  No complaints there.  I’ve gotten Zend Studio for Eclipse installed, so my PHP coding questions are covered…  Thunderbird takes care of my imap mail accounts and Firefox for my web broswing needs…  Then there’s Pidgin for IM.

So, again, the only thing I’m missing so far is NaviCat for remote mySQL connections (via http tunneling, wicked handy), but I might just have to suck it up and purchase a license for Linux.  I’ve tried installing via Wine, but the http tunneling feature doesn’t work, probably because it relies heavily on the windows network layer for communication.  I’ll have to research that some more.  So, so far, so good.

As always, I’ll keep you posted.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

How I Cope with (all this) Vista Business: Services

Monday, March 17th, 2008

I’ve already written about my Ubuntu install, although it’s a little outdated, so I figured I might as well discuss what is my *cringe* main OS. I’ve done a bunch of tweaks, found things here or there, and have actually ended up making Vista (somewhat) live-able. I have enough information that this will most likely end up being a #-part series.

As I said in my Ubuntu post, I purchased a Dell XPS M1710 with a Core 2 Duo T2700 2GHz, 2gigs of RAM and a 150gb 7200 RPM SATA harddrive. It ain’t nothin to sneeze at, but I was disappointed at it’s performance running Vista Business (well, more than I expected to be). And don’t bother asking me why I didn’t revert to XP, I’m just going to play the “early adopter” card there.

Today’s Focus: Turn EVERYTHING off

Ok, while I don’t necessarily mean everything, here’s a bunch of stuff to turn off. Here’s things, in order of importance (or so I think):

1. Windows Sidebar
Turn Off Windows SidebarAn analog clock? Rotating pictures from My Photos? No thanks. When I’m trying to get s#!t done, I don’t need to see windows default pics scrolling by. I shut that bad boy off as soon as I first booted into the OS. This is done by right-clicking the icon in the tray, going to properties, and turning off “Start Sidebar when Windows Starts”. You just saved yourself approximately 25 to 30mbs of ram right there, about the amount it takes to run Outlook in your task tray.

2. Windows Search
Disable Windows Search I don’t know about you (yeah, you, I’m talking to you) but I’m a rather organized guy when it comes to my computer. I formatted and partitioned my drive when I took the machine out of the box. The C drive is installed programs only (except for the desktop folder, obviously) and the D drive is my storage. I know where things are and I never open search and just blankly search my entire system for something. When I got this beastly laptop, I noticed it would just sit there with the hard drive spinning and spinning, and thought “well, that ain’t right…” Turns out it was the Windows Search indexing my life for me. Well, we can’t have that, it’s actually turning out to make me less productive.

To turn off this hindrance, go to start > run and type “services.msc” (without the quotes) and hit enter. Scroll down to the bottom and you should see Windows Search. Right-click it and hit Properties. Change the Startup Type to Disabled and click OK.

3. Aero Glass
Shut Off Aero I like the new look of Vista. It’s not a bad thing, but the transparency is a resource whore for my tastes. Shut it off and see how much of a difference it really makes. But, like i said, I like the new window look and the explorer nav bar, and the Windows menu (more on these later), but you can also go retro to Windows Classic and save even more.
Right click on your desktop, go to Personalize. Click “Window Color and Appearance” (should be the first option in the list you see.

Stay tuned, kids, upcoming topics include User Access Control, shortcuts, helpful tools, registry cleaners.

JOY!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Intro to Grep for M$ People

Sunday, February 10th, 2008

In my “free time” I’ve been idly trying to become proficient at the *nix command line. As told by my previous “converting to Linux” article, I’m trying to make the shift over to Ubuntu full-time, but for a Microsoft-head such as myself, the move isn’t exactly instantaneous.

So, in an attempt to log my efforts, I’m going to start posting little pieces of information that learn/figure out. Today we start with a light lesson in grep.

Side-note(s)
While I am trying to make the switch over to Linux, I find it unfair to my clients to be uncomfortable on my laptop while working billable hours. So this particular lesson will consist of Linux commands, but are run via Cygwin under windows. For those who don’t know, Cygwin is an implementation of the Linux command line and tools that run under windows. Read more about it on the Cygwin website or at the wiki.

My example is at the bash command line. If you’re using a different command line, the methodology may change, I don’t really know (insert lack of Linux knowledge here).

Also, grep is an unbelievably powerful tool. Books upon books have been written on it. This is in no way the only use of grep, nor is it a comprehensive account of using grep in this scenario. I’m just laying the groundwork. The internets (sometimes called blagosphere, tubes, whatever you may like) are a wonderful place, do some more research…

Scenario
I’m working on a website where we had to find all files containing the word “Leads” and change it to “Prospects” (clients… they ask for such weird stuff…). In the project directory, there are a bunch of common website files (php, html, css, js, etc…). But this particular project folder is also maintained by Subversion version control. On windows, that means there is a hidden .svn folder in every directory to maintain the changes to that file. This will make sense in a minute.

Technique – Step 1 – Grep
The manual page for grep says to do a simple search through files is something like this:

grep -R "search value" ./

translation: find every file within my directory and its subdirectories containing this search value.

Technique – Step 2 – | [pipe]
There is a rather handy thing called “piping.” It allows you to run more than one command at once, but also run each subsequent command on the previous commands output. Semi-unrelated example:

ls -la | grep .txt

ls -la will give you a directory listing. What this statement then does is say “ok, with the output of the directory listing, give me only lines containing .txt” giving you a list of all text files in a directory.

ls -la | grep .txt | wc -l

this does the same thing, but wc -l (that is a lowercase L) means “word count, lines only” showing you how many text files you have in your directory.

Back to the task at hand: find all files containing the word Leads.

grep -R "Leads" ./

Output:

$ grep -R "Leads" ./
././.svn/text-base/Popup.php.svn-base:    case 'Leads':
./.svn/text-base/Popup.php.svn-base:            require_once("modules/$currentModule/Leads.php");
./.svn/text-base/Popup.php.svn-base:            $focus = new Leads();
./.svn/text-base/README.txt.svn-base:12. 131  - Sorting Name in Leads
./.svn/text-base/README.txt.svn-base:49. 1161406: Assigned ToUser in Leads can be Assigned to User
./.svn/text-base/README.txt.svn-base:16. FORUM:1276 - Converting Leads and assigning to user
./.svn/text-base/README.txt.svn-base:20. FORUM:1559 - Tasks not working in Leads
./.svn/text-base/README.txt.svn-base:31. SF1095038 - Import Leads - No Mapping Fields
.... more of the same ....

That seems pretty useless because this is all information contained in the .svn files. Eventually, the appropriate info will be contained in there, but make the machine do the work. We want all files containing “Leads” that aren’t in a .svn directory. The -v flag is your friend… It means “find things that don’t contain this.” Code:

grep -R "Leads" ./ | grep -v ".svn"

Output

$ grep -R "Leads" ./ | grep -v "svn"
./include/js/general.js:           if(record_id != '' && module[0] == "Leads")
./include/js/general.js:           if(task_recordid != '' && task_module[0] == "Leads" )
./include/language/en_us.lang.php:'LNK_IMPORT_LEADS' => 'Import Leads',
./include/language/en_us.lang.php:'SINGLE_Leads' => 'Lead',
./include/language/en_us.lang.php:'COMBO_LEADS' => 'Leads',
./include/language/en_us.lang.php:'Leads' => 'Prospects',
... more of the same ...

See the en_us files there? That’s all I’m worried about, so I can do another pipe to only view those files:

grep -R "Leads" ./ | grep -v ".svn" | grep "en_us"

Output

$ grep -R "Leads" ./ | grep -v "svn" | grep "en_us"
./modules/Emails/language/en_us.lang.php:'LBL_LEAD_TITLE'=>'Leads',
./modules/HelpDesk/language/en_us.lang.php:'Leads'=>'Lead',
./modules/Home/language/en_us.lang.php:'LBL_LEADS_BY_SOURCE'=>'Leads By Source',
./modules/Home/language/en_us.lang.php:'LBL_LEADS_BY_STATUS'=>'Leads By Status',
./modules/Leads/language/en_us.lang.php:'LBL_IMPORT_LEADS'=>'Import Leads'

My task is complete. I’ve gotten all the translation files that contain the word Leads, and I can either manually edit them, or use the command line to edit them, but that’s another lesson.

Optional Step 3 – >>

I want to make a checklist that I can print and have on my desk while i’m working with these files. There’s a simple way to do this:

grep -R "Leads" ./ | grep -v "svn" | grep "en_us" > /path/to/file.txt

This will take all the output and drop it in the file I specified. If you use one >, it will create the file if it doesn’t exist, and if it does exist, replace all content in that file with the output from our grep. If you use two >>, it will create if it doesn’t exist and it will append the text if it does exist.

I know it’s a sloppy example, but that’s how I achieved my goal, and it was MUCH faster than finding all the translation files in the application and doing it by hand.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

sproif.com is Digg proof thanks to caching by WP Super Cache!