Dell M3800 + NVidia Prime + Ubuntu 16.10

I’ve been slumming it with Intel integrated graphics only on my M3800.  It works fine, and the battery life is good, but knowing I had a graphics card in this machine that wasn’t being used didn’t sit well with me.  Previous attempts to install drivers and switchers led to black screens and frustration.  I saw on reddit today that ‘Prime Indicator Plus’ is a thing.  It worked without a hitch.

I installed Prime Indicator Plus while running on Intel graphics.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install prime-indicator-plus

I logged out and back in I was greeted with a red exclamation icon.  This was because in additional drivers it showed me using the X.Org X server – Nouveau display driver.  I couldn’t switch away from the Intel driver using that.

I changed to use the NVIDIA binary driver – version 367.57 from nvidia-367.  Previously, selecting this driver and logging out led to a black screen.  I tried it again, logged out and back in, and I’m now using the battery draining power of NVidia!  I see the NVidia logo when using the NVidia card, and the Intel logo when using the integrated video.

I added this repo: sudo apt-add-repository ppa:xorg-edgers/ppa.  I’m not sure if I needed to, but I figured I’d note that.  I think the nvidia-367 was there before I added it.

 

Ubuntu 16.10 – Broken Icons

I tried out a bunch of icon packs on Ubuntu 16.10.  Eventually, my terminal icon was a question mark no matter what icon pack I applied.  I realized somewhere along the way, I broke it.  I found a bunch of suggested fixes.  This is the one that worked for me:


sudo apt install --reinstall gnome-icon-theme gnome-icon-theme-extras

Ubuntu Bash is Here!

… And it’s worthless on it’s own…unless you love typing.

To install Ubuntu Bash on Windows, first make sure you have the anniversary update for Windows 10. To check, search for “About your PC”. You should be at Version 1607 or better. If that’s all good, go to “Programs and Features”, click “Turn Windows features on or off”, and check “Windows Subsystems for Linux (Beta)”.

After it does it’s thing, search for “Bash on Ubuntu on Windows”. The first time it pops open it will ask you to install it. Do that. It will require a reboot.

Using Ubuntu Bash in CMDer is a much better experience. To do that, click the arrow next to the green plus sign in CMDer and choose “Setup Tasks”. Create a new task with this information:

cmd /k “C:\Windows\System32\bash.exe” -new_console:d:%USERPROFILE%

It should look something like this:

ubuntubash

You can then choose Bash when you open a new console and enjoy copy/pasting.

JSX + Atom + Emmet

To use Emmet in JSX files in Atom, there’s a bit of a manual step.

Atom v1.5.3
Emmet v2.4.3

To get it to work:

  1. Edit => Open your keymap
  2. Add the below snippet
  3. Restart Atom

'atom-text-editor[data-grammar="source js jsx"]:not([mini])': 'tab': 'emmet:expand-abbreviation-with-tab'

CiviCRM on WPEngine

CiviCRM: 4.7.7
Wordpress: 4.5.2
Host: WPEngine

After a normal and successful install, I ran into an issue where core assets (like jquery) were 404ing because of url paths. The solution ended up being adding this to the top of civicrm.settings.php (found in /wp-content/uploads/civicrm).


<?php
global $civicrm_setting;
$civicrm_setting['Directory Preferences']['customTemplateDir'] = '/nas/content/live/mysite/wp-content/civicrm/templates/';
$civicrm_setting['Directory Preferences']['customPHPPathDir'] = '/nas/content/live/mysite/wp-content/civicrm/php/';
$civicrm_setting['Directory Preferences']['extensionsDir'] = '/nas/content/live/mysite/wp-content/civicrm/extensions/';
$civicrm_setting['URL Preferences']['extensionsURL'] = 'http://mysite.wpengine.com/wp-content/civicrm/extensions/';
$civicrm_setting['URL Preferences']['imageUploadURL'] = 'http://mysite.wpengine.com/wp-content/uploads/civicrm/persist/contribute/';
$civicrm_setting['URL Preferences']['userFrameworkResourceURL'] = 'http://mysite.wpengine.com/wp-content/plugins/civicrm/civicrm/';

The source of this answer can be found here

Slack Notifications on Ubuntu 16.04 LTS

Things have been swimming along nicely after upgrading to 16.04 over the weekend. Arriving back in the office on Monday revealed immediately that slack notifications weren’t working right. They were now an alert box that had to be manually closed rather than the growl-type notifications that they used to be. I made sure my slack client was on the latest version, and it was. Googling around revealed that I wasn’t the only one with this problem, and that it seemed to be an Electron issue.

This is what fixed it for me:

– sudo touch /usr/lib/libunity-electron_notification_fix
– restart slack

Using jQuery DataTables with Aurelia

This is assuming you have an Aurelia project set up and just want to add jQuery DataTables.

First, use jspm to grab datatables.


jspm install datatables=npm:datatables

When that’s done, you can start using it on a table in a view/viewmodel.


import $ from 'jquery';
import dataTable from 'datatables';

export class DataTableViewModel { 
  activate() {
      //bind your data here
  }
  attached() {
      $('.js-table').dataTable( {
        "paginate": true,
        "pageLength": 25
      });
  }
}

There might be a better way to do this, but this works for now. I mostly based this on this excellent post about Toastr and Aurelia

Vaio Pro 13 vs Dell XPS 13 (2014)

Since two ultrabooks are better than one ultrabook, I added a Dell XPS 13 to my toolbox. It is pretty much identical spec-wise with my Vaio, so the real competition is fit and finish. Here’s how they stack up.

2015-02-11 (1)

IMG_20150211_124200

  1. Screen Tilt

    Winner: Tie

    They both stop at the same point.

  2. Keyboard

    Winner: XPS

    Dell easily wins this battle. The key’s have a better feel and more bounce.

    IMG_20150211_124017

  3. Trackpad

    Winner: XPS

    Another easy win for the Dell. The Vaio’s trackpad is in the way more than it’s helpful. The Vaio needs to be planted on a firm, fat surface, for the clicks to even register. The Dell boasts a confident click even when raised off the desk, even though it does grab and hold on to fingerprints like no other.

  4. Battery Life

    Winner: Tie

    I haven’t noticed any difference in battery life. They both can go a long time between charging.

  5. Weight

    Winner: Vaio

    The Vaio is about a pound lighter. It adds nothing to my backpack and is easy to carry to and from meetings. I’m not sure that the Dell’s extra pound would affect this very much, but the Vaio is king of weighing very little.

  6. Ports

    Winner: Vaio

    While they both have two USB ports, I prefer the Vaio’s full size HDMI port. I haven’t adopted display port at all. This is more personal preference. The Dell might have a leg up by having one USB port on each side of the computer. One issue with the Vaio is that when using a larger USB stick, the neighboring port gets blocked. The thing that clinched this battle for the Vaio is the power cable. Having a bend in the connector makes me far less concerned about the health of the cable and the port. The extra charging USB port on the power brick was a stroke of genius on Sony’s part.

    IMG_20150211_124433

  7. Ability to handle linux

    Winner: XPS

    I know the Vaio Pro can handle linux. I’ve heard that Linus Torvalds has one. I just had a bunch of problems with wifi on linux with the Vaio that aren’t present on the XPS.

    2015-02-11 (2)

Conclusion

After several months, the Dell XPS 13 has been my go to development machine. It feels better and is more comfortable. I’d recommend it over the Vaio Pro 13.

Aurelia/JSPM Command failed: ‘unzip’ is not recognized

Presently, Aurelia’s navigation-skeleton isn’t playing nice on windows. When you get the the part where you run

jspm install -y

I was getting the error

Command failed: "unzip" is not recognized as an internal or external command, operable program or batch file.

This makes sense, because windows doesn’t have a command line ‘unzip’ program.

To solve this, I grabbed unzip.exe from here: http://stahlworks.com/dev/index.php?tool=zipunzip. I have a “utils” folder that is in my path that I can toss executables in, so I put it there.

The next error that comes up is is similar.

Command failed: "chmod" is not recognized as an internal or external command, operable program or batch file.

This command isn’t necessary for us, so I created “chmod.sh” in my “utils” folder and added the line

echo "noop"

as a Noop executable. JSPM was then happy.

Sony Vaio Pro 13 + Windows 10

I was early to the party with windows 8 on my Vaio Pro 13. There were a few issues with Visual Studio. I think they were graphic driver issues, if I remember correctly. Windows 10 Preview was a lot smoother. There were far fewer issues, and the big ones were just waiting on proprietary drivers. The only functionality I lost that I missed was Cisco VPN, but it’s probably been resolved by now. Visual Studio 2015 installs nicely and gave me no issues.

I am now running Ubuntu 14.10. My plan is to get a bigger SSD and dual boot Windows 10 and Ubuntu.