Jenkins Snippets

Wipe out workspaces for all projects:
Thanks to Stefan Bäumler at https://wiki.jenkins-ci.org/display/JENKINS/Wipe+out+workspaces+of+all+jobs, I made a copy right here.

import hudson.model.*
// For each project
for(item in Hudson.instance.items) {
  // check that job is not building
  if(!item.isBuilding()) {
    println("Wiping out workspace of job "+item.name)
    item.doDoWipeOutWorkspace()
  }
  else {
    println("Skipping job "+item.name+", currently building")
  }
}

Delete all builds for all projects:
We tweak the script above to delete all builds.

import hudson.model.*
// For each project
for(item in Hudson.instance.items) {
  // check that job is not building
  if(!item.isBuilding()) {
    println("Wiping out builds of job "+item.name)
      item.builds.each { it.delete() }
  }
  else {
    println("Skipping job "+item.name+", currently building")
  }
}
Download PDF
Posted in Jenkins, Snippets | Leave a comment

Jira Snippets

Let’s face it, when there are cool new tools to lean such as RoR and ASP .NET MVC 4, Grails, why throw away time you could spending learning these to becoming experts at Jira? We just want the answers so we can do what we need here, keep our project managers happy, and move on.

Here are some snippets for finding issues. After all, managing your issues is most important.

Find all issues created by you:

reporter = currentUser()

Find all non closed issues assigned to you and for a particular project:

(status != Closed ) AND assignee = currentUser() AND component = YourProjectName

Download PDF
Posted in Uncategorized | Leave a comment

A Tiny Linux Virtual Machine

More or less, this is a note to myself, but for anyone stopping by, this is definitely worth looking at:

http://mikelev.in/2011/08/virtual-machine-runs-anywhere/

Looks like a decent blog also.

Download PDF
Posted in Uncategorized | Leave a comment

Open Source Collection Libraries For .NET

In the Linked In .NET Developers group, someone posted a question asking about a good open source tree structure in C#. I suppose if you use a library it does shouldn’t matter what .NET language you use. I got to thinking about how little I new of various collection type libraries for .NET. I am think along the lines of stuff like Boost and STL for C++. Well, maybe not that big. Here is a couple that I got from the discussion.

C5 Generic Collection Library
MIT-style open license

data-structures-csharp
License Unknown…

Download PDF
Posted in Uncategorized | Leave a comment

Guid To Windows Clipboard Using Cygwin

Guid Generation
This will give you a guid to your Windows clipboard using Cygwin.

uuidgen | awk '{print "{" toupper($0) "}" }' | putclip

If you don’t like the newline that gets added, you can do this:

uuidgen | awk '{print "{" toupper($0) "}" }' | tr -d '\n' | putclip

Now, for Bash on Linux, maybe you can substitute xclip for putclip to get it into your X Windows clipboard. There may be some additional arguments for that also.

Change To Directory in Clipboard
This handy alias to stuff in your ~/.bashrc file allows you to change to directory in Windows clipboard. Copy path using ^C in Windows Explorer and then issue this command to switch to it at the Cygwin bash prompt.

alias cdw='cd "$(cygpath "$(getclip)")"'

Download PDF
Posted in Bash, Cygwin, Snippets | Tagged , | Leave a comment

Cannot Open MS Office Application From SkyDrive

Sometimes when I would open my Excel spreadsheet up on SkyDrive, I’d get a message saying that the document was open by another user and that I could only open it read-only, save as another copy, or cancel, or whatever, even when I did not have the document open at all. This would be really annoying. Sometimes I would reboot my box and the problem would be fixed. But now, try this:

1) From Task Manager, find this process: msosync.exe.
2) Right click and select End Task
3) Problem solved 🙂 – well hopefully, worked for me last time.

Download PDF
Posted in Uncategorized | 1 Comment

How To Install Subversion 1.7 on CentOS 6.3

I have done this and forgotten, done this and forgotten, too many times.

1) Import the Dag Wieers key:
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

2) Install the rpmforge repo:
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

3) Install Subversion:
yum install --enablerepo=rpmforge,rpmforge-extras subversion

This just gets you the Subversion 1.7 client and svnserve server.

Download PDF
Posted in Uncategorized | 3 Comments

Oracle VirtualBox Snippets

Enumerate Guest Properties
VBoxManage guestproperty enumerate Youre_VM_Name_Here

Get IP (ipV4) Address Of Guest
VBoxManage guestproperty get Youre_VM_Name_Here /VirtualBox/GuestInfo/Net/0/V4/IP

Run Bash Command Inside Linux Guest
VBoxManage --nologo guestcontrol Youre_VM_Name_Here execute --image "/sbin/ifconfig" --username guestUser --password guestUserPassword --wait-exit --wait-stdout -- -a

NOTE: The above runs ifconfig

Download PDF
Posted in Snippets, VirtualBox | Tagged , | Leave a comment

Free Me From Maven! – And I Need A Simple Open Source Artifact Repository!

This is a Level533 Living post, hopefully we all can continue to learn things. Maybe I’ll change my mind about things. Simply put, Maven for .NET builds ain’t good. I know, I’ave heard of the NPanday thing, but I’ve got an MS Build / Jenksins Build that uses MSBuild to build .NET projects. Then I use Ivy and Ant to publish build artifacts to a local file based repository, and then Ant and Groovy for all of the dirty work (upload files to QA web services, hashing, creating ISO’s. With Maven, I understand, you get one artifact per module, and ugh, a pom.xml you have to create for it.

I thought I’d move away from the Ivy file based repositories and on to something like Artifactory OSS (2,750 USD price tag a bit hefty for the paid version), Nexos OSS (I know, I’m cheap, didn’t check their price), and Archiva (FREE!!). Artifactory OSS looked great. Had it up and humming under Tomcat 7 and I was ready to go, but all of a sudden… After spending some time, I came to realize I could not get the revision number out of the file name for the ivy compatible layout. To do that, you need to define your own custom repository layout and that means you need Arficatory PAID VERSION. A FOOSTY for the Frog! I don’t want to have to name my .NET dlls like mydll-1.6.7.dll stuff in my build or my repo. I want the 1.6.7, or whatever version that be, out of the file name. This is a .NET project, not Java, no versions in file names. So out with Artifactory. In case your are asking, I did try to edit the Central Configuration Descriptor in Artifactory using the Advanced -> Config Descriptor tab in the gui, to know avail.

But then there’s Nexus, supports only Maven 1 and 2.

And Then there’s Archiva, suports only Maven 1 and 2.

Are there any non-Maven open source build artifact managers out there? We’ll see.

Download PDF
Posted in Maven, Uncategorized | Tagged | 2 Comments

Changed Owned Schema For User In SQL Server

I accidentally set “Owned Schemas” for a new user in SQL Server 2005 to db_backupoperator and db_owner. Not what I wanted, and then discovered I couldn’t change them back using SQL Management Studio. Oh, well, the following http://blog.sqlauthority.com/2008/04/05/sql-server-2005-transferring-ownership-of-a-schema-to-a-user/ helped out.

ALTER AUTHORIZATION ON SCHEMA::SchemaName TO UserName;
GO

For my case, this fixes it:

ALTER AUTHORIZATION ON SCHEMA::db_backupoperator TO db_backupoperator;
ALTER AUTHORIZATION ON SCHEMA::db_owner TO db_owner;
GO

Phew! Fixed it. I then added the new user to the db_backupoperator and db_owner roles instead in Role Membership which is what I should have originally done.

Download PDF
Posted in Snippets, SQL Server | Tagged , | Leave a comment