Sunday, 28 August 2016

Enterprise Challenges to Continuous Delivery

On one of my recent projects I noticed a challenge to a continuous delivery (CD) approach in the enterprise that I haven’t seen mentioned: Software that requires a paid license.

Most CD approaches are based on easily creating instances of a virtual machine. Software with a paid license often has mechanisms, like the MAC address of the first network interface has to be registered with the software vendor’s license server, to prevent automatically creating multiple instances of a virtual machine. Or it may have a license compliance tool that will get very confused by instances of virtual machines appearing and disappearing rapidly.

It’s probably not impossible to do CD with your paid software. Obviously, the easiest way to deal with the problem is to use software that’s completely free to use. If you can’t do that, you’ll need to understand how the license restrictions work, and then tailor the continuous deployment approach around those restrictions. Not easy, but probably doable.

Configuring Applications

I once had experience with a browser-based application that would show pages that were links to another application. Since the URL of the other application would change depending on the environment (development, test, staging, production, etc.), the developers decided to put the URL in a field in a row in a configuration table in the database.

So far, so good. Per-environment configuration needs to be changeable. But it turned out that putting configuration in the database had some challenges. Configuration in the database is less convenient to put under revision control and to deploy with automated tools. So we didn’t have the configuration as part of an automated build tool, and it was a bureaucratic nightmare each time we had to change the URL. (Simple files are easier to integrate with revision control and automated deployment tools.)

But what really caused problems was that the database contained more than just the protocol, host, domain, and port – the stuff that would change for each environment. It included a template for query parameters as well. So the line in the configuration table looked something like this:

https://otherapplication.example.com:20400/search-page?parm1=%1,parm2=%2

The application would take the query string (?parm1=%1,parm2=%2), and fill in the placeholders (%1, %2) with values. The problem was, every time the requirements expanded and we needed more parameters, the configuration string had to change for every environment.

The parameters weren’t part of the environment set-up, so they never should have been put in the configuration table. When you’re parametrizing an application configuration, make sure you put only things that change per environment into the environment configuration parameters.

Unrelated to the above point, but important to note, is that we also found it very inconvenient that the placeholder marker in the URL was a percent sign. Percent signs are URL-encodeable. When we had to e-mail each other with updates to the URL, we were constantly tripped up by our e-mail and spreadsheet programs “helpfully” URL-encoding the query parameters for us, turning %1 into %251, for example.

Tuesday, 19 July 2016

Citrix in a Window on Linux

[Edit: This was not the solution. It worked the first time, but now it isn't working again.]

I was using Citrix Receiver quite successfully on Ubuntu 16.04 and Linux Mint 13 to remotely access my customer's network, but I couldn't make it start in a window. It was coming up in full screen mode. I could minimize the whole Citrix session by doing Ctrl-F2 (to tell Receiver to pass the next key to Linux), then Ctrl-Super-downarrow (Super is the "Windows" key). However, I wanted to be able to watch the Citrix session on one monitor, while I worked on other stuff on the other monitor.

I finally found this blog that told me how to set up the Receiver config files to get Receiver to start in a window: http://blog.eek-a-geek.info/2014/10/citrix-receiver-for-linux-131-on-64-bit.html. What it says is:

Edit "~/.ICAClient/All_Regions.ini", replacing the line "TWIMode=*" to "TWIMode=Off".

Edit "~/.ICAClient/wfclient.ini", adding a line "TWIMode=off" to the "[WFClient]" section, and adding a line "UseFullScreen=True" to the "[Thinwire3.0]" section.

Monday, 30 May 2016

WebEx on Ubuntu 16.04

Java

You need Java installed. I used the Open JRE. Some places on the web say you need the Oracle version, but it works for me with the Open JRE and IcedTea:

sudo apt-get install openjdk-8-jre icedtea-8-plugin

That’s all you need to get the meeting to work, but…

Missing i386 Libraries

But you won’t be able to share screens without a bunch of missing i386 libraries. The WebEx plugin is 32-bit, so you need to install some libraries that aren’t installed by default.

Check to see if you’re missing libraries by going into ~/.webex/ and then into a sub-directory whose name is all digits and underscores. Once there, run:

ldd *.so | grep "not found" | cut -f1 -d' ' | tr -d '\t' | uniq

I got about a dozen missing libraries on a relatively new install of Ubuntu 16.04. You may get different results, depending on what’s been installed on your system since you initially installed Ubuntu 16.04.

I installed the following packages (fewer than a dozen, because some packages pull in multiple libraries as dependencies):

sudo apt-get install libxmu6:i386
sudo apt-get install libgtk2.0-0:i386
sudo apt-get install libpangox-1.0-0:i386
sudo apt-get install libpangoxft-1.0:i386
sudo apt-get install libxtst6:i386

If you check again with the above ldd command, the only library you should still be missing is libjawt.so. This library doesn’t seem to be needed.

Sunday, 17 April 2016

Android Phone Not Connecting via DHCP

I had a weird problem where suddenly my phone stopped connecting to my home WiFi. I was getting the WiFi icon with the exclamation mark, meaning that the router was connecting but I wasn't getting all the info needed to participate in the network.

(The solution further down doesn't require you to understand the next couple of paragraphs, so don't despair if there's too much tech talk in what follows.)

Many posts on-line suggested using a static connection. I was able to do that at home, because I knew the range of DHCP addresses that my router would not give out. But I wasn't satisfied with that solution. I hate it when problems mysteriously arise, and I couldn't identify any reason why my network connection at home should have suddenly started failing.

About the third time I looked for a solution, I came across this document from Princeton. It mentions that there's a bug in some Broadcomm chips that messes up DHCP when the network stays on when the device is asleep.

Well, I remember noting that I had my network configured to stay up when the device was asleep. I noticed it because I didn't think I had configured it that way. (I sometimes find my phone on the settings screen when I pull it out of my pocket, and settings are accidentally changed.)

So (here's the solution), I went back to Settings-> WiFi, then touched the three dots near the top right of the screen, then Advanced, then I turned off "Keep Wi-Fi on during sleep", which set my network to go off when the device sleeps. After that, my phone connected to my home network just fine.

My phone is a Nexus 4, running Android 5.1.1, but obviously this might affect other models since it looks like it's because of the hardware.

Saturday, 9 April 2016

Installing a Brother MFC9340CDW on Ubuntu 14.04

The printer install was easy. Just follow Brother’s instructions, which at the time were at: http://support.brother.com/g/b/downloadtop.aspx?c=ca&lang=en&prod=mfc9340cdw_all. Brother seems to change the location of their documents. A lot of the links on the net were broken.

The trick was when I installed on the second computer. It couldn’t find the printer. Once it woke up the printer, then I was able to install.

(I think I saw some references to wake-on-lan being an issue. I haven’t had a chance to look into it.)

As usual, installing the scanner was a bit of an adventure. I did the instructions here: http://support.brother.com/g/s/id/linux/en/instruction_scn1c.html?c=us_ot&lang=en&comple=on&redirect=on#u13.04

and this:

sudo usermod -a -G lp <username>
sudo usermod -a -G lp saned

and rebooted, and it still didn’t work. But then I just ignored it for about eight hours and did some yard work and cooking, and scanning worked. Go figure.

It’s sure nice to have double-sided scanning and printing. One trick with xsane and double sided-scanning is that you enter the number of page sides you’re going to scan, not the number of physical sheets of paper. In other words, when you’re scanning three pieces of paper double-sided, tell xsane that you’re scanning six pages.

Thursday, 24 September 2015

Why On-Line Voting Won't Work

There are a lot of reasons why on-line voting for anything important is a really bad idea. Some of them are technological, and technological problems, given time, can often be solved. But some of the problems are based in human nature. These kinds of problems are much harder to solve.

If you're sitting at home while you vote, someone, say from the ruling party, can stand over you and force you to vote the way they want you to. If you don't think that could happen in your country, fine. Maybe you trust your political parties more than I trust mine. But I bet you can think of places where it could happen.

That's not the only situation where people could be forced to vote for certain candidates. A woman in an abusive relationship could be prevented by her husband from voting for the candidate who wants to crack down on spousal abuse. Or imagine you're a candidate running to protect people from slum-lords, when the slum-lords can make sure that anyone who votes for you gets kicked out of their apartment. What about a single mother who can only find accommodation in a "faith" based shelter, and the shelter requires her to vote for candidates who want to take away women's reproductive rights?

And then there's the simple bribe. Did you ever wonder why parties spend money on advertising, instead of simply offering you $20 for your vote? It would probably be a lot cheaper. You don't get offered a bribe for your vote because the briber has no way of knowing you actually voted the way they paid you to. Once someone can watch you vote, they will be a lot more willing to pay you to vote their way.

None of the above happens in most modern democracies because you vote in a public place. People -- other voters and election officials -- can see that no one else could see how you voted. So there's a reasonable chance that you really did vote for the candidate you preferred, and not for the one that either coerced you or paid you to vote for them.

We're taught that the secret vote is the key to legitimacy for an electoral system. But the real key is the secret vote in a public place. Once the safety of the crowd is taken away from the act of voting, bribery and coercion become effective options. And once people believe that votes can be bought or obtained by coercion, the legitimacy of the whole electoral system evaporates.

There may be answers to these problems. I don't pretend to be smart enough to come up with them. But until we have answers to these issues, the technological problems of on-line voting pale in comparison.