Mounting a HTC One on Ubuntu 14.04 Trusty; Re-flashing the ROM

Since I unlocked my HTC One (M7), I do not have a voicemail app since the phone was tied to a specific provider. Now, I'm trying to figure out how to re-flash the device to generic.

The first thing was to try to connect it to my Linux machine. However, upon plugging the phone into the USB port, an error appeared: "Unable to find matching udev device".

Apparently, this is fairly common and happens with other devices. The error boils down to a bug in Ubuntu's default Media Transfer Protocol (MTP) library. The fix is to install a later version.

First, add a new repository:
$ sudo add-apt-repository ppa:webupd8team/unstable
$ sudo apt-get update
Then, install the mtpfs package.

UPDATE: HTC has a free bootloader unlocking utility. You just have to sign up for their free developer program. Then, follow the instructions here: http://www.htcdev.com/bootloader/unlock-instructions

The one thing they do not mention is that you have to have root privileges for the fastboot utility to work, so:
$ sudo ./fastboot oem get_identifier_token
Then, they email you a file for unlocking. Next, re-flash the phone with a vendor-appropriate ROM from here: http://www.htcdev.com/devcenter/downloads

For AT&T (my phone's original ROM) and T-Mobile (my current provider), there is no binary image for flashing. I didn't bother looking to see if you could compile the source. Instead, I went with the Android Ice Cold Project (AICP). I discovered it via this step-by-step article. They also have a download of the full Google Apps.


Another SSL vulnerability - The POODLE Attack

From the Mozilla Security Blog:
SSL version 3.0 is no longer secure. Browsers and websites need to turn off SSLv3 and use more modern security protocols as soon as possible, in order to avoid compromising users’ private information.
Under RHEL 6.5 with Apache httpd, edit /etc/httpd/conf.d/ssl.conf and make sure the protocol line disables both SSLv2 and SSLv3:
SSLProtocol all -SSLv2 -SSLv3
or you can just specify TLS only:
SSLProtocol +TLSv1 +TLSv1.1 +TLSv1.2
 Ars Technica has a good explanation.

Scott Helme has a good run down on how to fix this issue, for various servers and browsers.


Python's with statement

Old habits die hard. I learned a long time ago (Python 1.x) this pattern for opening and operating on files:

        f = open("filename.txt", "ro")
            for l in f:
                print l
    except IOError as e:
        print "I/O error({0}): {1}".format(e.errno, e.strerror)

Since Python 2.6, the with statement does this automatically:

    with open("filename.txt", "ro") as f:
        for l in f:
            print l

The with statement works with some other classes, too.

PS Blogger really needs a code block style.



Word to the wise: do not enable the multiplecpu multicpu module. It doesn't get disabled even if you append ".disabled" to the file name. Now, I have 265 CPU metrics.


Limiting logins under SSSD

Under SSSD, you can pretty easily limit logins to specific users or groups. The syntax is different from that of /etc/security/access.conf, and is actually easier. Red Hat has some documentation (may require login). There is also a man page for sssd.conf(5).

Under the your domain, add some lines to configure "simple" access control:
access_provider = simple 
simple_allow_users = topbanana 
simple_allow_groups = bunchofbananas,wheel


Using the NVIDIA Python plugin for Ganglia monitoring under Bright Cluster Manager

The github repo for Ganglia gmond Python plugins contains a plugin for monitoring NVIDIA GPUs. This presumes that the NVIDIA Deployment Kit, which contains the NVML (management library), is installed via the normal means into the usual places. If you are using Bright Cluster Manager, you would have used Bright's cuda60/tdk to do the installation. That means that the libnvidia-ml.so library is not in one of the standard library directories. To fix it, just modify the /etc/init.d/gmond init script. Near the top, modify the LD_LIBRARY_PATH:
export LD_LIBRARY_PATH=/cm/local/apps/cuda/libs/current/lib64
The modifications to Ganglia Web, however, are out of date. I will make another post once I figure out how to do modify Ganglia Web to display the NVIDIA metrics.

UPDATE: Well, turns out there seems to be no need to modify the Ganglia Web installation. Under the host view, there is a tab for "gpu metrics" which shows 22 available metrics.