Friday, September 14, 2012

Git Extensions 240 on Ubuntu 12.04

While I do most of my git work from the command line, I occasionally use GitExtensions for viewing the history of commits and for it's visualization of which commits are in which branch. When converting to Ubuntu I was glad to find out that GitExtensions worked on Linux, but it was not as clear on how to set it up. Apparently, the Linux support for GitExtensions is not as good as the Windows support. GitExtensions is written in C# and utilizes mono to be able to run cross-platform.

I spent some time trying to figure out how to get this to run on Ubuntu. There is a youtube video about getting this to work in Ubuntu 11.04 but after following the steps shown, I still could not get it to work.

Here is what I ended up doing. I downloaded the .zip file for Windows and Linux and extracted it into /home/apps. From the terminal, I ran:
$ mono /home/apps/GitExtensions/GitExtensions.exe
which produced the following error:
Unhandled Exception: System.TypeLoadException: Could not load type 'GitUI.FormChooseTranslation' from assembly 'GitUI, Version=2.40.0.0, Culture=neutral, PublicKeyToken=null'.[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'GitUI.FormChooseTranslation' from assembly 'GitUI, Version=2.40.0.0, Culture=neutral, PublicKeyToken=null'.

While searching for a solution for this, I came across a thread in the Google Group for GitExtensions that led me to downloading MonoDevelop. Apparently even though I had the Mono Runtime and the Mono Runtime (Terminal), MonoDevelop is also needed for GitExtensions to work.

Installed mono software
After installing MonoDevelop, GitExtensions opened with no problem at all. I was able to select my language and configure it for first time use.

One more thing that I wanted was an icon on the launcher so I didn't need to keep running this from the terminal. This post helped me out there. From the terminal run:
$ sudo apt-get install --no-install-recommends gnome-panel
and then to create a launcher:
$ gnome-desktop-item-edit ~/Desktop/ --create-new
The icon can be changed to the GitExtensions icon but you have to first change it to an image format such as .jpeg or .gif. Open the .ico file that came with GitExtensions in an image editing program and save it as a .jpeg or .gif. Then in the Create Launcher window, click on the icon in the top left and select the file that you just created. Give the launcher a name and for its command set it to 'mono' and then the path of GitExtensions.exe. Here is mine:

Git Extensions Launcher
This will place the launcher on the desktop. To move this launcher to the Launcher, just drag and drop it onto the Launcher. You will notice that it appears both in the Launcher and on the desktop. To avoid this, move the launcher from the desktop to another folder such as /home, and then from there, drag it to the Launcher.

Thursday, September 13, 2012

Switch to Ubuntu: Remmina Remote Desktop Client

The switch to Ubuntu 12.04 from Windows 7 has been pretty seamless so far and I find that I enjoy using it. I've found several things so far that I like using better than the Windows counterpart; for instance, Remmina Remote Desktop Client over Windows' RDP interface. Remmina came with my version of Ubuntu, but it is also not difficult to install.

With Remmina, you setup a connection once with all of the parameters for that server, and every time you need to connect after that, Remmina will connect and log in with just one click.

Remmina Connection Profile

Remmina one-click connection
A feature of Remmina that makes it better than the similar product in Windows is tabbing the connections when multiple connections are in use at the same time.

Remmina multiple connections
I'm looking forward to learning more about Ubuntu and will post more of what I learn when I get time.

Tuesday, September 11, 2012

Setting up Ubuntu for the first time

Recently we've seen a shift here at work to start using Linux OS's for as much work as we can. I've not been as quick to jump on that bandwagon but decided last Friday to use the Windows installer for Ubuntu and setup my system to dual-boot Windows 7 and Ubuntu 12.04.

With a little help from Google and my co-workers, I've been able to figure out many of the things that I've wanted to use Ubuntu for but still feel like there's so much more. The biggest trouble that I've had so far has been with docking my laptop. Initially there wasn't any problem until I activated additional drivers for my NVIDIA graphics card.

Additional Drivers window - showing the NVIDIA drivers

Not knowing what I was doing, I activated the drivers and expected them to work just fine, but when the laptop was docked nothing would show on the monitors. I have a Dell laptop, docking station, and two 24" monitors and after activating these drivers, the monitors kept saying they were going into standby mode. For whatever reason, the laptop screen didn't have any issues - just when the laptop was docked.

The resolution (no pun intended) to this was to de-activate the drivers and reboot.

Wednesday, June 27, 2012

Erlang syntax highlight for Notepad++ (Obsidian style)

Notepad++ does not come out of the box with a syntax highlighter for Erlang, but it does come with the support for creating a User Defined Language. Here is a syntax highlighter that I found to be almost what I needed. I use the Obsidian style and so I needed to make a couple of changes.

Here is my syntax highlighter for Erlang using the Obsidian style. Import it into Notepad++ by going to View > User Defined Dialogue and clicking on Import.

Monday, March 26, 2012

git: Rename the Directory Containing a Repository

When we thought about doing this it seemed like it was going to be a big deal but it turned out to be pretty simple. The following steps accomplished what was necessary:

1. Modify gitosis.conf to add the new directory

[group foo]
writable = foo
members = @developers

[group foo_readonly]
readonly = foo
members = @designers @developers

[group bar]
writable = bar
members = @developers

[group bar_readonly]
readonly = bar
members = @designers @developers

2. mv oldDir newDir

On origin, run the bash 'mv' command
mv foo bar

3. Work with new code

On my development machine, run git clone on the new directory and start working with the files. In our case we were using the old directory name for a new project. Running git pull from my development machine created an empty git repository on origin with the old directory name.

Tuesday, March 20, 2012

Matcher maker Matcher maker .... make me a Matcher

Ran into a problem at work today that we as a pair were close to giving up on before we finally came across the solution. We had an existing test that was ensuring that our mocked method was called with a pointer argument.

Here is that test:
using ::testing::Return;

TEST(MessageDataTests, SendResponseIsCalledWithMap)
{
    CString messageId = "TestMessageId";
    TXMLDataMap* xmlDataMap = new TXMLDataMap();
    (*xmlDataMap)["MsgId"] = messageId;

    MockTranslator *translator = new MockTranslator();
    EXPECT_CALL(*translator, SendResponse(xmlDataMap))
        .WillOnce(Return());
    translator->GetMessageData(xmlDataMap);
}

As you can see, this test is just ensuring that when SendResponse is called, it is called with the pointer xmlDataMap. We needed to add an expectation on part of what xmlDataMap was pointing too. Google Mock can accomplish this with Pointee(m) where m is a Matcher. Our pointer is not a simple type so we had to create our own matcher to check to see if our map contained the item we were adding inside of GetMessageData.

Here is what the final code looked like:
using ::testing::Return;
using ::testing::Pointee;
using ::testing::AllOf;

MATCHER_P(MapContainsValue, valueToCheck, "")
{
    return (arg.find(valueToCheck) != arg.end());
}

TEST(MessageDataTests, MapContainsDataWhenSendResponseIsCalled)
{
    CString messageId = "TestMessageId";
    TXMLDataMap* xmlDataMap = new TXMLDataMap();
    (*xmlDataMap)["MsgId"] = messageId;

    MockTranslator *translator = new MockTranslator();
    EXPECT_CALL(*translator, SendResponse(
        Pointee(AllOf(MapContainsValue("MsgId"),
                      MapContainsValue("Data")))))
        .WillOnce(Return());
    translator->GetMessageData(xmlDataMap);
}

Friday, October 7, 2011

Auto-deploy feature file

Feature file for our auto-deploy:

@Install
Scenario: Install and Configure Virtual Hold on a remote machine
  Given I stop the Virtual Hold services
  And I uninstall if already installed
  And I install the media on a remote machine
  And I configure the media on a remote machine
  And I can log into EyeQueue
  And I start the Virtual Hold services
  Then Virtual Hold is running properly

When the file references Virtual Hold it is talking about the collection of windows and web services that are needed to make our software work. EyeQueue is the web application that is used to make configuration changes for the Virtual Hold software.

Monday, September 26, 2011

Automation: Auto-deploy

One of the biggest time savers that has been implemented recently at our company has been something that we call an auto-deploy. Our software consists of windows services, web services, web applications, and databases; installing and configuring a system to test against can take quite a while when doing the entire process manually. A handful of individuals here have been working to improve this process by creating an auto-deploy process that will automate the following:
  • Uninstall the software if previously installed
  • Copy the latest build of the software to the server
  • Install the software
  • Configure the databases
  • Start the software
  • Check the software status to ensure that it is running
This used to take easily 30 minutes and sometimes several hours. The problems before mostly revolved around finding the right configuration for the server and setting up the configuration in the database through a combination of wizard screens in our windows app and different pages of our web application. (Just to explain a little about the configuration, our software is capable of talking to multiple types of telephone switches and only certain servers in our lab are configured to talk to certain switches in the lab. Because not any server can talk to any switch, the difficulty was figuring out where the configuration for Server A's connection to Switch B is and then deciphering the excel document that the lab tech's use to keep track of the configured numbers on the switch.)

Now, within ten minutes I can have a system installed with the latest version and fully configured for testing. It takes about 20 minutes to setup an auto-deploy for a server for the first time, and usually within the first two or three times it is run, all of the kinks have been worked out for that environment.


The configuration for the server is now contained within a .yml file that is read in by ruby code which is called from a scenario in a cucumber feature file. A Jenkins job is setup for each server configuration, and this job runs the installation feature. Because it is in Jenkins, it is available to put on our reader board that shows each of our projects' build status.

Our team has already seen the benefit of this. There was a bug introduced in the code that caused the services not to start. Because we have this as part of our CI, we were able to know that a problem was introduced within an hour. Without CI and the auto-deploy, this could have taken days until another build was completed.

Friday, August 26, 2011

Making Daily Standups .... Interesting: Days 12-15

I got a little behind in posting these. The contest is now over, but for your viewing pleasure:

Darth Vader

Green Cowgirl (with lights)

Tiara

Pink Cowgirl (with lights)



Friday, August 19, 2011

Making Daily Standups .... Interesting: Day 11

Here's a viking quote to go along with today's hat:
Never walk away from home ahead of your axe and sword. You can't feel a battle in your bones or foresee a fight.
- The Havamal

Viking helmet





Thursday, August 18, 2011

Making Daily Standups .... Interesting: Day 10

Maiwaige. Maiwaige is what bwings us togewer today.

Some help with the veil
 
Mickey (Minnie?) Mouse wedding veil




Wednesday, August 17, 2011

Making Daily Standups .... Interesting: Day 9

Not really sure what kind of hat this is, but definitely another good entry.
Fuzzy Purple 'Lamp Shade'

Tuesday, August 16, 2011

Making Daily Standups .... Interesting: Day 8

We had retrospective yesterday so no standup. If you look at the wall, you can get a sneak peek at a couple of the hats coming up.















Friday, August 12, 2011

Making Daily Standups .... Interesting: Day 7

It looks like someone was getting desperate for a hat entry.

Potted plant
No - he didn't wear this on his head for the entire standup.




Thursday, August 11, 2011

Making Daily Standups .... Interesting: Day 6

A Viking hat with Germany's national colors is today's entry into the standup hat contest.
Viking
It is kinda hard to take him seriously with these ridiculous looking hats, but it does make it more interesting.

Standups have become better recently, but I still think that there could be more improvement that would make standup meaningful for those involved.






Wednesday, August 10, 2011

Making Daily Standups .... Interesting: Day 5

Our illustrious scrum master was out yesterday but returned today to sport this hat

Jesters Hat, with bells



Monday, August 8, 2011

Making Daily Standups .... Interesting: Day 4

Today's hat was not a bad look for him. I could see him wearing this away from work.
Propeller Hat




Friday, August 5, 2011

Making Daily Standups .... Interesting: Day 3

Another good entry in the hat contest:



This is something I could see him wearing away form work.

Thursday, August 4, 2011

Making Daily Standups .... Interesting: Day 2

Day 2 of the hat contest sees a milder, less 'anxious' headgear piece.

 Rajastan hat (Indian)
Apparently, this is some form of tribal headgear from the Indian state of Rajasthan.

Making Daily Standups .... Interesting: Day 1

UPDATE: added additional photo

Our new Scrum Master has promised to wear any headgear that we bring in for the daily standup. Here is the first hat that he had to wear:

Raggedy Ann - complete with bangs and pigtails

He has promised to do this for a couple of weeks, two sprints I believe, and the reward is a gift certificate for a local restaurant. It should be interesting as the weeks go on to see what members of the team can come up with for him to wear.