Archive

Archive for the ‘Workplace’ Category

Creating Local Git Repositories – Yeah, it’s that simple!

We’re in the process of evaluating several source control systems here at the office.  It’s a JOYOUS experience and I mean that… sorta.  Currently, we have a montage of files dumped into two SourceSafe repos.

At this point, most of you are either laughing, crying, or have closed your web browser so you don’t get caught reading something with the word ‘SourceSafe’ in it.  That’s cool, I get that.

As part of my demonstrations (for the various toolings we’re looking at), I wanted to show how simple it was to create a local GIT repository.

Since I’m discussing ‘local’, I’m taking a lot of things out of the picture.

  • Authentication/authorization is handled by Windows file permissions/Active Directory.  If you can touch the repo and read it, then knock yourself out.
  • Everything is handled through shares, no HTTP or that goodness.  Users are used to hitting a mapped drive for SourceSafe repos, we’re just emulating that.

So what do we need to do to create a Git repository? Three easy steps (commands).

1. Create your directory with the .git extention.

mkdir example.git

2. Change into that new directory.

cd example.git

3. Initialize the repository using Git.

git init —bare

Our new Git repository is now initialized. You can even see that PowerShell picks up on the new repository and has changed my prompt accordingly.

Local Git Repository - example.git

Now that we have example.git as our ‘remote’ repository, we’re ready to make a local clone.

git clone H:\example.git example

Now we have an empty clone (and it’s kind enough to tell us).

Empty clone.

All of our Git goodness is packed into the standard .git directory.

Git clone contents.

To test things out, let’s create a quick file, add it to our repo, and then commit it in.

First, let’s create/append an example file in our clone.

Create/append an example file to Git

(note: this is called ‘so lazy, I don’t even want to open NotePad’)

Now, we can add and verify that our newly added ‘example.text’ file shows up:

Git - add file and verify

Finally, commit…

git commit -a -m “this is our first commit”

First commit

… and push!

git push origin master

Push to origin repo.

The last step is to ensure that our new ‘remote’ repository can be reproduced.  Here’s a quick single line to clone our repository into another new folder, list out the contents, and verify the log has the commit we made in the first repo.

Finished Second Clone to Verify

It’s amazing how quick and easy it is to setup local Git repositories.  From here, we can look at the file system/Windows for authentication/authorization and focus on our migration AWAY from Visual SourceSafe. :)

Tags: ,

PowerShell : TGIF Reminder

November 6, 2009 David Longnecker 1 comment

Jeff Hicks’ TGIF post yesterday was a fun way to learn a bit of PowerShell (casting, working with dates, etc) and also add something valuable to your professional toolbelt—knowing when to go home. :)

I tweaked the date output a bit to be more human readable, but also moved it from just a function to part of my UI.  I mean, I should ALWAYS know how close I am to quittin’ time, right? Especially as we joke around our office during our ‘payless weeks’.

# Determines if today is the end of friday! (fun function)
function get-tgif {
 $now=Get-Date
 # If it’s Saturday or Sunday then Stop! It’s the weekend!
 if ([int]$now.DayOfWeek -eq 6 -or [int]$now.DayOfWeek -eq 7)
 {
  ”Weekend!”
 }
 else {
  # Determine when the next quittin’ time is…
  [datetime]$TGIF=”{0:MM/dd/yyyy} 4:30:00 PM” -f `
   (($now.AddDays( 5 – [int]$now.DayOfWeek)) )
  
  # Must be Friday, but after quittin’ time, GO HOME!
  if ((get-date) -ge $TGIF) {
   ”TGIF has started without you!”
  }
  else {
   # Awww, still at work–how long until
   # it’s time to go to the pub?
   $diff = $($tgif – (get-date))
   ”TGIF: $($diff.Days)d $($diff.Hours)h $($diff.Minutes)m”
  }
 }
}

NOTE: My “end time” is set to 4:30PM, not 5:00PM—since that’s when I escape.  Change as necessary. ;)

The code comments explain most of it.  As you can see, I added in one more check—let me know when it’s simply the weekend.  I also removed the Write-Host calls, since I simply want to return a String from the function.  I could use the function, as necessary, with formatting, and add it to other scripts and such.  For example:

Write-Host $(get-tgif) -fore red

The next step was tapping into the $Host variable.  Since I use Console2, my PowerShell window is a tab rather than the whole window.  Console2 is aware of PowerShell’s $Host.UI methods and adheres to the changes.

To add get-tgif to my prompt’s window title:

$windowTitle = “(” + $(get-tgif) + “) “
$host.ui.rawui.WindowTitle = $windowTitle

Easy enough.  Now my window title looks like (ignore the path in there for now):

TGIF countdown in WindowTitle

But that only sets it when you log in… and I want to update it (and keep that path updated as I traverse through directories).  To do that add a function called ‘prompt’ to your PowerShell Profile.  Prompt is processed every time the “PS>” is generated and allows you a great deal of customization.  See the post here for further details on how I’ve customized my prompt to handle Git repositories.

So, move those two lines into our prompt function, and our TGIF timer now updates every time our prompt changes… keeping it pretty close to real time as you work.

function prompt {
 $windowTitle = “(” + $(get-tgif) + “) ” + $(get-location).ToString()
 $host.ui.rawui.WindowTitle = $windowTitle

[…]

}

This could be tweaked to any type of countdown.  I’m sure a few of those around the office would have fun adding retirement countdowns, etc. ;)

Happy TGIF!

Who’s Who Not Knowing Who?

May 7, 2009 David Longnecker Comments off

Years ago, back when I had a couple consulting businesses and such running, there was a bit of value in some of the “Who’s Who” books and such for social networking.   A lot of the current networking appliances (blogs, Twitter, Facebook, user groups, etc) weren’t around and the “big books” were common—if you could weed out the scams.

I actually had an invite to the “2010 Edition of Who’s Who Among Executives and Professionals Throughout the World” today… but they don’t know who I am… or simply fail at mail merge.

[…clip…]

Greetings [Firstname] [Lastname],   

In recognizing your work in the field of [field], it is my honor and privilege to inform you of your selection as a representative in the 2010 Edition of Who’s Who Among Executives and Professionals Throughout the World. Our membership committee has scoured professional journals, industry newsletters, and corporate resources to compile our summary of individuals who fit the bill: professionals who represent the best and brightest in their industries. You are one of those selected.

[…clip…]

So.. seriously, does anyone have those books sitting around anymore?  If so, why?  A book containing all of the executives and professions throughout the world would require more than my package-hiding UPS man to deliver.

I don’t even own a telephone book—letalone a reference book of complete strangers (though, that’s somewhat one in the same).

Communicating Process Improvement Benefits

October 7, 2008 David Longnecker Comments off

Paper and PencilA large part of my job is process improvement—working with various departments and groups in our organization (K-12 education) to see where technology would provide cost savings and “better ways” of doing things.  I really do enjoy it and like to see people empowered with tools to do their job better.

We’re slowly running into a culture clash—those who are holding on desparately to the paper and those who are forcing change.  Unfortunately, those “forcing change” don’t want to force it—they want our department (or anyone else) to be the “bad guys.” 

That’s cool—I can be the bad guy.

Unfortunately, it’s difficult to sell to the individuals a different process when those at the highest levels (their bosses) can’t sell it.

Here’s an example we’re running into:

For years, thousands of staff members have used paper and pencil bubble sheets to do grading.  Paper, handwritten grade cards went home to students (NCR paper copies each grading cycle).  These copies were lost, destroyed, and unreadable by the end of the year.  In addition, the paper, labels, and copies cost into the tens of thousands per year.  It wasn’t a good situation (considering it’s 2008) for parents or teachers.

A new, online grading system was requested by leadership; throughout it’s development both the customer and the focus group of the customer’s customers (those thousands of staff members) tested, worked hand-in-hand, and approved the application, it’s layout, and performance metrics.

However, after rolling it out, the complains came rolling in.  Filling a report out takes more time than “ticking off bubbles on paper” per student.  Latency in the network, across VPN for home users, and simply using the application puts it at about 35 seconds per student (1–2 seconds to load, 30 seconds for the teacher to mark their grades using the drop downs, 2–3 seconds to save and return validation).  The server side runs well—the app runs fast, but we can’t push it down the wire any faster.  There’s latency in there that developers can’t attack—especially in web applications.

When we try to reason and explain the technology, we’re countered with “well, in 2–3 seconds, I can put 5–10 check marks on a piece of paper—that’s just wasting my time.”  And of the postive benefits of the system?  So far, they’re not to be seen—those pushing for it can’t (or won’t) stand up for it. 

At this point, should it be the developers to advocate the application if the customers (the end users are the customers of our customer) don’t want to deal with the “pressure” of implementing change?

If the qualifiers for the process improvement are met, but adoption wavers because of lack of support—who’s call is that?

Just curious what everyone out there thinks.  At this point, I’m in coaching mode with our customers to work with them on how to sell change and get buy in from their customers…

 

Categories: Education, Workplace

Not dead… yet.

September 5, 2008 David Longnecker 3 comments

Had a couple emails asking if I died, so rather than waiting and providing a fun response from the grave, I figured that I’d post. :)

Work has been non-existant; I’ve mostly been grinding through learning NDepend and playing with the latest MVC Preview 5 bits.  Good times, but nothing fun to report there.

Everything else and my soul has been wrapped up in working on the house and the yard.  Gustav has saved me a bit—the rains have prevented too much tedious yard work, but plenty to do inside.  I need to keep my parents at bay though—every time they visit, I end up repairing holes in the wall when they leave. :(

Hopefully more excitement in coming weeks.

Tags:
Categories: Everything Else, Workplace

A lull…

July 24, 2008 David Longnecker Comments off

As projects wind down, it’s been quite the administrative lull lately.  Projects are done and rolling out the door; paperwork is ramped up and covering my desk. :(   Hopefully, over the next few weeks, some new fun and excitement will jump in the door—including a new project involving mobile devices (yay!).

If not, maybe it’ll give me time to get back into experiment mode and kick around the new ASP.NET MVC Preview 4 and ASP.NET AJAX 4.0 Preview.  I haven’t had nearly enough time to dink at home—all this newfound housework takes a LOT of time and energy. Heh.

Search Commands for Office 2007 – GREAT!

May 5, 2008 David Longnecker Comments off

I’ve been using Office 2007 for, well, almost forever.  Compared to the prior versions of Office, it’s better than expected—and quite a dynamic change.  By that, I mean the ribbon toolbar. 

I understand Microsoft’s UI “goodness” and some of the ribbon logic—especially on smaller applications, but the ribbon is still painful to use in huge rambling applications like Microsoft Word and Excel.  I still, after all this time, spend time going, “where the heck is {command}?”

Most of the time, I fall back to using old Office commands that, thankfully, still work.  Other times, it’s an adventure!

That adventurous spirit, however, isn’t shared by every user of Office 2007.  The learning curve of the ribbon and other Office 2007 features has been the leading reason why the latest application suite is still frowned upon in our organization.  Face it—the UI for Word looked the same from about Word 6.0 to 2003.  In one version, that’s a lot of users to reeducate.

To ease those users along and empower the “power” users of Office products, the Office Labs team has released a sweet plugin for Microsoft Office 2007–-Search Commands.  Search Commands is exactly what it says, rather than wading through the half-dozen menus, you enter what you want to do in the search box and the ribbon automagically builds for you.

I’ve been using it for a week or so now, since it came out on 23 April, and love it.  Once you get the Search Commands hot keys down (Alt-Y, E and Alt-Y, 1–9) you can wiz through commands.

Gmail – Odd Filtering Request…

March 27, 2008 David Longnecker Comments off

I love Gmail—in my Archives, I still have my “Welcome!” email (because, I wanted to “save it all” since I had unlimited space) dated back to August ‘04 and I haven’t looked back since. 

It’s fast, has a great interface, and has become recognized and supported by dozens of vendors.  It’s also available EVERYWHERE—home, work, on the road, my cell phone, wireless devices, just everywhere.  I don’t have to worry about syncronizing and it connects to GoogleDocs, Calendar, and the other services extremely well.  If I could find a good way (without a client) to sync my cell phone to Google Calendar, I’d happily kick Exchange to the curb (for personal stuff).

I’m on several mailing lists too… various ones for both work and personal such as altdotnet.  As these groups have grown and conversation sometimes staggers, Gmail has been my saving grace by automagically keeping the hierarchy in a single “thread” to make the conversations easy to follow.

Unfortunately, Gmail can’t “autoforward” to folders—because there are no folders.  Labels and filters are great, but if I go a few hours without reading my email (you laugh… but seriously), I find I have 200+ in my box and can’t see the “real” mail from the list servers.

If I was using Outlook, I’d autoforward emails to a folder and be happy.

So, to get around this with Gmail, I tried something and over the next few days, I’ll see how it works.

  1. Setup a new filter that matches a common criterium of all the emails on a particular list, e.g. all altdotnet emails come from altdotnet@yahoogroups.com.
  2. Next, select “Apply the label” and create a new label for the group AND select “Skip the inbox”. 
  3. Save/Update the filter and, optionally, apply it to the discovered conversations (recommended to be sure you don’t have strays).

Gmail Labels

This applies a label, which is clickable from the Labels section on the left AND gets them out of the inbox, leaving it tidy.  You can see below, at a quick glance, that I have 41 unread “threads” in altdotnet and no outstanding jotts (I <3 Jott).

You also can create hyperlinks DIRECTLY to the individual labels (if you wanted to add them to your favorites, etc) by adding #label/{label name} to the end of your google mail URL. Here’s an example:

http://mail.google.com/#label/altdotnet

Since I use the Google Homepage and Gmail web part, I have a little list of links as well and have added this in there for “quick access” to that label.

Give it a try for a few days and see how it works—hopefully it’ll help tame my information overloaded inbox.

Pipe.Capacity == false || Pipe.ConnectionsTo(‘NetFlix’) > this

February 26, 2008 David Longnecker Comments off

<rant>

A need came up today to test how Windows Server 2008 and some of our web apps handled.  Republishing apps is pretty easy given their portability with the Deployment Packages, but simply getting the server going was a pain.  Hardware shortage?  Nah.  Lack of a pipe—heck yeah.

The Pacific through a Straw

I wonder if I can claim any sort of overtime for 352 hours…

We’ve been having huge internet bandwidth issues lately at work—our 100 MB pipe feels like the Pacific Ocean through a straw.  I can usually deal with slow internet browsing (since most sites and services are blocked anyway), but when i need an ISO from Microsoft’s MSDN library, I usually need it right awayish.  *sigh*

The fix?

Last time, the following resolved the problem: remoting into my home computer, starting the download, waiting 5 minutes while it downloaded at 2.8–3.2MB/sec, calling home and asking REALLY nicely for someone to put a DVD in the drive, setting it to burn, driving home (1+ hour), getting DVD, eating lunch, driving back (1+ hour).

Unfortunately, it’s a bit late in the day now—I’ll just do my testing tomorrow.

And that’s acceptable as a “way of doing business.” :(   It could drive a person crazy.  Honestly, while the field trip opportunity is nice, I’d rather things just worked here.

</rant>

 

Snow Day…

January 31, 2008 David Longnecker Comments off

Working in education, there are advantages—one of those being snow days.  Unfortunately, on the days that the 1 ton buses can’t make it through the snow, they feel that our little cars and trucks can and should.

wtf.  :(

Here’s the view outside my office—as of about 8:00am.  We haven’t had as much in town as where I live east (my hour commute was near two today), but it’s still coming down.

Snow

Seriously, I’m ready for global warming.

Categories: Everything Else, Workplace