Multiple monitor position in linux

I have been using Cinnamon for my window manager on my linux desktop. I’m using a Thinkpad T460p with the dock and a pair of U2311H monitors rotated to the left side by side. This config is fairly easy to setup in Windows and OSX and works on linux but can require a little more fiddling.

The default cinnamon display settings dialog did not allow me to position the monitors relative to each other. Instead if I tried to drag a monitor closer or change it’s position the displays would flip around to be on top or on the bottom. There was no small adjustments, just wild snapping around.

So dragging an application window or even moving the mouse from my two monitors to the laptop meant that if I exited the dell monitor high up on the panel the mouse would appear low on my laptop’s display. Additionally the panels appeared to have a large buffer space between them so that when dragging a window across displays it disappears into the upside-down (You should really watch Stranger Things on Netflix) for a bit before reappearing on the next monitor.  This incongruity bothers me to no end.

Then a stumbled upon ARandR, a fantastic little tool for adjusting your monitor’s position and resolution. It’s in the It’s a gui front end for xrandr and it works perfectly! No manually counting pixels to adjust your monitor’s relative position.

The best part is, now that I fixed the position in ARandR the cinnamon display settings dialog seems to work as expected? I’m sure it’s a bug but I don’t have time to track it down.

If you find yourself about to pull your hair out with multi-monitor position and orientation in linux try ARandR!

Rainbowstream config error fix

I have been playing around with a neat console based twitter client called rainbowstream. After installation and initial config I kept getting

Your ~/.rainbow_config.json is messed up:
>>> [Errno 2] No such file or directory: '/home/username/.rainbow_config.json'

errors when starting the client. The config in your home directory is for per-user customizations.

I tried touching an empty file in my home directory but I then received:

Your ~/.rainbow_config.json is messed up:
>>> No JSON object could be decoded

So then I found the default config in the rainbowstream app directory and copied it over top of the config in my home directory:

cp /usr/lib/python2.7/site-packages/rainbowstream/colorset/config ~/.rainbow_config.json

This worked perfectly and now rainbowstream doesn’t complain on startup anymore.

EDIT: Thanks to Naik for providing the updated paths for debian based distros in the comments below!

 

FreeBSD update cowardly refusing to proceed any further

I was recently upgrading one of my FreeBSD servers to 11-RELEASE and encountered an issue I haven’t run into in a while.

# freebsd-update upgrade -r 11.0-RELEASE
src component not installed, skipped
Looking up update.FreeBSD.org mirrors… 4 mirrors found.
Fetching metadata signature for 10.3-RELEASE from update6.freebsd.org… done.
Fetching metadata index… done.
Fetching 2 metadata patches.. done.
Applying metadata patches… done.
Fetching 1 metadata files… done.
Inspecting system… done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base

The following components of FreeBSD do not seem to be installed:
world/doc world/games world/lib32

Does this look reasonable (y/n)? y

Fetching metadata signature for 11.0-RELEASE from update6.freebsd.org… done.
Fetching metadata index… done.
Fetching 1 metadata patches. done.
Applying metadata patches… done.
Fetching 1 metadata files… done.

The update metadata is correctly signed, but
failed an integrity check.
Cowardly refusing to proceed any further.

I have run into this in the past but I couldn’t remember what the solution was until I searched for it. Dan’s blog has the answer.

Mac OSX powerd high cpu usage in activity monitor

I was recently in Activity Monitor checking network info when I noticed that powerd was using an inordinate amount of CPU time on my macbook. It’s a little odd for the power management daemon to be the source of a power problem!

powerd After poking around a little more I noticed that the activity monitor stores power consumption infomation and the light switched on in my head. A quick look at top confirmed my suspicions.

top-ocpuThe reason powerd appears to be using a lot of CPU time is because when you have activity monitor open it’s querying it for power information. So if you suspect powerd is using a lot of CPU time I suggest closing Activity Monitor and using “top -o cpu” instead.

Firmware upgrade Cisco 7911g via tftpd

I’ve been working on bringing some old cisco 7911G’s up to a recent sip firmware so they can be used with asterisk. Luckily the firmware is all available on the cisco site as long as you sign up for a free account.

If you’re running firmware older than 8.3 you need to update to a firmware level between 8.3 and 8.5.2 before you upgrade to firmware 9.x.

From the firmware 9.2 release notes:

"For all SCCP firmware upgrades from firmware release versions earlier than 8.3(3) to Version 9.2(3) or
  later, you must first upgrade your firmware to an intermediate Version (8.3(3) to 8.5(2)) and then
  upgrade to 9.2(3)."

To do the upgrade you need the a tftp server and option 66 defined on your dhcp to tell the phones where to look for the files. I’m doing this with a CentOS 6 server.

To force the upgrade I had to do the following:

Power off the phone.
Hold down the # key.
While holding #, connect an AC adaptor to the phone.
Continue to hold # until the line buttons blink amber.
Release the # key.
Enter 3491672850*#

Once you do that the phone is wiped and it reboots in search of new firmware. After obtaining an ip from DHCP (with option 66 pointing it to the tftp server) it will connect to the tftp server and start fetching firmware.

I had a problem where it was fetching the first few files but then generating a nak error on the tftpd server:

Apr 13 10:25:10 pbx in.tftpd[2732]: RRQ from 10.10.10.10 filename term11.default.loads
Apr 13 10:25:10 pbx in.tftpd[2733]: RRQ from 10.10.10.10 filename Jar11sip.8-2-2ES4.sbn
Apr 13 10:25:10 pbx in.tftpd[2733]: sending NAK (1, File not found) to 10.10.10.10
Apr 13 10:25:10 pbx in.tftpd[2734]: RRQ from 10.10.10.10 filename cnu11.8-2-2ES4.sbn
Apr 13 10:25:11 pbx in.tftpd[2734]: tftpd: read(ack): Connection refused

So it requests the first file but then dies on the Jar11sip.8-2-2ES4.sbn. Strange! After looking in the tftp folder I noticed that the file was there as expected. After some head scratching I ran strings against term11.default.loads which tells the phone what firmware files to download.

# strings term11.default.loads
# This file contains a list of archive image files that will be requested by the
# RELEASE load version 8-2-2ES4
#HARDWARE_COMP_1 1
Jar11sip.8-2-2ES4.sbn
cnu11.8-2-2ES4.sbn
apps11.8-2-2ES4.sbn
dsp11.8-2-2ES4.sbn
cvm11sip.8-2-2ES4.sbn
# ls
apps11.8-2-2ES4.sbn
cvm11sip.8-2-2ES4.sbn
jar11sip.8-2-2ES4.sbn
term06.default.loads
cnu11.8-2-2ES4.sbn
dsp11.8-2-2ES4.sbn
SIP11.8-2-2SR3S.loads
term11.default.loads

Ah! Linux is case sensitive so trying to download Jar11sip.8-2-2ES4.sbn isn’t going to work if the file on the server is jar11sip.8-2-2ES4.sbn. A quick rename of the file to Jar11sip.8-2-2ES4.sbn fixed the issue and the phone did it’s firmware update correctly. That seems like a bit of an oversight by the firmware release team at Cisco but maybe their Call Manager software runs a case insensitive tftpd.