USB DAC Sound Card on Debian

On Debian by default when you plugin a USB DAC (Soundcard), it does not become the default audio playback device which is not particularly useful. 

To change the default soundcard or more correctly the playback hardware device, you need to edit the ALSA config file eith in the user home directory ~/.asoundrc or globally in /etc/asound.conf.

First find out the names of the soundcards available on your system with the aplay command. 

[~] # aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Generic [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: M2496 [M Audio Audiophile 24/96], device 0: ICE1712 multi [ICE1712 multi]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: DAC [USB Audio DAC], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I want to use my USB Audio DAC, which has the name "DAC".

This is my ~/.asoundrc

pcm.!default {
    type hw
    card DAC

ctl.!default {
    type hw
    card DAC

To test the sound is now coming out the correct device you again use aplay. 

[~] $ aplay /usr/share/sounds/alsa/Noise.wav
Playing WAVE '/usr/share/sounds/alsa/Noise.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono


Verbatin V3 MAX 32GB speed test

Looking for a fast USB drive to use on my Chromebook, which only has USB2, I came across what appears to be bargain "fast" USB3 drive from Verbatim. Claimed transfer is 175MB/s on USB3, of course you will not get this on USB2 but I was hoping it would comfortably max out the USB2 limits. 

Here are the results:


On my HP laptop:

[~] # hdparm -t /dev/sdb

 Timing buffered disk reads:  96 MB in  3.03 seconds =  31.69 MB/sec

[/media/VERBATIM] $ dd if=/dev/zero of=test bs=10240 count=102400
102400+0 records in
102400+0 records out
1048576000 bytes (1.0 GB) copied, 42.0829 s, 24.9 MB/s

Which is what I was hoping for, from wikipedia the maximum USB2 throughput is  35 MB/s. 




Using xrandr with fluxbox on a laptop or dual monitors

Recently I gave up on Mint Linux 15, the bloated slowness of the interface and unstable web browsing experience really disappointed me. I was fedup with disappointment on my desktop, previuosly being disappointed with Ubunut's Unity interface I jumped my workstation ship to Fedora. This didn't last long until I had Gnome 3 shoved down my throat. Which led me to follow the crowd to Mint. Fed up with being disappointed I went back to where I should never have left, hello fluxbox and damn my machine is responsive again.

Puppet "SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B" error

[root@test ~]# puppet agent -t
err: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

If you are running fedora 18 or newer

timezone, Europe/Prague

If you have something older

Using iperf to test broadband speed

The iperf tool is already widely used by system administrators to test and benchmark networks links. I even used it at home to work out how to layout my powerline adapters for best performance.

A less obvious use for iperf is to measure your broadband speed. Nothing wrong with web based sites like, I use them a lot and can't resist running quick test when I join a new wireless network with my phone.

Best practise for Apache Virtual Hosts


As linux consultants we often work on systems that have been configured by someone else. Some of these systems have grown into webservers with a number of websites running as virtual hosts. Depending on the level of skill and insight the original system admin had, the apache configuration files can end up a tangled rats nest. I think this stems from the apache docs for vhost, albeit being very good, not give any guidelines on best practise for managing configuration files. Leading to people editing httpd.conf, to add virtual hosts, which soon gets mangled up. To make your virtual hosts manageable, the best practise is to use configuration files in /etc/httpd/conf.d/ for everything. Do not edit any of the config files in /etc/httpd/conf/ unless you really have to. A good starting point is to use a seperate file for each website. Or if you have specific needs create seperate configuration files to define difference web services. 



Mounting a LVM partition from a QEMU file

Last week we had an interesting problem, one of our customers needed us to recover files from a KVM disk image. They had no idea how the disk had been partitioned or about the KVM it came from (on further inspection it would not boot). Like a set of matryoshkas dolls the raw image contained a GUID Partition Table, which contained a Logical Volume Group which contained the partition we needed to mount.

We started by trying to view the partition table using fdisk to gave us an idea of what was inside.


${fqdn} not working in puppet manifesto

When using ${fqdn} in your puppet manifestos to specify different config files for your nodes. often they will simply not pick up the correct file. 

  file { "/etc/sysconfig/iptables":
    ensure => "present",
    source => ["puppet:///modules/security/iptables.${fqdn}","puppet:///modules/security/iptables.default"],
    notify  => Service["iptables"], 

The iptables example above always gets the default iptables config file.

Subscribe to RSS - linux