Logitech Unifying Receiver Pairing on Linux

This post is mostly for my future reference. Really simple to pair a new mouse with an existing receiver on Linux.

ltunify is a program resulting from the gathered knowledge on the Logitech HID++ protocol. It allows you to pair additional devices like keyboards and mice to your Unifying receiver, unpair existing devices and list information about connected devices. This section will show you how to install the ltunify program.

Besides a C compiler and a way to fetch sources (wget+tar or git), you will need Linux 3.2 or newer with the hid-logitech-dj module. On Debian and Ubuntu distributions, the required packages can be installed using:

sudo apt-get install git gcc

Fetch the sources and install ltunify to $HOME/bin/ using the next commands:

git clone https://git.lekensteyn.nl/ltunify.git
cd ltunify
make install-home

The following steps will assume that $HOME/bin is available in your path. If not, run:

export PATH="$HOME/bin:$PATH"

If everything went well, you should be able to run ltunify --help to show the available options:

Usage: ltunify [options] cmd [cmd options]
Logitech Unifying tool version dev
Copyright (C) 2013 Peter Wu <lekensteyn@gmail.com>

Generic options:
  -d, --device path Bypass detection, specify custom hidraw device.
  -D                Print debugging information
  -h, --help        Show this help message

  list            - show all paired devices
  pair [timeout]  - Try to pair within "timeout" seconds (1 to 255,
                    default 0 which is an alias for 30s)
  unpair idx      - Unpair device
  info idx        - Show more detailed information for a device
  receiver-info   - Show information about the receiver
In the above lines, "idx" refers to the device number shown in the
 first column of the list command (between 1 and 6). Alternatively, you
 can use the following names (case-insensitive):
 Keyboard Mouse Numpad Presenter Trackball Touchpad

The below session shows you how to use a device index to unpair a mouse.

$ sudo ltunify list
Devices count: 1
Connected devices:
idx=1   Mouse   M525

$ sudo ltunify unpair 1
Device 0x01 Mouse successfully unpaired

$ sudo ltunify list
Devices count: 0
Connected devices:

$ sudo ltunify pair
Please turn your wireless device off and on to start pairing.
Found new device, id=0x01 Mouse

$ sudo ltunify list
Devices count: 1
Connected devices:
idx=1   Mouse   M525

It is also possible to select a device by device type (case-insensitive). When multiple devices of the same type are available, the first one will be selected.

$ sudo ltunify unpair mouse
Device 0x01 Mouse successfully unpaired

PyCon 2015 will…

PyCon 2015 will be held in Montreal again next year from April 8th – 16th, 2015. We hope to see you there!

Tutorials: April 8th – 9th
Conference: April 10th – 12th
Sprints: April 13th – 16th

Blogging this because it’s hard to find the dates for PyCon 2015

Car2Go Minneapolis Promo Code – Expires 3/16/14

Didn’t get a free lifetime membership to Car2Go Minneapolis last Fall? This is the last “cheap” promo for Car2Go and lifetime memberships. My wife and I used Car2Go in both Portland and Seattle during our recent vacation. We never had to rent a car!

The PFAR1030 promo code gives you a discounted $10 car2go registration fee (instead of the normal $35) AND 30 free minutes of car2go drive time. My promo code expires on 3/16.

How to fix a R1Soft NO_PUBKEY error during apt-get update

During a recent apt-get update of one of our systems, we encountered an error with the R1Soft repository for CDP:

W: GPG error: http://repo.r1soft.com stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1BF3530AA40384ED

It appears that R1Soft started using a new key which they publish.  In order to get this repository working again, you must update to use the new key.  Use the following commands to import the new key:

wget http://repo.r1soft.com/r1soft.asc
apt-key add r1soft.asc
apt-get update

The key (pun intendned) of this post is to remind myself of the URL of the public key block.

Reaction to Two Scoops of Django 1.6 FAQ – No Digital Edition?!?!

Considering that we publicly offered a free electronic copy to those who requested it, seeing piracy of the electronic editions from the first day of sales has been disheartening. As indie authors, it hurts to see this happening.

It is awful to think of the piracy that occurred, however this just punishes the people that want an electronic format and are honest in the first place. If somebody wants to pirate a copy, they will do it whether an electronic edition is available or not.

I can totally understand the argument on multiple ebook formats being an issue due to formatting.  The solution is simple — only offer a PDF that is a rendering of the physical book.

It is legal (* from what I can tell) to scan a book that was legally acquired for personal use. This falls under the fair usage laws (similar ripping MP3s of CDs you own).  I’ve scanned books at home into PDF and then shredded them (I have fairly limited space for tech books at home).  The results are only fair and are better if I slice off the binding.

It is more than likely that with this edition of Two Scoops of Django, I will buy via Amazon and ship directly to 1dollarscan.com which will scan ($1 per 100 pages) a book into a PDF and then after two weeks they shred the book (they do not return books).  Talk about a waste of natural resources — paper manufacturing, printing, ship to a warehouse and ship to a scanning company, etc.

Maybe an alternative is to sell PDFs but password protect them which makes it easier to figure the origin if a pirated copy is discovered and watermark the header on the top each page with the name, email and phone number of the original purchaser.

Physical books won’t stop the pirates.  Yes, it does make it harder for them (marginally), however this just punishes the majority of honest people that used the electronic format in a responsible and legal manner for the few (relatively) that decided to pirate a copy.  So the only thing that has changed is increased the cost of my book by about $4 (the cost to scan at 1dollarscan.com) and I can no longer search it (unless I pay extra for the OCR option).

Edit on Feb. 7th, 2014 due to feedback — I want to clarify some points:

This post is a reaction to not publishing a digital edition and points to how I’m probably solving the “no digital edition” issue for myself.  I will still purchase a legal physical copy of the book. I still want Danny and Audrey to take my money because I want the content.  I just expressed my wishes to get an official digital edition. Using a scanning service is a lazy hack, however Fair Use hack (as long as I don’t distribute it).  Also, I do not support pirating media and therefore this post isn’t a “how to pirate” manual — merely a legitimate fair use solution to having a digital version for personal use.

Other than this post… I have not participated in any public discussions (other than the single automated tweet when this post was publishing).  I’ve now been counted and blamed as one of the trolls that “caused” future editions of Two Scoops of Django to not happen. This is a rather unfair assessment.

The point is pirates will still pirate a copy of this book because they want to.  If anything, this is a testament to quality of the content that Danny and Audrey produce.  I must admit it is sad that the availability of pirated copies of Two Scoops is a compliment to the authors.  It does reinforce that quality content is in demand and there are people that un-willing or just plain too cheap to buy a legitimate copy.

The real losers here are the legitimate users that want to buy a legal copy of a book. The only thing done by not making a digital edition available is that making the first pirated copy is just slighly harder to make. I would guess about 45 minutes at a flatbed scanner is about it. Not having a digital edition won’t stop piracy at all and therefore I don’t except that as a legitimate reason to not do a digital edition.  On to a real reason… time!

Two Scoops 1.5 edition was released with three digital edition types (mobi, epub and pdf).  The PDF looks like the print copy and I never used the epub or mobi editions.  Considering the target devices for epub and mobi, I suspect it took Danny and Audrey a LOT of time to probably do it right (which they indicated in their FAQ).  This was an ambitious and lofty goal to release so many formats. Kudos to them for doing it however I’m sure it contributed to the reason to not release a digital edition for this version.  So it understandable that time is a factor for the authors (rightfully so). The solution is export a PDF version of the book and skip the tedious hand grooming of epub and mobi formats.