Monday, January 23, 2017

Need to import things from JIRA into Google sheets?

Attach this to a google sheet and then just pass in the filter number.

This should get past both jira's 1000 issue limit and importxml's limit. The only limitation is script runtime which is 5 minutes. Have imported up to 1500 issues with no problem.

function parseXml(searchNumber) {
  var searchURL = '' + searchNumber + '/SearchRequest-' + searchNumber + '.xml?tempMax=500&os_username=username&os_password=password';
  var xml = UrlFetchApp.fetch(searchURL).getContentText();
  var document = XmlService.parse(xml);
  // get total
  var total = document.getContent(2).getChild("channel").getChild("issue").getAttribute("total").getValue();
  var pages = Math.ceil(total/500);
  var sheetData = new Array();
  //loop through pages
  for (var i = 0; i < pages; i++)
    var pageURL = searchURL + '&pager/start=' + i * 500;
    var xml = UrlFetchApp.fetch(pageURL).getContentText();
    var document = XmlService.parse(xml);
    var items = document.getContent(2).getChild("channel").getChildren("item");
    var xmlElementNames = [
    for (var j = 0; j < items.length; j++) 
      var rowData = [];
      for (var k = 0; k < xmlElementNames.length; k++)
        var itemElement = items[j].getChild(xmlElementNames[k]);
        if( itemElement )
          // check the customfields
          var customfields = items[j].getChild("customfields").getChildren("customfield");
          var customfieldfound = false;
          for (var l = 0; l < customfields.length; l++)
            if( customfields[l].getChild("customfieldname").getValue() == xmlElementNames[k] )
              customfieldfound = true;
          if( customfieldfound == false )
      sheetData.push( rowData );
  var sheet = SpreadsheetApp.getActiveSheet();
  var sheetRange = sheet.getRange(1, 1, sheetData.length, sheetData[0].length );

Wednesday, September 28, 2016

Need a dump?

If you ever need a crash dump from a remote machine because you're trying to debug a crash.

Create a key at 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
No settings required. Just the key's existence is enough 

Default settings will put the dump in to %LOCALAPPDATA%\CrashDumps

For more info : Here.

Tuesday, December 2, 2014

WASP x64 ( Windows x64 , Apache 2.4 x64 , SVN, PHP )

To make things easy WASP will now go out in the wild.

Ever wanted a 64 bit distribution of apache 2.4, svn and php but putting all the parts together caused butt pain?
Well here you go.

How stable is it?
It hasn't crashed in production. YET.

How is it configured?
httpd.conf. It uses lots of memory! It eats 2.3 GB of RAM, and then holds steady due to a 2GB svn cache. If you have a small repo and more RAM? MAKE the cache BIGGER!

In production it currently serves a 1.6TB svn repo with 465k revisions that is growing, and acts as a proxy for multiple internal web servers. It also runs PHP so you can use it to do other useful things. Uses rotatelogs to make daily rotating logs, cause usually no one sets this up either!

Why did I put it together?
Because nothing out there fit my needs.

Why did I put this here?
Because hopefully it'll benefit someone else that also wants to roll their own and not use collabnet/wandisco/visualsvn. They are all great products, but not quite what I'm looking for.

How do I install it?
Extract to C:\WASP. Run httpd.exe


Monday, July 21, 2014

Note to self : 0x000001d error

Usually means some /arch: for code generation that is not supported, like SSE2 / AVX

Monday, June 9, 2014

Beware the Windows Scheduled Tasks!

I've had a TeamCity server run much much slower than it's other counterparts.

I finally narrowed it down to Scheduled Tasks. The agent was started at logon by Scheduled Tasks.

It looks like Scheduled Tasks will start in under below normal priority and while this wasn't a problem for many of our build tools, TortoiseSVN however performs very very poorly in below normal priority.

Simple Hall and Teamcity Integration

You will have to set up these 2 parameters as environment variables to be passed in your TeamCity project parameters configuration.

env.BuildID =
env.BuildTypeID =

Checks to see if it's running under TeamCity and then sends the INFO

if not "%TEAMCITY_PROJECT_NAME%" == "" curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"TeamCity\",\"message\":\"Failed - %TEAMCITY_PROJECT_NAME% - %TEAMCITY_BUILDCONF_NAME% - %BUILD_NUMBER% ^<a href="http://TEAMCITYURL/viewLog.html?buildId=%BuildID%&buildTypeId=%BuildTypeID%&tab=buildResultsDiv"^>View Build^</a^>\",\"picture\":\"http:/TEAMCITYURL/img/icons/TeamCity32.png\"}"

Thursday, June 5, 2014

Visual Studio Property files and line endings

If you like to lay out multi line preprocessor definition in macros in .props files.


Something like that. Certain plugins like the clang plugin will cause all sorts of interesting errors because it'll pass the command line to the compiler with the CRLF.

Change line endings to Old Mac format CR only.

VS will allow you to edit and it will respect the line endings and wont convert it, and it seems to pass through to the compiler just fine.

Integrating windows hosted SVN with hall, logs and diffs provided with WEBSVN

For posterity

SET PATH=%PATH%;E:\svn;E:\curl\bin;E:\bin


SET HALLROOM=put Group API Token here
SET WEBSVNHOST=https://YOUR_URL_HERE/revision.php?repname=REPONAME


svnlook author %REPOS% --revision %REV%> E:\temp\svnlook%REV%_USER
SET /P SVN_USERNAME=<E:\temp\svnlook%REV%_USER
del E:\temp\svnlook%REV%_USER

svnlook log %REPOS% --revision %REV%> E:\temp\svnlook%REV%_LOG
del E:\temp\svnlook%REV%_LOG

svnlook dirs-changed %REPOS% --revision %REV%> E:\temp\svnlook%REV%_CHANGED


grep -E "%PATHTOMATCH%" E:\temp\svnlook%REV%_CHANGED
if "%ERRORLEVEL%"=="0" curl -X POST -H "Content-Type: application/json" -d "{\"title\":\"SVN Commit\",\"message\":\"%SVNMESSAGE%^<br^> ^<a href="%WEBSVNHOST%&path=%%2F&rev=%REV%"^>Inspect Log^</a^>\"}"

del E:\temp\svnlook%REV%_CHANGED

Wednesday, May 1, 2013

Reset WINS cache on a QNAP device

Disable WINS server from web administration page

SSH into it

cd /var/log/samba/locks

delete wins.dat

Enable WINS server from web administration page


Saturday, April 27, 2013

I just purchased Trillian Pro for life...

Unfortunately, I'm probably never ever going to use it. Do I regret it? A little, but I wanted to give it a fair shot.


I really wanted an IM app that would do all the services I use. Pidgin and Miranda both support Skype through the SkypeAPI, but that integration is iffy at best.

I admit that my needs are very different from most people but here is why Trillian is basically unusable to me :

UI and customization

This is my miranda setup. Here are the highlights of this UI setup.

  • Lack of whitespace and window dressing and borders. Keyboard navigation lets me do everything.
  • Names are indented in groups. 
  • No status messages. I show only the data I need and I want to know.
  • The smaller bottom chat window is set to always on top
  • The larger chat window houses my IRC channels, and that is set to NOT always on top
  • Every window remembers what tab container it belongs to.

In contrast with Trillian.

  • Lots of wasted space
  • No indents on names under groups
  • In tiny vs simple UI, names are indented but status messages show up. There needs to be an in between setting.
  • Tabbed Chat Windows are always on top or not, I cannot specify per window.
  • Tabs do not remember which group they are in. Once I close the application, IRC boots up and opens the large chat window first, every chat window I open from then on goes to the big chat window, and not a smaller one below.

Insufficient keyboard navigation

In Miranda, keyboard navigation alone is enough for me to do everything. I almost never have to touch a mouse

CTRL+SHIFT+R = go to next waiting message ( event:next event does not seem to work the way it used  to in trillian Pro 1.0, if it does, then I have no clue how to get it working correctly )
CTRL+SHIFT+A = pull up the contact list ( this still works )
CTRL+W = close a window ( this works )
CTRL+PGUP/PGDOWN =  go to the next tab (also still works )

Incomplete Skype group chat support

The main reason I wanted to use Trillian was because of its SkypeKit support, and not have to have Skype running in the background. Unfortunately, this feature is not 100% complete. It lets you receive messages from a group conversation, but there is no way to send to that group if you don't already have it open. The poor UI I could kind of deal with, but this feature is the most important of all.


Everything in Skype animates in and out with a fade. Give an option to turn this off. I don't need fades, I want quick response time. Opening a chat window to a contact takes half a second, and closing it takes half a second as well.

Why does it take such a long time for it to shut down? I can see it sit in task manager for a good 15 seconds before the process finally goes away.


I really wanted to switch back to Trillian since I have fond memories of my Trillian Pro 1.0 days. You guys were the best around back then. Unfortunately, with the way Trillian works right now, the user experience does not fit my needs.