Installing Electron under Ubuntu – “node: not found”

I was trying to install Electron on Ubuntu using this command:

npm install electron-prebuilt -g

It would run for awhile, then fail with this error:

sh: 1: node: not found

Several online sources said to install “node-legacy”, but this never worked:

sudo apt-get install node-legacy
Reading package lists… Done
Building dependency tree Reading state information… Done
E: Unable to locate package node-legacy

Searching the apt cache revealed something:

sudo apt-cache search legacy | grep node
node-dompurify – XSS sanitizer for HTML, MathML and SVG – Node.js module
node-es5-shim – ECMAScript 5 compat. shims for old JavaScript engines (Node.js)
node-es6-shim – ECMAScript 6 compat. shims for legacy JavaScript engines (Node.js)
nodejs-legacy – evented I/O for V8 javascript (legacy symlink)

The package is nodejs-legacy, not node-legacy! Installing nodejs-legacy solved the problem, and Electron installed cleanly after that.

sudo apt-get install nodejs-legacy

Posted in Electron, Technology | Leave a comment

Removing Open VM Tools and VirtualBox Components from Lubuntu (Linux) Guest

After moving a Lubuntu virtual machine from VirtualBox to VMware Workstation and installing VMware Tools, I needed to clean out an old installation of Open-VM-Tools (OVT) and VirtualBox Guest Additions. Here are the steps I followed:

List installed dkms packages:

dkms status

Remove open-vm-tools and vboxguest that were listed by the previous command (note that you’ll need to provide the corresponding version numbers):

sudo dkms remove open-vm-tools/9.10.2 --all
sudo dkms remove vboxguest/5.0.2 --all

List openbox related tools (note that this will list anything with ‘open’ in the title, you only want open-vm related items):

dpkg --get-selections | grep -v deinstall | grep -i open

Remove open-vm-tools:

sudo apt-get remove open-vm-tools-dkms
Posted in Linux, Technology | Leave a comment

Fixing Broken VMware Shared Folders in Kubuntu/Ubuntu (f_dentry and d_alias errors)

I recently installed Kubuntu 14.04 LTS (3.19.0-25) 64-bit in a VMware virtual machine. After doing an apt- get upgrade, Shared Folders stopped working. When attempting to build and install VMware Tools, I saw compilation errors relating to f_dentry and d_alias.

I fixed this using rasa’s VMware Tools patcher. It’s a slick tool that automatically applies appropriate patches to the VMware Tools distribution.

Before using the script, I selected Install VMware Tools from the VMware menu. For whatever reason, the VM used /media/username/VMware Tools/, and only after I selected “Open with File Manager” from the Kubuntu popup.

The exact commands I used on a fresh install were:

cd ~
tar xvzf /media/username/VMware\ Tools\VMwareTools-9.6.5-2700074.tar-gz

sudo apt-get install git
git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches
mv ../vmware-tools-distrib .
./patch.sh

cd vmware-tools-distrib
sudo ./vmware-install.pl --default

Looking back at the rasa code repository, it looks like I didn’t need to do all those steps. Instead, this should work on a clean install:

cd ~
sudo apt-get install git
git clone https://github.com/rasa/vmware-tools-patches.git
cd vmware-tools-patches
./patched-open-vm-tools.sh
Posted in Linux, Technology, Uncategorized | Leave a comment

Convert FLAC to MP3 on Linux

This is the script I use to convert FLAC files to MP3. After converting, it moves all the FLAC files into a subdirectory named .flac:

#!/bin/bash

#------------------------------------------------------------------------------
# Converts all FLAC files in the current folder to high-quality VBR MP3s.
# Moves all .flac files into a folder named .flac.
#------------------------------------------------------------------------------

for f in *.flac; do  
    ffmpeg -i "$f" -qscale:a 0 "${f[@]/%flac/mp3}"
done

mkdir .flac
mv *.flac .flac/

echo Done.

This script requires ffmpeg. Install using:

sudo apt-get install ffmpeg

 

Posted in Linux, Technology | Leave a comment

Windows 10 Bug: ‘System Sounds’ Volume Gets Loud on UAC and Notifications

Problem

Running the retail/release version of Windows 10, every time I got a UAC prompt or ‘toast’ notification, the notification sound would be at full volume. I’d go into the Volume Mixer, run it down to around 5%, and sure enough, the next notification ding would be ear-piercing again.

I’ve found one other person reporting the same bug on a pre-release version.

Workaround

I’ve found that leaving the Volume Mixer window open prevents the issue from occurring. Then again, after a few test cycles, I stopped getting ANY System Sounds at all…

Other Details

I use a Creative USB Sound Blaster HD and have all other audio output devices disabled. I don’t know if this affects the issue.

Posted in Technology, Windows | 1 Comment

How to Remap Windows Key on Kinesis Classic Keyboard

My Kinesis Classic doesn’t have a Windows key (well, technically it does, but it’s embedded in the ‘keypad’ map Print Screen). I like to remap the Insert key to the Windows key. Here’s how to do it:

  1. Press the Keypad key
  2. Press Program + F12
  3. Press Print Screen
  4. Press the Keypad key
  5. Press the Insert key
  6. Press Program + F12

If you omit step 4, then the Insert key will only be mapped to the Windows key when they Keypad map is active (where “Keypad map” means the alternative keymap that becomes active when you hit ‘Keypad’. By default it turns the right half of the keyboard into a numeric keypad).

Posted in Technology, Windows | Leave a comment

Closing One-Off Tags in HTML5?

I wasn’t sure whether I needed to close my meta tags in HTML5. And br tags, for that matter. People call them one-off tags, unpaired tags, self-closing, monotags, bachelor tags, among others.

They’re called void elements.

According to W3C, the void elements are: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr.

Under “8.1.2 Elements”:

Void elements can’t have any contents (since there’s no end tag, no content can be put between the start tag and the end tag).

Under “8.1.2.1 Start tags” it says:

Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single “/” (U+002F) character. This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.

So, “/>” has no effect on a meta tag. Or any other void element. But it is not invalid to put it there.

Posted in Technology | Leave a comment

WTF is a “Desktop Device App”

Apparently you now have to run the Windows App Certification Kit (WACK) on the software executables you publish in order to avoid a moderately scary warning from Windows SmartScreen.

Upon running WACK, you’re presented with four options:

WindowsAppCertificationKit_StartScreen_DesktopAppDeviceHighlighted

  • Validate Windows Store App

  • Validate Windows Phone App

  • Validate Desktop App

  • Validate Desktop Device App

All of them seem pretty self-explanatory, except for the last one, “Validate Desktop Device App”. It’s described as “Test a desktop device app for compliance with value-added software requirements”. Huh?

Searching Microsoft and MSDN for the phrase “value-added software requirements” turns up zero results. Searching for just “value-added software” (isn’t all software value-added?) led me to this post on Raymond Chen’s The Old New Thing blog which indicates that “value-added software” is the crapware/shovelware that’s pre-installed on computers bought at, say, Best Buy.

I really wish Microsoft would focus less on consistent branding and more on actually explaining things. Incidentally, I gagged a little bit when I read the phrase “Validate Desktop App“.

Posted in Technology, Windows | Leave a comment

Minimal Steps to Fake Authenticode Signature (Self-Signing)

Here are the minimum steps required to self-sign an executable for development and testing:

makecert -sv mykey.pvk -n "CN=MyCompany" -len 2048 mycert.cer -r
pvk2pfx -pvk mykey.pvk -spc mycert.cer -pfx mycert.pfx -po mypassword

Note: You’ll be prompted to create a certificate password and it must match whatever you supply to pvk2pfx with the -po switch.

To sign an executable, use:

signtool sign /f mycert.pfx /t http://timestamp.comodoca.com/authenticode /v executable.exe

Note: once you have a real code signing certificate, you’ll use whatever timestamp server your provider gives you. Comodo works fine for self-signing testing purposes.

To automatically sign a binary at build-time in Visual Studio, add go to your Project Settings | Build Events | Post-Build Event, and add something like this to the Command Line setting:

signtool sign /f MyCertificatePath\mycert.pfx /p mypassword /t http://timestamp.comodoca.com/authenticode /v $(TargetPath)

Explanation of makecert command:

-sv Specifies the private key file.

-n Specifies the certificate name.

-len Generated key length, in bits. This StackOverflow answer indicates that Microsoft released an update blocking certificates with keys under 1024 bits long.

-r Specifies self-signed, i.e. not a root certificate.

Posted in Technology, Windows | Leave a comment

Enabling uiAccess in Visual Studio C++ Projects

After spending too much time fiddling with my project’s Manifest Tool settings, trying to import an “Additional Manifest File”, I realized the solution was actually really simple. Under Project Settings | Linker | Manifest File, there is a simple dropdown for “UAC Bypass UI Protection” which sets uiAccess to true.

VisualStudio_PropertyPages_Linker_ManifestFile_uiAccess

Posted in C++, Technology, Windows | Leave a comment