Undo that mess: Fixing code formatting

Over at the Harder, Better, Faster, Stronger site, Steven Pigeon wrote this post about cleaning up code formatting.

Diving head first into Emacs again via rebuilding my init.el means a lot of copy-n-paste. I do not agree with everyone else’s coding conventions.

I will stay tuned for the next installment of Steven’s code plus keep an eye on the comments, then copy-n-paste for my own purposes!

Troubleshooting Emacs Org2blog

Go here: When posting I get ‘Lisp error: (wrong-type-argument listp t)’ #216 for the history on this issue.

For fun, here are some Unicode characters: ” ‘ & 🗾 😄

Here is my current slim emacs config to get org2blog working:

(setq load-prefer-newer t)

(package-initialize)
(add-to-list 'package-archives
             '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)
  (package-refresh-contents)
  (unless (package-installed-p 'package+)
    (package-install 'package+))

(add-to-list 'load-path "~/src/org-mode/lisp")
(add-to-list 'load-path "~/src/metaweblog")
(add-to-list 'load-path "~/src/org2blog")
(add-to-list 'load-path "~/src/xml-rpc-el")
(add-to-list 'load-path "~/src/pretty-mode")
(add-to-list 'load-path "~/src/use-package")

(require 'org)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)

(require 'xml-rpc)

(require 'metaweblog)

(require 'org2blog-autoloads)

(require 'auth-source)

(setq
 auth-sources '(
                "~/.authinfo.gpg"
                )
 epa-file-cache-passphrase-for-symmetric-encryption t
 auth-source-debug 'trivia
 )

(setq
 org2blog/wp-blog-alist
 `(
   ("PRJ"
    :url "https://www.prjorgensen.com/xmlrpc.php"
    :username ,(car (auth-source-user-and-password "prjorgensen.com"))
    :password ,(cadr (auth-source-user-and-password "prjorgensen.com"))
    :default-title "Hello, World!"
    :default-categories ("Uncategorized" "org2blog")
    )
   )
 )

(require 'use-package)

(use-package htmlize
             :ensure t)

I created local git clones for xml-rpc-el, org-mode, org2blog, metaweblog, pretty-mode, and use-package.

This is done in order to post a draft of this blog. Then I will publish it.

Wish me good times!

Subcription Victims

Ulysses, the popular macOS and iOS text editor, went to a subscription model. LastPass recently upped their monthly subscription price to $2/month, a 100% increase (among other things). 1Password, TextExpander, and a host of others have done the same.

I’m no fan of the subscription model for software – I think developers overvalue their efforts in many cases. I also understand that the other popular revenue models also suck. Apple does not make this any easier for developers or users.

I do not have an easy answer as I am not a developer. As a user, I am taking responsibility for the cost/value proposition each service (which software is becoming) offers to me. Part of the calculus is how much time and effort and enjoyment (or lack thereof) I will get leveraging another option.

Others take the victim approach to these announcements. In many cases I understand why. There is an increasing trend for revenue model changes happening without notice. Some companies do a poor job on their first stab taking care of existing customers. Others overcompensate for their existing users, alienating new users who think they are getting ripped off because they didn’t buy version 1 back in 2008 (or whenever).

David Sparks made the comment that “What [users] shouldn’t do is trash the app in review because you’re not happy with the business model.” I disagree. A developer’s or company’s behavior is relevant to the app review process as it exists today, especially in the Apple ecosystem. Many application developers act on negative comments in these reviews.

Now, were Apple and Google and Microsoft and other app store overlords to open up the app review process to categories such as technical, ownership, support, etc., my disagreement with Mr. Sparks would fall away. A more nuanced approach to feedback is needed in general. That is another post for another day.

I do agree with the fundamental fallacy of relying on negative app reviews for change. As a user, I recommend applying at least part of your righteous indignant energy toward something more positive for you.

I was in a 7 day cooling off period before jumping on the Ulysses bandwagon when the switch occurred. The initial cost for macOS and iOS before the change was a hurdle. In the new model, I can test it for two months for about $10 (as pointed out by Dr. Drang) before committing.

Fundamentally, anything only in the Apple ecosystem is a hard sell for me. I use and like using Windows 10, flaws and all, on my Surface Pro 4. I use my Nexus 6p running Android N almost as much as my iOS devices. If the application or service cannot run on at least one of those platforms, I have no need for it right now. 1Password and TextExpander are cross-platform, by the way, as are LastPass and iaWriter – two apps I am leaving.

By the way, I am doubling down on Emacs and org-mode. I picked them back up recently to help solve a few work related workflow issues. I get infinitely more flexibility with it and it is cross platform on everything but iOS. I learned I can capture and edit org-mode with Drafts.

And I like using/configuring/tweaking Emacs. Bonus.

En Route to Tokyo Observations, Part II

More musings from my trip:

  • I lost a great post to WordPress web interface requiring a random re-authentication.  I need to reconfigure Emacs org-mode to get it working with the new VPS.
  • There’s a bug in Delta’s InFlight Entertainment (IFE) system I often trigger. I turn the display off during boarding since all it does is flash advertising. The IFE kicks in for the safety video, and then shuts off as it was before departure. Unfortunately, that means the IFE no longer works unless I can talk the cabin crew into a reboot, which I doubt I’d do. I miss the travel map & stats.
  • Speaking of the IFE safety video, Delta’s quality seems to drop with each iteration. This “best of, award show” version is not just bad but a clip show at that.
  • At least Richard Anderson STOPPED YELLING AT US IN HIS MONOTONE SOUTHERN ACCENT. Now a days, Mr. Anderson talks to us at a normal volume & even throws in some inflection. Nice!
  • On a big international flight light mine (MSP – NRT), don’t follow the first cattle call to the gate. Almost always they open up another lane on the other side of the desk. Get there.
  • I hate neck pillows. More specifically, I hate that people have those giant half fuzzy inner-tubes around their necks. Throw in a pair of over-the-ear headphones and eye shades also around the neck and you hit the trifecta!
  • I LOVE Internet over the ocean! Well done, GoGo!
  • There’s a woman sitting behind me who is loving the show she’s watching. I hear her laughing every 5 minutes or so.

Week Ending 30 August 2015 Review

Dear Friends,

I’m working on a new habit – a weekly review. Not only will I review my week but I’ll post it here … in theory, at least.

The goal is to use Emacs org-mode for the day-to-day capture. The week end review will auto-generate. I’ll edit and publish … again, in theory.

Daily log

Monday

Back in the IBM Mexico City Santa Fe offices, working with my project team. Our IBM Security Latin America lead requested the team’s help on another similar project in Mexico. We said yes.

It rained in the evening.

Tuesday

More project work in the office. Our resource manager requested I reallocate time for yet another project, this time in Belgium. I said yes.

It rained in the evening.

Wednesday

Worked from the hotel as the team scattered on other customer’s projects. I booked my reservation in two parts to get the IBM rate for my entire stay. Today is my “check-in; check-out” day. Bonus for the move – Hilton upgraded me. Thanks!

It rained in the evening.

Thursday

Bumped into our IBM Security Latin America lead in the hotel. He requested my attendance at the IBM Security Summit Mexico 2015 here in Mexico City.

I’ve attended more of these types of vendor events than I care to recall. Bearing in mind Ginny Rometty (IBM’s CEO) signs my checks, I’m impressed by the minimal hard sell and generally solid information provided. My takeaway: my Spanish needs improvement toward adequacy quickly.

It might have rained in the evening.

Friday

Back in the office with the team. We solved several issues plaguing our progress. I’m unsure what happened; my afternoon contained one small non-meeting gap. Who books meetings late on a Friday afternoon?

It rained in the evening. I used the ill weather to finish watching True Detective Season 1.

Saturday

After breakfast I set myself up poolside. I applied SPF-50, cracked open a water bottle, and fired up my Kindle. I read.

It rained in the evening.

Sunday

Much like yesterday, except for the inclusion of swimming.

I’m re-reading Edmund Morris’ three volume biography of Theodore Roosevelt. I’ve found myself unfocused, lacking energy, and listless. A bit of “the Strenuous Life” is what I need. That, and another visit to Copenhagen.

I found the problem between my Microsoft Surface Pro 3 and my GeChic 1303H external monitor – the Display Port to HDMI adapter. It functions best with a wicked curve, much like a hockey foreward’s blade.

I emailed the folks and texted with the kids.

Ed Rojas can’t make the podcast tonight. Tim and I will record without him.

It rained in the evening.

UPDATE: as I started editing this my stomach started up. Thus, this post goes up Tuesday.

Books read

Amazon.com: Old Man’s War eBook: John Scalzi: Kindle Store

I follow Whatever | FRAIL MY HEART APART, John Scalzi’s blog. I have for a long time. It’s odd I only now got around to reading one of his books.

It’s trite to say, yet putting this book down required a certain amount of will.

Amazon.com: The Martian: A Novel eBook: Andy Weir: Kindle Store

I cherish engaging hard science fiction. By hard science fiction I mean the story builds upon actual science.

Engaging, funny, emotional (I teared up several times), and an ultimate survivalist tale, I recommend this book without hesitation.

Cat’s Cradle, Kurt Vonnegut – Amazon.com

I kicked off a re-reading of this book while on vacation a fee weeks back. Fun use of language in a satiric test.

Development

Based off of an article I read about Theodore Roosevelt in line with Benjamin Franklin – What Good Shall I Do? | The Art of Manliness I have these six meta items I target each week:

Knowledge (as opposed to raw intelligence)

  • greater understanding of internal IBM processes
  • IBM Security Summit Mexico 2015 provided insights as mentioned above
  • Deeper read of the Ponemon 2015 study

Abilities

  • My Spanish improves, though not as quickly as I’d like.
  • org-mode journal and todo tracking

People skills

  • I don’t know if this is real development: I repeated the same response to “How are you?” to two different people. I made sure to make eye contact with the second person to show it wasn’t mere reflex.

Fitness

  • I swam.
  • I have a plan.
  • My diet consists of mostly vegetables, then protean (dairy, eggs, meat), and fruit.

Appearance

  • Rocking it, as expected.
  • I found hair conditioner makes an excellent shaving cream.

Relationships

  • Stayed in contact with my kids & Stine through the week
  • A friend interviewed exceptionally with IBM
  • Updated my folks via email

Upcoming improvements

  • [ ] Keep up with Social Media more; not too much
  • [ ] More org-mode improvements

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.

Moving from Emacs Org-Mode to Evernote

For those looking for Emacs and Org-Mode tips, I have news. I’ve moved from Org-Mode to Evernote (EN). EN has also taken over for a lot of what I used Emacs for.

I’ll still add tips and tricks as they come to me on my secondary devices where Emacs and Org-Mode still run.