Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

DevOps Linux Linux

Jenkins command line ssh: Host key verification failed despite ssh-agent After hours of "Why does it work locally but not in Jenkins", this error boils down to StrictHostKeyChecking... In other words, since the job runs as a user on a random slave, and this user most likely doesn't have a known hosts file with an entry for the target system, this fails rather cryptically. You think that the user's keys don't work, but that's not the problem.

The whole setup boils down to :
  1. Install ssh-agent plugin
  2. Configure credentials with a valid ssh key for your target
  3. Enable ssh-agent with that credential entry in your job config
  4. Add StrictHostKeyChecking=no to whatever ssh command you are using. Some examples:
    • GIT:
      export GIT_SSH_COMMAND="ssh -oStrictHostKeyChecking=no"
    • SSH:
      ssh -oStrictHostKeyChecking=no ....

Low Tech Hacks Low Tech Hacks

Replacing batteries in a Philips Norelco T980 Turbo Vacuum Trimmer»
I bought this trimmer in 2008 and the NiCd batteries finally died in 2016 - not bad. Still, no reason to trash a working trimmer and contribute to the landfill problem. As it turns out, it's fairly easy to disassemble, and even easier to reassemble. So here are the steps, which probably apply to many similar models.

Low Tech Hacks Low Tech Hacks

Replacing batteries in a Sonicare Elite toothbrush»
I've had this toothbrush for over a decade, and the batteries finally died. I suppose that's a long time for NiCd cells to last. For the last year or so the toothbrush would not complete the 2 minute cycle but would instead stop sometime earlier. The batteries are clearly still alive but simply don't have enough capacity. The toothbrush is not designed to be opened (it is ...

Linux Linux

Ubuntu 15.10: Handling Dell Latitude laptop dock events to reconfigure displays»
Couldn't find any good solutions out there. I have a Dell Latitutde E6410 running Ubuntu 15.10 with XFCE (no Gnome or KDE). I use a physical docking station that allows me to use two external monitors. Ubuntu doesn't seem to understand that if these external monitors vanish, it should switch to the monitor that remains (built-in LCD), and vice versa, so I have to automate it myself. ...

Code and Hacks Code and Hacks DevOps

Marking Jenkins build UNSTABLE from environment inject groovy script»
The way we use the Jenkins "Prepare an environment for the run" feature of the Environment Inject Plugin is this: we use the "Evaluated Groovy Script" to retrieve some info from a successful run of some other job (svn revisions, environment vars, whatever) in order to make it available to the environment of the current build. But what if that other job hasn't run successfully (yet)? I'd ...

DevOps Linux Linux

Migrating Maven Jenkins jobs to FreeStyleJobs due to JDK 1.6 incompatibility»
Soon after Jenkins 1.609.1 support for JDK 1.6 was dropped altogether. This means that you can run jobs with whatever JDK you want as long as you are not using the Maven job type . Maven jobs require JDK 1.7 or higher (actually they run on whatever version the master is using, ignoring the JDK setting in the job configuration). This is a big deal for a shop that does extensive ...

DevOps Java Java Linux Linux

Jenkins: Bulk editing jobs to remove a trigger»
I have about 200 jobs that have the HudsonStartupTrigger (this is a plugin) turned on. This makes all of them run every time the master is restarted, causing the build queue to go crazy. I don't know why people turned this on in so many jobs (probably blindly copying jobs) over the years, but I'd like it gone. I don't want to restart the master or uninstall the plugin. Here is a ...

DevOps Linux Linux

Suse11 cannot mount NFS share»
This is a recent issue on Suse 11.3. I have hundreds of machines mounting the same share fine - Centos, RedHat, even AIX. mount -v /mountpoint mount.nfs: timeout set for Wed Dec 9 11:09:27 2015 mount.nfs: trying text-based options ...

DevOps

Puppet: recursively delete a Windows Registry key»
Puppet forge has a registry provider that allows one to manage a key or value. What it cannot do is delete a whole tree starting at a particular key. So, hacks to the rescue:   # deletes the whole tree if it exists   define registry_wipe_tree ( $key = $title ) {     exec { "Purge registry $key" :       ...

DevOps Linux Linux

Jenkins Swarm Slaves on Windows using Puppet»
Jenkins Swarm plugin is great, and instrumentation for Linux is fairly well-known, but what about Windows? Here is one approach for setting it up as a windows sevice (what we want Puppet to do): Download Swarm jar Download winsw from Kohsuke Rename winsw to jenkins_swarm.exe Create jenkins_swarm.xml Run jenkins_swarm.exe install Start service Now for the details

DevOps Linux Linux

Jenkins Windows Slaves cannot install JDK»
Despite making the jenkins slave user a local administrator. The slave runs tools\hudson.model.JDK\JDK_1.7\jdk.exe (or 1.6), and fails (see the extended post body for the log). If you're seeing Error 1722.There is a problem with this Windows Installer package , then most likely you have another (newer?) version of this JDK installed system-wide. Uninstall from Control Panel, try again.

Linux Linux

Webex in Ubuntu 15.04»
The following was required to get shared screens to display: Using openjdk 7 (although I have 7 and 8 installed, 8 is default, and I removed oracle java - but the browser plugin still runs 7) Follow Option 1 from http://askubuntu.com/a/623397/238077 If you are missing libxmu6, install the 32 bit version: sudo apt-get install libxmu6:i386 (this is actually mentioned in the ...

DevOps Linux Linux

Getting VMware vSphere 5.5 Server Console to work on Ubuntu Linux 15.04»
As everyone who uses this product eventually finds out, VMware vSphere (5.5) browser-based web client will generally work in Linux (at least in chrome), but opening a server console is nearly impossible. The web client requires flash 11.5, and of course there is no linux flash above 11.2... After a lot of dancing I managed to get it working in Firefox 40.0.3 on Ubuntu 15.04. Here are ...