Updates from September, 2021 Toggle Comment Threads | Keyboard Shortcuts

  • MD1032 3:56 pm on September 27, 2021 Permalink  

    Open VNC virt-viewer (.vv) files on macOS 

    I tried to use virt-viewer from homebrew but it didn’t work properly. Instead I decided to write an Automator App that reads the contents of the .vv file and opens the macOS built-in VNC viewer.

    Create a new Automator Application, and add the “Run Shell Script” action and choose to pass input as arguments. Select bash as the shell and enter the following code:

    /usr/bin/env python3 <<'EOF' - "$@"
    import configparser
    import sys
    import os
    import urllib.parse
    config = configparser.ConfigParser()
    password = urllib.parse.quote(config['virt-viewer']['password'].encode('utf8'), safe='')
    os.system("open vnc://:"+ password + "@" + config['virt-viewer']['host'] + ":" + config['virt-viewer']['port'])

    Save the action under /Applications. In Finder, open the .vv file with this new app and choose to always open this file extension with it. Now when you double click on a .vv file in Finder, it should open the VNC console.

  • MD1032 1:55 pm on July 8, 2020 Permalink  

    This copy of the Install macOS Catalina application is damaged 

    I recently needed to reinstall macOS via USB stick on a laptop that has not been used for a while. I was able to boot from the USB, but when running the installer I was greeted with the “This copy of the Install macOS Catalina application is damaged…” message. Curiously, the same USB stick worked fine on another Macbook.

    During the time in storage the laptop battery ran out of power completely and the system clock was reset to Jan 1 2019. Using the “Utilities – Terminal” window I was able to set it to today’s date with the “date” command.

    It is probably related to a signature on the Installer image that is only valid from a certain starting date.

  • MD1032 9:40 pm on April 11, 2015 Permalink  

    Nomachine reports “ERROR: Unsupported operating system ‘linux'” 

    I’m trying to install Nomachine NX Enterprise Server on Ubuntu, and the installation of the .deb package fails with:

    NX> 704 ERROR: Unsupported operating system 'linux'

    After looking at the install script, I found a simple solution:

    sudo touch /etc/debian_version

  • MD1032 3:49 pm on August 16, 2014 Permalink  

    Disable annoying pop-up messages in VirtualBox 

    Run from command line:

    VBoxManage setextradata global GUI/SuppressMessages "all"

    • BillV 3:18 am on July 1, 2016 Permalink

      This doesn’t seem to work in VirtualBox 5.0.20 and 5.0.22 and looking at the change log for 5.0.24 it isn’t addressed. The xml file shows that running the above command indeed set the parameter to “all” but VirtualBox ignores it somehow.

  • MD1032 6:20 pm on November 7, 2013 Permalink  

    3G USB stick Huawei E169/E620/E800 HSDPA in Linux 

    Simply install the “wvdial” package and edit /etc/wvdial.conf:

    [Dialer Defaults]
    Phone = *99***1#
    Username = username
    Password = password
    Stupid Mode = 1
    Dial Command = ATDT

    [Dialer hsdpa]
    Modem = /dev/ttyUSB0
    Baud = 460800
    Init2 = ATZ
    Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    ISDN = 0
    Modem Type = Analog Modem

    Then run “wvdial hsdpa” and you should be connected. I didn’t have to specify the Optus APN anywhere.

  • MD1032 2:35 pm on July 24, 2013 Permalink  

    CurlFTPfs: 95 Operation not supported 

    I’ve been using curlFTPfs with rdiff-backup and ran across this problem when creating the remote backup log file:

    ftpfs: operation ftpfs_open failed because Operation not supported
    unique: 889, error: -95 (Operation not supported), outsize: 16

    The curlFTPfs author says:

    “Be aware that some applications might not
    be able to “save” files on curlftpfs from 0.9.2 on, because
    we don’t support open(read+write) or open(write) and seek

    Looking at /usr/lib/python2.7/dist-packages/rdiff_backup/log.py around line 76:

    try: self.logfp = rpath.open("a")
    except (OSError, IOError), e:
       raise LoggerError("Unable to open logfile %s: %s"
             % (rpath.path, e))

    The file is opened with the append flag (“a”), which is write and seek. Replacing it with “w” fixes the problem, but truncates the log file, which is fine with me.

  • MD1032 8:30 pm on December 12, 2012 Permalink  

    OpenStack “backing file” cleanup script 

    Sometimes OpenStack leaves the “backing file” of the sparse root filesystem behind after a VM is destroyed. Those files are located in /var/lib/nova/instances/_base/ and can use up hundreds of GB. To find out which of those backing files are orphans and delete them, someone has posted a script, which I slightly improved:

    cd /var/lib/nova/instances
    find -name "disk*" | xargs -n1 qemu-img info | grep backing | sed -e 's/.*file: //' -e 's/ .*//' | sort | uniq > /tmp/ignore
    while read i; do
    ARGS="$ARGS \( \! -path $i \) "
    done < /tmp/ignore
    eval "find /var/lib/nova/instances/_base/ -type f $ARGS -delete"

    Someone in the original post claimed that adding remove_unused_base_images = True to nova.conf would do this automatically, however I could not reproduce that on Folsom.

  • MD1032 1:33 pm on November 10, 2012 Permalink  

    How to create a bootable volume in Openstack Folsom 

    Wouldn’t it be nice to have the root filesystem of your Openstack VM inside a volume? This way you could install a lot of packages on the root partition without spreading the files over several volumes. You could take a snapshot of the entire system (OS & data) and boot right off it.

    Openstack Folsom supports this feature. Here’s how you can create your own bootable volume:

    • On your desktop machine, download the cloud image of the OS that you want to boot from a volume. I chose Ubuntu 12.10:
    • wget http://cloud-images.ubuntu.com/releases/quantal/release/ubuntu-12.10-server-cloudimg-amd64-disk1.img
    • Now convert it to RAW format using qemu-img
    • qemu-img convert -O raw ubuntu-12.10-server-cloudimg-amd64-disk1.img ubuntu-12.10-server-cloudimg-amd64-disk1.raw
    • Start up a regular VM from the Ubuntu cloud image (or any other image you have)
    • Create a volume (that you later want to boot from) and attach it to the VM
    • SSH into the VM and become root
    • check if your volume is attached with fdisk -l. The volume device name is /dev/vdb in my case
    • ssh into your desktop machine (or wherever you have the RAW image) ¬†from the VM and write the image data directly into the volume device
    • ssh user@desktop cat ubuntu-12.10-server-cloudimg-amd64-disk1.raw > /dev/vdb

    If you want your root partition to be larger than 2GB, you can now resize it to the volume size. To do that, start parted, get the partition information, delete (!) the partition, create a new one with the same “start” value, but with (total size-1) as the end value. Partition type is “primary”, filesystem “ext4”.

    root@3:/home/ubuntu# parted /dev/vdb
    GNU Parted 2.3
    Using /dev/vdb
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) unit B
    (parted) p
    Model: Virtio Block Device (virtblk)
    Disk /dev/vdb: 21474836480B
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number Start End Size Type File system Flags
    1 8225280B 2146798079B 2138572800B primary ext4 boot

    (parted) rm 1
    (parted) mkpart
    Partition type? primary/extended? p
    File system type? [ext2]? ext4
    Start? 8225280
    End? 21474836479
    Warning: The resulting partition is not properly aligned for best performance.
    Ignore/Cancel? i

    (parted) set 1 boot on
    (parted) p
    Model: Virtio Block Device (virtblk)
    Disk /dev/vdb: 21474836480B
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos

    Number Start End Size Type File system Flags
    1 8225280B 21474836479B 21466611200B primary ext4 boot

    (parted) q
    Information: You may need to update /etc/fstab.

    Now you can detach the volume in Horizon and create a new instance. Choose “Boot from Volume” in “Volume Options” and choose your volume. You may also take a snapshot of the volume first, if you want to preserve it in a fresh state for later. You still need to choose an image in the “Details” section, which makes no sense in this case, since the VM is entirely booted off the volume.

  • MD1032 5:03 pm on August 31, 2012 Permalink  

    collectd libvirt plugin build dependencies 

    When configuring collectd using ./configure –prefix=/usr/local –enable-libvirt , the modules section that’s displayed after configuring on my machine shows:

    libvirt . . . . . . . no (dependency error)

    The solution here is to install the libxml2-dev package in addition to libvirt-dev, since that is needed by collectd to parse the XML VM configuration stanzas that libvirt provides.

  • MD1032 3:43 pm on June 11, 2012 Permalink  

    Airport Extreme: update dynamic hostname through BIND 

    If you are the owner of an Apple Airport Extreme base station, you may have wondered if it is possible to assign a static hostname to your dynamically changing ADSL IP address. Many other routers offer this feature through one of the popular dynamic DNS services such as DynDNS. Apple however decided not to support the proprietary interfaces of those commercial services, but instead use a generic approach as described in RFC 2136 Dynamic Updates in the Domain Name System (DNS UPDATE).

    Here’s how you can use this feature.


    • Apple Airport Extreme Base Station
    • Airport Utility version 5.6 (the DNS update feature is not accessible in 6.0+)
    • a domain name where you can choose your own nameserver (most domain sellers allow this)
    • a (Linux) server running BIND9 on a static IP address


    • for this setup I assume that your Linux box has the static hostname mybox.com on IP address The domain name you want to use for your airport extreme is airport.mydomain.com. This means mydomain.com is owned by you and has its nameserver set to mybox.com.
    • Install BIND version 9 on your Linux server (e.g. “sudo apt-get install bind9”) and create a zone file for your domain. You can put it in /etc/bind/zones/mydomain.com.db and make it look like this:
    $ORIGIN .
    $TTL 86400	; 1 day
    mydomain.com		IN SOA	mybox.com. mailaddress.gmail.com. (
    				2012060524 ; serial
    				28800      ; refresh (8 hours)
    				7200       ; retry (2 hours)
    				864000     ; expire (1 week 3 days)
    				86400      ; minimum (1 day)
    			NS	mybox.com.
    			MX	10 mydomain.com.
    $ORIGIN mydomain.com.
    *			A
    $ORIGIN _dns-sd._udp.mydomain.com.
    b			PTR	mydomain.com.
    db			PTR	mydomain.com.
    dr			PTR	mydomain.com.
    lb			PTR	mydomain.com.
    r			PTR	mydomain.com.
    $ORIGIN _udp.mydomain.com.
    _dns-update		SRV	0 0 53 mybox.com.
    • google for some BIND tutorials if you need more information on the zone file configuration
    • make sure port 53 UDP is open in your Linux box’s firewall
    • create a RNDC key. This is the “password” used to update your DNS zone. Run “rndc-confgen -a -c /etc/bind/rndc.key”
    • add the following to your /etc/bind/named.conf.local:
    include "/etc/bind/rndc.key";
    zone "mydomain.com" {
          type master;
          file "/etc/bind/zones/mydomain.com.db";
          update-policy {
            grant rndc-key name airport.mydomain.com A;
    • ensure that your zone file and the named.conf.local have permissions -rw-r–r– and are owned by root, group bind.
    • on Ubuntu 12.04 I had to edit the file /etc/apparmor.d/usr.sbin.named and change the line “/etc/bind/zones/** r,” to “/etc/bind/zones/** rw,”
    • restart apparmor and bind
    • check the syslog for any bind errors
    • if you’ve just changed the nameserver of domain.com to mybox.com, it may take 24h or more for this update to reach your provider’s DNS cache
    • check your nameserver configuration with “dig”. “dig a domain.com” should give you an answer section with your Linux box’s IP address. “dig ns domain.com” should return mybox.com. “dig PTR b._dns-sd._udp.domain.com” should return domain.com.
    • when everything works as expected, we can now configure Airport Extreme. Open “Airport Utility 5.6”, choose the “base station” tab and click “Edit…”. Configure it as in the screenshot below. The password is the “secret” as mentioned inside your rndc.key file. Enter it without the quotes.
    • click “Done” and “Update”. Your Airport Extreme should update the DNS A record for airport.domain.com every 15 minutes. In your syslog it looks like this:

    Jun 11 07:15:07 alderaan named[31953]: client updating zone 'domain.com/IN': deleting rrset at 'airport.domain.com' A
    Jun 11 07:15:07 alderaan named[31953]: client updating zone 'domain.com/IN': adding an RR at 'airport.domain.com' A

    • you can now reach your home network from anywhere through the hostname “airport.domain.com”. Success!!
    • belkone 8:21 am on September 14, 2014 Permalink

      Hi, I know, that article is from 2012, but should it works right now? When I try to setup dns using your solution I have in logs: named[5798]: client xx.xx.xx.xx#61698: update ‘zzz.zzz.zzz/IN’ denied. Can you tell me what am I doing wrong?

    • Liviu P. 5:14 am on September 29, 2015 Permalink

      Very interesting article. I can confirm it works but i think BIND is not giving back the right answer to apple airport router since the router sends DNS update very very often (5 times a minute). I think the answer should contain ttl value (lease time) but i didn’t figure out how to do that with BIND and i wrote my own dns server.

    • Sanigo 2:25 am on May 19, 2016 Permalink

      It is a good article, and it did work! But i have the same problem as Liviu, the router sends update too frequently. I have no idea about this.

Compose new post
Next post/Next comment
Previous post/Previous comment
Show/Hide comments
Go to top
Go to login
Show/Hide help
shift + esc