KVM Revisited Part I - Multiple VLANs

Posted on Tue 15 September 2015 in misc • Tagged with kvm, vlan

I've decided to rebuild my KVM lab on OpenSUSE 13.2 and to try and finish documenting the process of a fully functional KVM lab on multiple VLANs.

Install KVM with yast2

I used the "Install Hypervisor and Tools" in yast2 to install KVM.  I also allowed it to create …


Continue reading

Setting Up VLANs and DHCP server in ScreenOS

Posted on Mon 14 September 2015 in misc • Tagged with screenos, vlan

In this example I wanted to create a VLAN attached to e0/1 for use with my KVM lab.  You'll notice I give this interface an IP address, this is so that I can have my ScreenOS device do all the routing / NATing / firewalling in isolated VLANs. I also create …


Continue reading

OpenSUSE XDM SSH_ASKPASS

Posted on Sat 08 August 2015 in misc

Every year or so I rebuild my machine and forget how to enable the ssh-askpass tool with ssh-agent from XDM display manager

cp /etc/X11/xdm/sys.xsession ~/.xession

cp ~/.xinitrc.template ~/.xinitrc

# Add ssh agent config for loading keys

if test -S "$SSH_AUTH_SOCK" -a -x "$SSH_ASKPASS"; then 
       ssh-add ~/.ssh …

Continue reading

Passing CFLAGS and LDFLAGS to cgo

Posted on Sun 12 July 2015 in misc • Tagged with go, openbsd

I was trying to build https://github.com/systemfreund/go-libshout which wraps the C libshout library with Go.  On Linux this worked fine, but on OpenBSD this was a bit more of a challenge as cgo could not find libshout.  (install libshout with pkg_add first)

Although -lshout is specified as …


Continue reading

Ansible ad-hoc commands

Posted on Mon 01 June 2015 in misc

Create an inventory file

[host1.something]
[host2.something]
[group1]
group1host.something
group2host.something

Run a command on all hosts ansible -i inventory_file all -m command -a "uptime"

This specifies the inventory file (-i) run on all hosts (all) and run the command module (runs a remote command) with the module …


Continue reading

Real Time Scheduling for audio in openSUSE

Posted on Sun 08 March 2015 in misc

I was getting the following message from jack / hydogen

Cannot use real-time scheduling

To solve this I added the following to  /etc/security/limits.conf

@audio - rtprio 99
@audio - memlock 250000
@audio - nice -10

and also added myself to the audio group (sudo usermod -a -G audio jon)


Continue reading

Bulk Filename Rewriting

Posted on Sat 08 November 2014 in misc

In zsh you'll find zmv (autoload zmv) and in zmv it's easy to rewrite bulk files.  For example, I had some downloaded files that were something.mp3?id=8795294528 etc and wanted to cut off the cruft at the end.

zmv '(*.mp3)*' '$1'


Continue reading

Strip comments from an XML file

Posted on Sat 18 October 2014 in misc

Ever had an xml file bloated with comments? Here's a great one-liner for striping them.

tidy -quiet -asxml -xml -indent -wrap 1024 --hide-comments 1 file.xml

Thanks to http://stackoverflow.com/questions/1464697/stripout-comments-from-xml


Continue reading

Convert pem certificate to pkcs12 / p12

Posted on Thu 21 August 2014 in misc • Tagged with openssl, certificates

openssl pkcs12 -export -in widgets.crt -inkey widgets.key -out widgets.p12


Continue reading

Multiple desktops with xrandr on fluxbox

Posted on Fri 11 July 2014 in misc • Tagged with xrandr

I use fluxbox.  Sometimes I work with multiple screens, sometimes I don't, sometimes those screen are various resolutions.

To see what screens I have available I run

xrandr -q

from there I can see what screens and what resolutions I have availble.  Then I can configure my setup with appropriately …


Continue reading