Software Mangement 101

After the new and flashy system has been introduced into an organisation it starts to be the time for some software management, mainly to keep the system up to date with current techniques but also to keep it easy to run and upgrade. Here are some of my observations from my years as a software engineer:

1. At least once a year:
  • Check language version
  • Check OS version
  • Check any used framework versions

If anything above is overdue for an update or out of support:
Update as the first priority!

2. After this we do (in order):
  1. Bugfixes
  2. Operational improvements
  3. New Features
3. All bug fixes and new features should have tests that prove they work:
  • Unit tests for backend changes
  • Selenium, or eqvivalent, for frontend
  • Aim for a test coverage of at least 80%
  • Always have at leas one more developer that checks any change before a merge/deploy

It does not have to be more complicated than this 🙂 Remember to KEEP IT SIMPLE!

Yubikey: Manual pair a PIV Yubikey with OSX

Every now and then things does not work as intended. For example: when putting a new Yubikey that has certificates, PIN and PUK installed into a slot on your Mac, a pairing dialog should appear. This does not always happen and in this case we need to do a “manual pairing”.
I will here explain how:

1. Insert the Yubikey into the Mac
2. Open a terminal
3. Run the sc_auth command below

sc_auth identities

This will output something like this:

Unpaired identities:
C28BE4EC86FAAC4B5EFE825947240B2CE03BA4F2       Certificate For PIV Authentication (<username>)

4. Now run the following comman to start the pairing process

sudo sc_auth pair -f -u<username> -hC28BE4EC86FAAC4B5EFE825947240B2CE03BA4F2

<username> – is the username of the identity that you want to pair with your Yubikey
“C28BE4EC86FAAC4B5EFE825947240B2CE03BA4F2” – is the Yubikey hash for the identity above (the CN of the authentication certificate)

The process will now begin with asking for the Yubikey PIN

5. If all goes well you should now see a message “Pairing Successful”

You are now ready to use your Yubikey on your Mac

Tested on OSX Catalina 10.15.4 and Yubikey firmware 4.4.5

Git: Remove a rebase that has not yet been pushed

Every now and then I find myself in a situation were I want to completly remove a rebase I just did. Maybe the application does not build anymore and I want another shoot at doing that rebase or squash

I’m here going to describe one way using git reflog and git reset

We start with the git reflog to find the place we want to return HEAD to.

git reflog

Below is an example of a reflog with a recent rebase (squash):

d21df0dd1 HEAD@{44}: rebase -i (squash): # Combination of 5 commits.
2b8f61237 HEAD@{45}: rebase -i (squash): # Combination of 4 commits.
049fdd05e HEAD@{46}: rebase -i (squash): # Combination of 3 commits.
a3c59ce01 HEAD@{47}: rebase -i (squash): # Combination of 2 commits.
1029f7e05 HEAD@{48}: rebase -i (start): checkout HEAD~19
5d870be58 (origin/MyBranch) HEAD@{49}: commit: Moved border to window
5d870be58 (origin/MyBranch) HEAD@{50}: commit: Added submit btn
5d870be58 (origin/MyBranch) HEAD@{51}: commit: Removed CSS class one
56f962c08 HEAD@{52}: commit (merge): Fixed conflicts with main branch

We are here looking for the entry just before the ‘rebase -i (start)‘, which in this case is HEAD{49} (HEAD{48} is the ‘rebase -i (start)’ entry)

After this all we need to do to return HEAD to that place is to run

git reset --hard HEAD{49}



Tested on Git v2.25.0 on a Windows 10