Showing posts with label software. Show all posts
Showing posts with label software. Show all posts

Monday, December 23, 2013

Regular Expressions

To match a floating point value in a substring I currently use the following regular expression:

(\d+(?:\.\d+)?(?:[eE][-+]?[0-9]+)?)

This matches:

  • 123
  • 123.4
  • 123.4E3
  • 123.4e-4
  • etc...


Does anyone have a better expression that matches example strings?
Please post in the comments below, thanks.

Monday, June 17, 2013

Installing "Glances" system monitor on ubuntu 12.04

Glances is a curses based tool for monitoring your system - kind of like top on steroids. There is a small issue with using the version in the PPA on Ubuntu 12.04 (specifically the 12.04.2 minimal install); it crashes on startup with the following error:
Traceback (most recent call last):
  File "/usr/bin/glances", line 5, in
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
To fix it I manually had to install the package python-pkg-resources.

Thursday, March 21, 2013

AO Item Assistant v1.1.5

A new version of Item Assistant has just been released which should fix the major issues introduced with the "big AO server merge". It also cleans up and removes support for multiple dimensions and the player-shop monitor since these features are obsolete.

For those that play on both "live" and "test live" I recommend having two separate installs of AOIA, one for each dimension. Even with the old multi-dimensional support, it was never meant to support "test live" as one of the dimensions. (Due to, amongst other things, the difference in the AO Item database.)

I also want to give a big "THANK YOU!" to the AO community for all the feedback, testing and suggestions that just keep on coming in.

(For those that have been testing intermittent versions, this is essentially the same as v1.1.4.24.)


AOIA Homepage
v1.1.5 download

Wednesday, September 26, 2012

SublimeText2 - A small tip

It can be difficult to find the correct internal name of a command when you want to add a keyboard shortcut to it in SublimeText2. Wouldn't it be neat if you could show all the commands you trigger in a window somewhere? Well, it turns out it is really simple:
  • Open the console
  • Type the command
    • sublime.log_commands(True)
  • Go do stuff in the editor or menus and see commands roll by. 
When you have the command name it is quite easy to add that to your personalized key-bindings from the Preferences menu.

i.e. my current personalizations:
[
   { "keys": ["ctrl+keypad_divide"], "command": "toggle_comment", "args": { "block": false } },
   { "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": false } },
   { "keys": ["ctrl+d"], "command": "reindent" },
   { "keys": ["shift+ctrl+s"], "command": "save_all" },
   { "keys": ["ctrl+d"], "command": "find_under_expand" }
]


Thursday, April 12, 2012

Mercurial with Git Subrepository

I recently had some problems creating a Git sub-repository inside my Mercurial main repository using the guide I found here!

Problem

All is well and good up to that point, however when committing the added .hgsub file things started to head south.

From the commandline (cmd) I would get an error:
abort: The system cannot find the file specified
While from TortoiseHg I would not get an error. However, the expected .hgsubstate file did not get created, and thus the repository has in effect no valid sub-repositories if you try to clone it!

Workaround

The workaround is to do the commit of the .hgsub file from the GitBash shell instead of the regular shell or TortoiseHg, since then the .hgsubstate file will be generated. Using the GitBash shell is also mandatory for committing any change to the .hgsub file, or .hgsubstate file, as well as the initial clone of the repository.

Some googling around indicate that the issue is due to either Mercurial or TortoiseHg trying to execute the "git.exe" command (as opposed to just "git") and that this alias does not exist in the regular shell. I have not verified this, so YMMV!

Misc

Potentially relevant software that is installed on the computer:
  • Windows 7 x64
  • TortoiseHg (2.3.1)
  • Mercurial (2.1.1)
  • Git (1.7.6)
  • Python (2.6.6)
Both the "git" and "hg" commands were included in the PATH.

Saturday, September 10, 2011

Item Assistant v1.0

I would like to thank everyone for all the feedback, encouragement and gentle nudges I have received over the last 18 months or so. It has been a long while since I released an update to Item Assistant, and I apologize for that, but now the wait is over.

v1.0 is here!

Major changes this release include the new Summary View and an installer to supplement the regular zip archive distribution.

The Summary View shows credits and levels of your characters, while the installer takes care of some of the most common problems people have installing the application.

In addition to new features, a lot of work have gone into trying to make the application more robust to handle the different usage scenarios.

From the change log:
  • Fixed bug 2947010. Generating the script with items for ingame display now use the correct linebreak tag.
  • Fixed bug 2802231 in the find panel and in the PB filter panel. Toon list is now reloaded as it is opened. 
  • The window location is now recorded and restored to/from the conf file. 
  • Opening an item using Xyphos.com will now also supply the QL of the item so the stats are shown correctly. 
  • Improved ripping of items database so it supports newer version of AO.
  • New Summary View shows levels and amount of credits for all registered toons. 
  • Created a basic installer.

Enjoy!

Sunday, July 31, 2011

OpenVPN on Windows 7

I have always had a problem with OpenVPN on my Windows 7 (64 bit, pro edition) laptop. Installing would go just fine, but it was never able to connect to the VPN server, even though I checked on several other computers (even a Windows 7 one) that the settings were correct and working.

VirtualBox
As it turns out, OpenVPN and Oracle VirtualBox on the same computer just doesn't work. Uninstalling VirtualBox would make it possible to connect to my VPN server.

However, I then encountered another issue...

TUN/TAP Driver
If the VPN connection dropped, like due to an unstable wifi link, I could never get it to work after it had reconnected.

After rebooting it would work fine though, so after a bit of fiddling I came up with a workaround. Before reconnecting to the VPN server I have to disable and then re-enable the TUN/TAP network driver. Go figure...

Software Used
  • Windows 7 64 bit professional edition
  • VirtualBox 4.0.10 and 4.1.0
  • OpenVPN 2.2.1

Thursday, February 24, 2011

Free Tail GUI for Windows

Need a tail replacement on your Windows box? Look no further than Log Expert.

It has lots of powerful features such as:
  • regular expression highlighting
  • "columnizer" for well-defined log file formats
  • opensource
  • unicode support
  • plugin support

...to name a few!

The homepage for the source-code: http://logexpert.codeplex.com/

Tuesday, January 11, 2011

Ubuntu and OpenVPN FQDN Problems.

I have been having some weird problems with OpenVPN on my clean Ubuntu 10.10 (desktop) install whenever I connect to a remote LAN using OpenVPN. The remote LAN hosts a number of servers, all located under the domain company.local (example). Even if it connects and I can ping the remote machine that is called testserver, I can NOT ping the same server through its fully qualified domain name (FQDN) testserver.company.local. Ping would fail with the following error:

ping: unknown host testserver.company.local

Trying to lookup the FQDN with nslookup works just fine! Strange!

Now it appears that the reason is something called a MDNS (Multicast DNS) which kicks in and handles (by default) all .local domains. Looking at the file /etc/nsswitch.conf I found a line that looks like this:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

Apparently the '.local' extension is not sent to the DNS server for resolution if the MDNS system cant resolve it. So I went ahead and changed the line to:

hosts: files mdns4_minimal dns mdns4

I went back to the shell and ran ping testserver.company.local again, and lo-and-behold it works!

Software used:
  • NetworkManager
  • NetworkManager-OpenVPN
  • OpenVPN
  • Ubuntu 10.10 Desktop

Tuesday, January 26, 2010

Item Assistant v0.9.7

Item Assistant version 0.9.7 has just been released to the public. This is a pure bugfix release that hopefully fixes some compatibility problems on Windows Vista and Windows 7.

Also included is a bugfix from Darkbane relating to the recording of org contracts.

From the changelog:

  • Fixed org city output for CharacterParser integration. Does not dump contract message on zone since it doesn't contain anything useful anyway.
  • Includes UAC manifest in EXE file. Hopefully this should make some compatibility problems with Vista and 7 go away.

Saturday, January 16, 2010

AO Item Assistant v0.9.6

I have just released v0.9.6 of AO Item Assistant. This release is mainly a bugfix release and fixes some critical stability and compatibility issues.

Also included are patches from Darkbane to make the application output files that can be used by his tools.

Output of the files can be controlled by the Record Stats button on the toolbar.

Here is the official changelog:

  • Changed link to AO Mainframe.
  • Updated SQLite to version 3.6.22 to resolve some issues.
  • Fixed database parser bugs. The symptom was that the application was unable to track certain items.
  • Application now outputs files that can be opened with the CharacterParser application.

Monday, May 11, 2009

TeamCity, Ant & DITA

Over the last few days I have been trying to get a CI server (aka build server) up and running. After trying out both CruiseControl and CruiseControl.NET I landed on TeamCity since it is a bit simpler with a decent web GUI as well as being somewhat familiar from my work.

You can download TeamCity and try it out for yourself since they offer a free edition that supports up to 20 build configurations and 3 build agents.

One of the tasks I wished to accomplish in by CI server was to build the online help files (HTML) as well as the user manual (PDF). Having all the source material in DITA formatted XML files makes that pretty easy from the command line using the DITA Open Toolkit full easy install distribution. Getting it to run automatically from TeamCity proved to cost me some gray hairs though.

So as a note-to-self here is a short checklist of what to do after TeamCity has been installed:
  1. Download DITA and unzip it. (Ex in: C:\DITA-OT1.4.3)
  2. Create a new build configuration for you project, and set "Ant" as the "Build runner".
  3. "Ant Home" should be the ant folder in your DITA installation. (Ex: c:\DITA-OT1.4.3\tools\ant\)
  4. In "Additional Ant Command Line Options" input the classpath and any options for Ant or the DITA toolchain it spawns.
  5. Add DITA_DIR environment variable to the build configuration and set it to the folder you unzipped DITA to in step 1.
  6. Create a build.xml file for your targets and point TeamCity at it.
Note!
Setting the CLASSPATH environment variable had NO effect, neither had adding -classpath to the JVM command line options. Only adding it as a -cp option to the Ant command line did the trick. I did not find any mention of this in either DITA documentation or TeamCity documentation.
It might be obvious for someone more familiar with Ant, but for me it was a big hurdle I only discovered while (desperately) searching trought the Ant plugin configuration on my TeamCity server.

Monday, April 20, 2009

ERA Visual on CNN

For the last 4+ years I have been working at Epsis AS, a technology company focused on Integrated Operations in the Oil and Gas business. For much of that time I have been working on an application that is now in use by Chevron SJV.

CNN has posted an video about the application here and the effect it has had.

Friday, February 20, 2009

Item Assistant v0.9.2

I just uploaded a new snapshot of Item Assistant to the sourceforge page. This is the official v0.9.2 release.

You can see the forum for the official release notes.

This version has been tested with the recently released patch of Anarchy Online (v18.0.0) also know as "The Legacy of the Xan" booster pack.

For downloading go here.

Sunday, August 3, 2008

Konsole colors in Kubuntu

Switching on colors in the KDE Konsole is not fortunately very easy:
  • Start the Konsole application
  • Choose from the menu: Settings -> Edit Current Profile
  • Click the "Environment: Edit..." button on the General tab
  • Make sure the TERM variable is set to
    xterm-color like so: TERM=xterm-color
  • Click "OK" in both the dialogs to apply changes
  • Restart the Konsole application to see the effect it had

Tuesday, April 29, 2008

Find in Files

More Visual Studio 2005 oddities.

Today my Find in Files command suddenly stopped working. For some unknown reason. A very helpful error message showed up in the results window:

No files were found to look in. Find was stopped in progress.

After a bit of searching on the internet I came over this blog that explained how to fix it: http://bloggingabout.net/blogs/edward/archive/2005/01/31/2136.aspx

Basically you have to press CTRL + Scoll Lock to fix it... why? I have no idea.

Saturday, November 10, 2007

Disappearing GUI Elements in Visual Studio 2005

For some reason after updating to Visual Studio 2005, the Exception Window no longer had the "Break on Unhandled Exception" column (or whatever it's called).

Here is a link explaining how to get it back.

Monday, November 5, 2007

Resizing a RAID1 system partition.

Scenario: I have a Linux server (running Gentoo) with 2x 80 GB drives in a software RAID1 configuration that is used as the system drives to boot the server. I wanted to upgrade the drives and swap in some bigger 160 GB drives I had laying around. So, how to do it?

PS! Command syntax is for example only and is not necessarily correct nor complete.
  1. Make sure grub is installed on both drives so the system will still boot if one drive is missing.
  2. Fail all partitions from one of the drives: mdadm --manage /dev/md3 --fail /dev/hdc3
  3. Remove the drive from the array: mdadm --manage /dev/md3 --remove /dev/hdc3
  4. Shutdown server, and replace the drive with a bigger one.
  5. After reboot, create the same number of partitions that was on the old drive. Each partition must be at least as big as the one it is replacing.
  6. Add the new partitions to the array: mdadm --manage /dev/md3 --add /dev/hdc3
  7. Let them fester.. i mean rebuild. You can check the status by: cat /proc/mdstat
  8. Once finished rebuilding, repeat step 2-7 for the other drive.
  9. I now had an identical array to the one on the old drives, except i have space to resize the filesystem to make use of any extra space on the new partition scheme.
  10. First we need to make the array partition make use of all the available storage on the harddrive partitions: mdadm --grow /dev/md3 --size=max
  11. Online resizing doesn't work for mounted filesystems, and the system disks can't be unmounted while in use. So, reboot into a rescue CD. I chose gParted.
  12. Then re-created the raid array with the second drive missing. mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hdc3 missing
  13. Ran fsck -n /dev/md3
  14. Removed the journaling from my ext3 filesystem (making it into an ext2 fs basically): tune2fs -O ^has_journal /dev/md3
  15. Ran e2fsck -f /dev/md3
  16. Ran resize2fs /dev/md3 and waited a fair amount of time.
  17. Once more ran fsck -n /dev/md3
  18. Before re-enabling the journaling: tune2fs -j /dev/md3
  19. Just to be sure, i rebooted into gParted once more, and created the array again just as in step 12.
  20. I then added the second drive to the array: mdadm --manage /dev/md3 --add /dev/hda3
  21. Sat back and watched: watch -n 1 'cat /proc/mdstat' for a long time while the second drive got rebuildt with the new filesystem size.
As a last step, I edited /etc/mdadm.conf on the system disk before I rebooted. Not really sure if it was needed, but didn't hurt.
Before I edited the file it did not contain any settings. I basically just added definitions for the arrays i have on my system disks, and listed the partitions to use for each of them.

Update:
You might wonder why I did not add both drives to the array BEFORE I resized the file system. And yes, you can indeed do this. It would probably even be faster! But: REMEBER TO MAKE A BACKUP! With my approach I had the second drive as a backup in case something went boom on the first drive.