Xepr license work around

< admonition type=danger title=“Disclaimer” Disclaimer: the author does not condone piracy but this may be used as a temporary measure < /admonition >

​As readers of my work-sided blog posts will be aware, I’ve had some recent problems with spectrometers and their control PCs. As a result I’ve been swapping computers and network cards right, left and centre to try and get things working. As a temporary measure and so as to avoid contacting Bruker every 20 minutes for a new Xepr license file for the latest network card I’m trying I’ve written a little script to get around the Xepr license check.

Basically when Xepr is started, there is a small pop-up window which quickly appears but displays the Xepr version number. At this time Xepr is checking for a valid license file, if the license file is not valid/nonexistent then the program quits.

The validity is a simple check of the MAC address of the eth0 port (which you can view as a super user with ifconfig).

Now I am not condoning piracy in any way, and Bruker are usually very good at giving out new license files if you justify yourself. To reiterate this is a short-term measure to stop annoying Bruker.

Create a new file in your favourite text editor, and copy and paste the following:

#!/bin/sh
#
#   Xepr2 -- Morgan's xepr startup script
#
# This script changes the network port eth0 to the MAC address
# required for Xepr to start. Waits 2 seconds and then changes
# the MAC address back.
#
# This script currently requires a license file to be installed
# and for it to be in date. The script could be editted for
# finding the license file expiry date and changing the system
# clock accordingly but this risks other programs and requires
# a lot more coding. Just ask Bruker for a valid one.
#
# This script should be run as a normal user but can be called
# as a super user. If it is called as a normal user then the
# script will ask for an administrator password as it needs
# super user privileges to access ifconfig and change the
# hardware address
#
# M. Bye v12.8
#
# Author:       Morgan Bye
# Work address: Henry Wellcome Unit for Biological EPR
#               University of East Anglia
#               NORWICH, UK
# Email:        morgan.bye@uea.ac.uk
# Website:      http://www.morganbye.net/EPRtoolbox
# Aug 2012;     Last revision: 17-August-2012

#   === CHANGE THESE VARIABLES ===

# MAC address for the license file, ie what your computer is not

MAC="XX:XX:XX:XX:XX:XX"

# Path to license file (for checks on expiration date)

LICENSE="/usr/Bruker/flexlm/licenses/license.dat"

#   === DO NOT CHANGE PAST THIS POINT ===

# Get user
USER=$(whoami)

# Get license expiry date
# EXP=$(cat /usr/Bruker/flexlm/licenses/license.dat ....)


# Get current MAC address and save it as a variable
OLD=$(sudo -i ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')

# Change machine MAC address
# ==========================

sudo -i ifconfig eth0 down
sudo -i ifconfig eth0 hw ether $MAC
sudo -i ifconfig eth0 up

NEW=$(sudo -i ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}')

# Call Xepr - taken from standard Xepr file
# =========================================

Xepr &


# Wait to allow Xepr's license check
sleep 2

# Change machine MAC address back
# ===============================

sudo -i ifconfig eth0 down
sudo -i ifconfig eth0 hw ether $OLD
sudo -i ifconfig eth0 up

This assumes that Xepr has been aliased into the shell correctly. Change the MAC address in the variable section to your license file MAC address (it should be at the end of the XEPR line). Save the file, I personally called it Xepr2.

Close the file, it can now be called with

./Xepr2

It will ask for the administrator password. Xepr should start with no problems and the terminal will be returned to the user and can be closed if wanted.

As normal you can alias this if you like, so that you can call Xepr2 from anywhere (including desktop launchers)

​# Troubleshooting If Xepr gives you error messages then check the MAC address entered in the variable section matches that in the license file. If you’re on an older PC then try adjusting the sleep time. By default I’ve used 2 seconds (as my network pings the PC every 5 seconds and I dont want the dynDNS server changing getting confused and trying to report the port), but on older PCs 2 seconds may not be enough for Xepr to start, so try changing it to 10.

What distinguishes you from other developers?

I've built data pipelines across 3 continents at petabyte scales, for over 15 years. But the data doesn't matter if we don't solve the human problems first - an AI solution that nobody uses is worthless.

Are the robots going to kill us all?

Not any time soon. At least not in the way that you've got imagined thanks to the Terminator movies. Sure somebody with a DARPA grant is always going to strap a knife/gun/flamethrower on the side of a robot - but just like in Dr.Who - right now, that robot will struggle to even get out of the room, let alone up some stairs.

But AI is going to steal my job, right?

A year ago, the whole world was convinced that AI was going to steal their job. Now, the reality is that most people are thinking 'I wish this POC at work would go a bit faster to scan these PDFs'.

When am I going to get my self-driving car?

Humans are complicated. If we invented driving today - there's NO WAY IN HELL we'd let humans do it. They get distracted. They text their friends. They drink. They make mistakes. But the reality is, all of our streets, cities (and even legal systems) have been built around these limitations. It would be surprisingly easy to build self-driving cars if there were no humans on the road. But today no one wants to take liability. If a self-driving company kills someone, who's responsible? The manufacturer? The insurance company? The software developer?