June 11, 2015

Use YubiKey for 2 Factor Authentication on Ubuntu 14.04

To increase the security for your Google Account you can use 2 factor authentication with SMS. But also you can use YubiKey. To get that to work on Ubuntu 14.04 follow the instruction here http://ihaveagadget.blogspot.se/2014/11/yubico-u2f-key-not-working-in-ubuntu.html.

How to Create a Bootable USB for Linux ISO


The most generic way to create a bootable USB with a Linux ISO file, is to use the dd command.


On RHEL/CentOS/Fedora

# yum install syslinux

On Ubuntu/Debian

$ sudo apt-get install syslinux


1. Download ISO file

2. Convert your normal ISO file to a hybrid ISO.

# isohybrid /home/magnus/Downloads/ubuntu-12.04.4-desktop-amd64.iso

3. Create a bootable USB.

# dd if=/home/magnus/Downloads/ubuntu-12.04.4-desktop-amd64.iso of=/dev/sdf
1501184+0 records in
1501184+0 records out
768606208 bytes (769 MB) copied, 286.08 s, 2.7 MB/s

NOTE: the device name is without number, e.g. /dev/sdf1.

If you are unsure what the device name is you can e.g. use lsblk.

# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1  1024M  0 rom  
sda                           8:0    0 167.7G  0 disk 
├─sda1                        8:1    0   500M  0 part /boot
└─sda2                        8:2    0 146.5G  0 part 
  ├─vg_rhel6-lv_root (dm-0) 253:0    0   127G  0 lvm  /
  └─vg_rhel6-lv_swap (dm-1) 253:1    0  19.5G  0 lvm  [SWAP]
sdf                           8:80   0   3.7G  0 disk 

March 6, 2015

Crontab Expression

I do not write contab scheduling expression every day, so I tend to forget the expression syntax. Below is a good site for generating such expressions.


March 3, 2015

Puppet IDE Geppetto

When writing puppet modules I would recommend using an IDE when writing puppet code. The IDE from puppetlab is the most mature - Geppetto. Geppetto is fine, but one warning when installing it.

DO NOT install Geppetto as a plugin in an existing Eclipse. Instead I recommend downloading the bundle version http://puppetlabs.github.io/geppetto/download.html.

March 2, 2015

How to Install Tomcat 6 on RHEL 6

A good and accurate guide exists on http://oracle-base.com/articles/linux/apache-tomcat-installation-on-linux.php

Maven RPM Plugins

There are two major maven rpm plugins.

  1. rpm-maven-plugin The Codehaus mojo plugin is good and holds good quality as almost all mojo plugins, but has one big disadvantage. It requires rpmbuild linux tool, which means it will not run without pain on Windows. You could of cource switch to a better os, but that is often easier said than done in bigger organizations.
  2. Redline RPM The second tool is build on Redline, which is a pure java library, which means it will run on windows. The backdraw with this one, is that it exists no maven plugin for it, only ant is supported out of the box.