Tech tidy

I purged “stuff” (technical term) at home over the December holiday break: clothes; books; kitchen gear; papers; kids (well, one went back to college).

I avoided my trouble spot until there was a critical mass of positive momentum … my tech.

When I finally tackled it, most went easy. Nine mini USB cables when I need two? Sorted. 40gb ATA hard drives? Destroyed. Several sub 1A wall warts? Purged.

Gizmos, be they five-year old laptops or unused-for-years old phones or tablets collecting a real layer of dust, they posed more angst. “But I could do x with it,” I would tell myself.

Starting a new tech job means I will get new tech. So I’m purging my old kit. I’m down to my Google nexus 5 phone and my kindle and an external battery pack. Flying from Detroit to San José without my usual tools proved more of a challenge than I wanted to acknowledge.

I WANT a real keyboard. I WANT a decent screen size. I WANT ample storage. I WANT good battery life.

By ‘want’ I, of course, mean NEED.

If I had my pick now I would probably go with a Microsoft Surface Pro 3 (dual-boot with ubuntu) and a Samsung Galaxy Note 4.

UPDATE: My new work laptop is a ThinkPad T430. My cell phone will only be useful for phone calls and light email duty.

Also on:

Verizon Wireless/Sierra Wireless MC7750 on Lenovo T430s with Ubuntu 12.0.4.1

The Lenovo T430s I have for work comes with a Verizon Wireless 4G card built-in. It took weeks to get it working on Windows 7. Turned out that I had a bad SIM card.

Once I was able to get it to work in Windows, it was time to get it working in Ubuntu.

The USB ID for the MC7750 is 114F:68A2. It is also listed in Windows as “Gobi 4000 HS-USB Modem”.

Ubuntu didn’t recognize the 4G modem out of the box. I found a driver here. Here is more information. This modem wasn’t in there, but I went ahead and modified the source to add in the USB ID. Here are my diffs:

sierra.patch and sierra_net.patch

Save these to the folder where you downloaded the driver. Then

tar xvf v3.2_1740_kernel-3.0.directIP.tar
cd v3.2_1740_kernel-3.0.directIP
patch  -p0 < ../sierra.patch
patch -p0 < ../sierra_net.patch
make
sudo make install

and then reboot.

Success! Or sort of. It showed up as registered on Verizon. I could see the signal strength. Finding the right settings for NetworkManager is the next step.

There are three options for the number:

#777
*99#
*99***3#
*99***4#

The username should be the [email protected] and the password is vzw.

I’m still working on this. It isn’t dialing, but I’m having a hard time finding the right combination.

Ubuntu 12.04 Hybrid Suspend on Lenovo T430s

I hadn’t heard about hybrid suspend until reading this article at WebUPD8.org. I’d used the standard sleep mode most of the time. I enabled hibernate on my laptop as I mentioned here.

This hybrid sleep is pretty great. I put the laptop to sleep normally, either by command or closing the lid while unplugged from power. After 15 minutes by default the laptop will go into hibernation, saving battery power.

Some comments on the original post have mentioned there could be a risk if you have a traditional hard drive versus SSD. This could indeed cause an issue if your laptop is moving (in a bad, under an arm, etc.) while it transitions into hibernation mode. Use at your own risk.

Also, you must have a swap partition of sufficient size. If you followed the default at install you’re probably safe. If you opted for no swap (a mistake in my opinion) this will not work.

Here are the steps, paraphrased from WebUPD8.org:

From the CLI, execute:

sudo pm-is-supported --suspend-hybrid && echo "hybrid suspend is supported" || echo "your system doesn't support hybrid suspend"

Depending on how the command returns you can proceed.

You need to create a file as root called

/etc/pm/config.d/00-use-suspend-hybrid

Here’s what you need to put in it:

# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
METHOD=suspend_hybrid
fi
# time in seconds until hibernate (suspend to disk) occurs; 900 means 15 minutes
# Edit this value to your preferred delay
PM_HIBERNATE_DELAY=900

And that’s it! If your laptop doesn’t support hibernation at all this will not work.

Some folks in the comments thread mentioned a risk of overheating, but I’m skeptical that there is any real concern there.

Let me know how it goes for you!

Hibernation & Multi-head Display w/ Ubuntu 12.04 on Lenovo T430s

The steps for a multi-head display I laid out do, in fact, work. I have run two external DisplayPort displays plus the laptop’s built-in display in Ubuntu 12.04. This worked okay in Unity, not so well in KDE (the Display app, while powerful, can’t do simple things easily), and nearly flawlessly in Gnome.

Multi-head display doesn’t work all of the time, however. Black displays, where the screen is lit black and the monitor is detected but nothing shows, happens. There’s no reconfiguration short of a power off that fixes this.

That’s where hibernation seems to come in.

UPDATE: I have a better way to test for and enable hibernation.

In a cli, execute:

sudo pm-is-supported --hibernate && echo "hibernation is supported" || echo "your system doesn't support hibernation"

If it says “hibernation is supported” you can proceed.

As root using your favorite editor edit the following file:

/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Add the following to the file:

[Enable Hibernate]
 Identity=unix-user:*
 Action=org.freedesktop.upower.hibernate
 ResultActive=yes

Save the file. Log out and log back in again. Hibernate should now be an option in your system menu.

For more information and context read the steps from the How-To Geek on Re-Enabling Hibernate in Ubuntu 12.04 (which I borrowed from).

If you can enable hibernate, do so.

This recipe has worked for me at work several times without me having to lose work.

Note that I have two older Acer brand displays at home that don’t seem to play nice with any configuration. If you possess similar kit you may encounter the same hurdles.

Let me know if this works for you, or if you have a better approach like my post on enabling hybrid suspend here.

Ubuntu 12.04.1 Power Tweaks on a ThinkPad T430s

I configured power saving in two files.

/etc/rc.local

My /etc/rc.local looks like the following:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# runtime power management
for i in `find /sys/devices/*/power/control`; do echo auto > $i; done;
for i in `find /sys/bus/pci/devices/*/power/control`; do echo auto > $i; done;
# usb autosuspend
for i in `find /sys/bus/usb/devices/*/power/level`; do echo auto > $i; done;
for i in `find /sys/bus/usb/devices/*/power/autosuspend`; do echo 2 > $i; done;
exit 0

This takes care of several settings PowerTop refers to. I want these applied in all cases. Most of these are set by default, but I include these here to make certain.

/etc/pm/power.d/powertop

I created a new file /etc/pm/power.d/powertop with the following:

# Power saving tunables
 #
 # The true case will trigger when on battery, false when on AC power
case $1 in
 true)
 # nmi watchdog off
 echo 0 > /proc/sys/kernel/nmi_watchdog
 # vm writeback
 echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
 # dim screen brightness on battery
 echo 0 > /sys/bus/pci/devices/0000:00:02.0/backlight/acpi_video0/brightness
 ;;
 false)
 #nmi watchdog on
 echo 1 > /proc/sys/kernel/nmi_watchdog
 # vm writeback
 echo 500 > /proc/sys/vm/dirty_writeback_centisecs
 # brighten screen brightness on AC
 echo 10 > /sys/bus/pci/devices/0000:00:02.0/backlight/acpi_video0/brightness
 ;;
 esac
exit 0

Do a ‘chmod 755’ on the file. This will tweak some settings when on battery. It reverts to the default when on AC power.

Ubuntu 12.04.1 Unity 3D with NVIDIA Optimus on T430s

Adding on to my display issues in my earlier post, I’ve reinstalled Ubuntu 12.04.1 and 12.10 many times – somewhere between one and three dozen times.

First, I followed all of Jim’s steps from the T530.

Second, I allowed that ppa:ubuntu-x-swat/x-updates repository to update my other drivers including the xserver-xorg-intel driver. Note that ia32-libs was not installed when I installed this. On one of my previous iterations I installed ia32-libs before I did the driver stuff. Ubuntu-x-swat installed a number of additional i386 packages which may have messed up things.

Third, I followed the Bumblebee instructions.

I will need to remember to ppa-purge both repositories before upgrading to 12.04.2. I hope most of this will roll into that release.

Other Notes and Random Thoughts

From time to time lightdm, the login display manager, won’t start. I do a …

sudo service lightdm restart

… from the command line to have it restart. That works fine.

Moving icons on the side dock thing only works properly on the main display. In my case it’s the laptop’s display.

Three displays – two DisplayPort and the built-in – does not work yet.

I’ve tweaked my power settings. Here’s what my /etc/default/grub looks like:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet nox2apic splash i915.i915_enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1 drm.vblankoffdelay=1″

Most of the grub settings I took from Ubuntu Wiki’s Power Saving Tweaks.

Ubuntu on ThinkPad T430s (and W530)

About half of my team including me received refreshed laptops a few weeks ago. We made the push for Apple MacBooks again. Like the last time we have new Lenovo ThinkPads.

The team ordered Core i7 T430s ThinkPads while one team member, Jim, ordered the Core i7 W530. In retrospect I should have gone with the X230, but I’m stuck with what I got. I pulled the factory hard drive for a super fast SSD prior to powering up for the first time. I also maxed out the RAM with 16GB. My initial Windows 7 install was lackluster. Jim went straight to Ubuntu 12.04. He struggled with it a bit. Oddly it was roughly as much as I was struggling with Windows 7.

I decided to follow him down the Ubuntu 12.04 64-bit path. Here I’ll try to document what we’re doing on these two platforms. If this is useful to you and/or you have changes to submit, please comment here.

First off, a lot of things worked out of the box: wired network, wireless network, camera, sound, microphone, bluetooth, keyboard backlight, keyboard light, sleep, power management, screen brightness, driving two displays, touchpad, usb3.

UPDATED: Hibernation works. Hybrid sleep, too!

Things known not to work yet: fingerprint reader, Ricoh MMC/SD reader, 3G/4G activation (doesn’t work on Windows, either)

Not yet tested: smartcard reader, thunderbolt, 3G/4G, hibernation (I read it’s broken)

Jim and I have the advantage of our old laptops. They still work so we can experiment a bit without it impacting our ability to work.

BIOS

We did a few BIOS changes.

Under Config, Network make sure that Wake on LAN is disabled.

Under Config, Display make sure the Graphics Device is “Integrated Graphics” unless you plan on a three headed display.

Under Config, Power enable “Power On with AC Attach”

Under Security, Virtualization make sure both options are enabled.

Ubuntu Install

The installer errored when I asked it to encrypt my home folder during install.

If you have an Internet connection go ahead and have it install updates during install. You’ll still want to check for updates after you reboot to complete the install.

Work Apps: Juniper NSM

We use Network Security-Manager and NetScreen Security Manager (NSM) to manage Juniper devices. They require the ia32-libs metapackage to run. Well, they don’t need all of them but I’m not identifying each and every library manually.

After installing ia32-libs, do the following:

sudo ln -s /lib/x86_64-linux-gnu/libc-2.15.so /lib/libc.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libXp.so.6.2.0 /usr/lib/libXp.so.6

Work Apps: IBM Lotus Notes

While installing Notes in Ubuntu is an option, I decided to install it in a Windows VM guest. You’ll need the ia32-libs if you chose to run Notes in Ubuntu.

Work Apps: Juniper SA & Network Connect

We also use the Juniper SA for remote access, so we need Network Connect. I followed the instructions here to get Juniper SA Network Connect working. I used the OpenJDK 7 JRE and icedtea 7 plugin for the browser.

UPDATE: I also installed …

sudo apt-get install zlib1g:1386

Work Apps: VMWare Workstation

We’re both evaluating VMWare Workstation for the few apps we need a real Windows instance for. Version 9 installed perfectly. Windows 7 and 8 both install just fine. Unity, the VMWare mechanism for making a guest app look like a host app, works well.

However, in Windows 8 the Windows/super key is indispensable. Ubuntu Unity wants to pop-up and overlay with keyboard shortcuts, obscuring the stuff behind it. If you have the CompizConfig Settings Manager (CCSM, not recommended by Ubuntu), select Ubuntu Unity Plugin, go to the “Experimental” tab and disable “Enable Shortcut Hints Overlay”.

UPDATE: I had to add myself to the floppy group to get at my CDROM drive. For some reason Ubuntu mounts it as /media/floppy0.

Power

I travel for work. If I carry this unfortunately heavier-than-my-last laptop I want to maximize the battery life when detached. I want strong performance when I’m powered.

In the Power settings under “On Battery Power” I suspend when inactive for 10 minutes, power off when power is critically low, and suspend when the lid is closed. When plugged in, I don’t suspend when inactive and do nothing when the lid is closed.

I install powertop, thinkfan, thinkpad-acpi-dkms, and ethtool. Note that powertop gives you the best information when you’re on battery.

From the Ubuntu Wiki:

Enable ALPM:

echo SATA_ALPM_ENABLE=true | sudo tee -a /etc/pm/config.d/sata_alpm

I installed thinkfan for improved cooling with some help from here:

echo options thinkpad_acpi fan_control=1 | sudo tee -a /etc/modprobe.d/thinkfan.conf

UPDATE: I’m now using thinkpad-acpi-dkms as thinkfan doesn’t seem to work any more. More information here.

I disabled Wake-on-LAN on my ethernet interfaces: go here and scroll down to “For Ubuntu 12.04 (and up) users …” and step 5.

UPDATE: The post is a little confusing and non-linear, so do the following:

sudo cp /usr/lib/pm-utils/power.d/disable_wol /etc/pm/power.d
vi /etc/pm/power.d/disable_wol

… and change line 14 to look like …

enable) ethtool -s "${d##*/}" wol d>/dev/null 2>&1;;

I remounted my root partition to turn off atime tracking:

sudo vi /etc/fstab

and add ‘noatime’ to make your root entry look like …

UUID=4ba02cd9-d3c4-4dd1-9a30-6535fcba5290 /               ext4    noatime,errors=remount-ro 0       1

Display

Jim’s W530

Jim dove into driving two external displays and the built-in display with an extended desktop. He did a number of steps on his W530 from here.

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current
sudo gedit /etc/default/grub

… and on the line with “quiet splash” add “nox2apic” after “quiet”. Then do a …

sudo update-grub

… and then reboot.

UPDATE: Enter the BIOS. Enable “Discrete Graphics” or “NVidia Optimus”. Jim has to log in twice to his desktop, which is odd.

Paul’s T430s

I am trying to get the T430s to drive the displays without making the GRUB changes. I know from the Windows 7 experience on this laptop that you have to use DisplayPort for both of the external displays to drive all three. When I did this with my initial install, I could run three displays. However, the would all blank out then restore every 30 seconds or so.

Digging around a bit I found an article that discussed the Intel 4000 graphics chipset. The recommendation is to upgrade the kernel to the version in 12.10. I decided to go straight to 12.10. Unfortunately my work on getting some of my security tools installed made the upgrade not work as it should have. I decided to reinstall fresh and immediately upgrade to 12.10.

I noticed an immediate improvement after rebooting. The login screens for the two displays I had connected – an external and the built-in display – ran the correct (or close to) resolution for both. I made the usual post-install display adjustments to turn off mirroring and drive the external display at it’s native resolution.

Bolstered by the good look I decided to plug my second external display into the other DisplayPort. The mouse remained on the first two displays but they were blank otherwise. I switched to a terminal (Ctrl-Alt-F1) to do a ‘sudo unity –reset’ which unfortunately did nothing. The option is depreciated. However, the terminal did display on all three monitors. I rebooted, and all three displays showed the login screen. I logged in, and all three had the desktop in mirror mode.

I turned off “Mirror Displays” and they all show. When I tweak the external displays’ resolution I find I can’t quite drive them at their recommended resolution – 1680×1050 for one and 1920×1080 for the other. Even redoing the displays at a lower resolution while maintaining the aspect ratio didn’t help. I replaced the larger display with one that matches the other one.

After more experimentation I found that one of the DisplayPort to DVI cables is bad. I’ll have to test this out in the office on Monday.

UPDATE 25 Oct 12: I followed Jim’s steps above on 12.04 and it worked! For a while it worked, that is, and without the change to grub. I undocked the laptop and re-docked but the displays wouldn’t restore properly. Then they would black out. No amount of rebooting or powering off would bring it back.

UPDATE 31 OCT 12: I made changes to grub detailed here. These changes stabilized things.

Miscellaneous

Emacs

I’m an Emacs fan, especially of version 24. Follow the instructions here. Unfortunately Emacs 24 isn’t available by default.

Firefox

Of course I followed my own advice and set up my Widescreen Firefox. One note is that under Ubuntu with the default Ubuntu add-ons installed you do not need the “Hide Forward/Back Buttons When not Needed“ Stylish script.

I keep looking for a way to make the Alt Text in Firefox, where you mouse over a link in a web page and the full URL is displayed above the status bar at the bottom of the Firefox window, much lighter than it is by default. Out of the box it is black text on a dark gray background. If anyone has a solution, please share.

Other

I’m a big EverNote user. They do not have a Linux client yet, so I wanted to use NixNote. However, it required 32-bit Java. I’m trying EverPad instead.

To keep Ubuntu from popping up a window to upgrade,

gconftool-2 --set --type bool /apps/update-notifier/auto_launch false

I also use aptitude, synergy, and a bunch of other tools. I write about them from time to time.

Six Weeks of MacBook Air use in a Wintel Corporate World

My trusty ThinkPad X301 running Windows 7 Enterprise was dying. It wouldn’t shut down. It had a hard time starting up. It might Blue Screen of Death (BSoD) while reading email or editing documents. It might decide to not charge either of the two batteries in the case. It might forget that it has a wifi and bluetooth adaptor.

I handed it off to the appropriate internal technical support team. Unfortunately the loaner laptops were all in use. I had three options.

  1. Use my own laptop until my work laptop was fixed
  2. Demand a new laptop without knowing if my current laptop is fixable
  3. Go without a laptop until mine is fixed

Option 3 doesn’t work. I travel too much to go without a laptop. Mobile devices are a gray area, but I shudder to think about editing my budget spreadsheets in an iPad.

Option 2 is within the realm of possibility, but I don’t know what I would take to replace my X301. It doesn’t have the biggest RAM footprint or a current CPU or even competitive graphics. It does have a good display and good battery life and it is light. I’m not due for another laptop until 2013. The longer I can wait the better the hardware will be.

Option 1 is workable. There is only one problem: my laptop is an Apple MacBook Air (late 2011).

My European colleagues can use Apple products. My Asia Pacific colleagues can as well. In the Americas it is a different story. I’ve written about this before.

Nevertheless, things came to a head. I could adhere to the unwritten policy or I could keep working. I chose the latter.

So far the only folks that even care are those in my organisation that would like an Apple option and our VP. I hung a sign on my laptop while using it that told folks: “Don’t Get Your Hopes Up: This is Temporary” for the VP’s benefit. She laughed but also asked how it was working for me.

I told her it’s working well.

The thing is, it’s actually working better than I expected. Here’s why and how.

First, I have a corporate copy of Windows 7 x64 Enterprise running in a Parallels 7 Desktop session. It is on the Active Directory (AD) domain. All of my business applications, even those I could run in OS X, run in the VM. I use Coherence mode to better integrate the Windows apps. It works really well for me.

For the network I carry a USB to 100MB Ethernet adaptor. I assign it to the VM only and use guest wireless access for the MBA. If physical ethernet isn’t available I will fire up a VPN from the VM guest to get it on-line. I can use a USB wireless adaptor as well if I want.

As my team manages the VPN environment, it is a good idea for me to drink our own champagne (as it were). As the head of IT security, the separation of work from personal in a functional way is a powerful example.

I expanded my environment with an Ubuntu guest VM for some GNU and F/OSS tools not available for native Windows for work. I added some of the tools in the MBA via MacPorts just in case.

The other stuff? Being on the domain means links I open in the email client open in IE 9. I can view and edit MS Visio and Project files that can’t be opened in OS X without expensive third-party software using software licenses already assigned to me. I can be permissive and allow opening of files in either environment. I can be restrictive and allow opening files only in one environment.

From the user experience angle, after logging into the VM guest I don’t think much about it. It works really well.