Marble: A cross-platform, multi-purpose Virtual Globe

Marble is a Virtual Globe app that started as part of the KDE desktop environment that is now currently available for Linux (all flavors), Mac OS X, Windows, and Android. It has tons of features and definitely worth checking out for map and geography lovers out there!

Below we view the globe using a historical map from 1689 centered around North America. Interestly, California is depicted as an island, and the Pacific Northwest region of the United States and Canada, as well as Alaska and eastern Russia, is a big void in the map (not depicted).
Marble Virtual Globe Screenshot - Historical North America Map 1689

Pulseaudio forwarding over NoMachine with Arch Linux Host

I have been unsuccessful in finding a permanent working solution for audio forwarding over NoMachine using an Arch Linux host. I had raised issues on both the Arch Linux Forums as well as the NoMachine Forums. A trouble report was created to track this issue.

I have found a temporary workaround which results in pulseaudio being successfully forwarded over NX, but it must be applied each time a NoMachine connection is established. It requires logging in as the superuser to be able to search through some NoMachine logins which are not viewable as the default user:

 ➜  su - 
Password: 
➜  
➜  cd /usr/NX/var/log
➜  grep -r -n 'native.socket' . 


./nxserver.log:1179:2016-08-18 11:40:53 805.980 14969 NXNODE   WARNING! Could not load module native with name: /usr/NX/var/run/nxdevice/D-1001-CCDE160BF6050EDC229A1FDD4CB7FD12/audio/native.socket.

You should see a bunch of entries similar to the one above. The expected audio module at the specified location does not exist, but you can quickly create a symlink at that location pointing to /run/user/1000/pulse/native assuming your default uid is 1000 using a command such as the follows:

ln -s /usr/NX/var/run/nxdevice/D-1001-CCDE160BF6050EDC229A1FDD4CB7FD12/audio/native.socket /run/user/1000/pulse/native

Check that your audio output isn’t muted or at low volume, and you should now be able to hear audio forwarded from the guest machine.

If anyone knows of a permanent solution, please share.

axel – accelerate your command-line downloads

axel is a command-line utility, similar to curl and wget. In fact, axel can be substituted for wget for the most part, sans the additional options it provides (and vice-versa).

It can be installed on OS X through homebrew.

brew install axel

An anecdotal example seen in the screenshots below. axel downloads a 11.38 GB file at a rate of 56.46 MB/sec, compared to 27.3 MB/sec with wget. Of course, depending on numerous different factors, there may be little difference between the comparative download speeds, or even the opposite pattern.

axel download rate example

wget download rate example

It certainly does not hurt to have both tools in your toolkit! See also details of package axel on debian.org.

Bypass Version Check for Mozilla Firefox and Thunderbird Extensions (.xpi)

  1. Firstly, proceed with the following instructions at your own risk. I assume no responsibility for lost data or broken using experiences as a result of this workaround. In general, it is unlikely that any irrevisible changes will happen as a result of importing an extension that has not been tested for your installed version of Firefox/Thunderbird, as you will most likely be able to just uninstall it if it does not work as desired.
  2. Download the *.xpi file using a browser other than Firefox. This seemed to be the only way that I was able to actually “Download Anyway” an extension.
  3. Using an archive manager, open the downloaded *.xpi file. I used Engrampa which is part of the MATE desktop, but that by no means is exclusive. Inside this archive, you’ll want to modify a file named install.rdf:
    <?xml version="1.0"?>
    <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:em="http://www.mozilla.org/2004/em-rdf#">
    
    <Description about="urn:mozilla:install-manifest">
    <em:type>4</em:type>
    <em:id>{77d2ed30-4cd2-11e0-b8af-0800200c9a66}</em:id>
    <em:version>14.0</em:version>
    
    <!-- Target Application this extension can install into,
    with minimum and maximum supported versions. -->
    
    <em:targetApplication>
    <Description>
    <!-- Firefox's UUID // DO NOT CHANGE-->
    <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
    <!-- End Firefox's UUID // -->
    <em:minVersion>44.0a1</em:minVersion>
    <em:maxVersion>45.*</em:maxVersion>
    </Description>
    </em:targetApplication>
    <em:unpack>true</em:unpack>
    
    <!-- Front End MetaData -->
    <!-- My_Theme -->
    <em:name>FT DeepDark</em:name>
    <em:description>Smooth dark theme for Firefox</em:description>
    <em:creator>Stefano</em:creator>
    <em:contributor>Stefano</em:contributor>
    <em:homepageURL>http://www.stefrosselli.com</em:homepageURL>
    
    <em:internalName>ftdeepdark</em:internalName>
    </Description>
    
    </RDF>
    

    Bump up the version of em:maxVersion to be inclusive of the version of Firefox/Thunderbird you are using, save the file and update the archive with the updated version of that file, and now manually import the extension as a file.

    In many cases, such as themes, this has worked for me well with the Nightly channels of Firefox and Thunderbird (50.0a). Below is a screenshot of the elementary Thunderbird theme installed successfully on Daily (50.0a).

elementary Thunderbird theme on Daily

JetBrains IDEs — Increasing Initial and Maximum Java Heap Space

By default, JetBrains products (IntelliJ, WebStorm, etc) products default to a very small minimum (128 MB) and maximum (750 MB) Java Heap Space:

➜  ps aux | grep -i webstorm 
..
nick     22103  383  2.7 6838044 901056 .. /usr/lib/jvm/default/bin/java -agentlib:yjpagent-linux64=disablealloc,delay=10000,sessionname=WebStorm2016.2 -Xbootclasspath/a:/opt/webstorm-eap/bin/../lib/boot.jar -classpath /opt/webstorm-eap/bin/../lib/bootstrap.jar:/opt/webstorm-eap/bin/../lib/extensions.jar:/opt/webstorm-eap/bin/../lib/util.jar:/opt/webstorm-eap/bin/../lib/jdom.jar:/opt/webstorm-eap/bin/../lib/log4j.jar:/opt/webstorm-eap/bin/../lib/trove4j.jar:/opt/webstorm-eap/bin/../lib/jna.jar -Xms128m -Xmx750m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -XX:MaxJavaStackTraceDepth=-1 -Dawt.useSystemAAFontSettings=lcd -Djb.vmOptionsFile=/opt/webstorm-eap/bin/webstorm64.vmoptions -XX:ErrorFile=/home/nick/java_error_in_WEBIDE_%p.log -XX:HeapDumpPath=/home/nick/java_error_in_WEBIDE.hprof -Djb.restart.code=88 -Didea.paths.selector=WebStorm2016.2 -Didea.platform.prefix=WebStorm com.intellij.idea.Main
..

Depending on the amount of memory (RAM) available on one’s machine, it may be desirable to bump up these values by simply modifying the appropriate *vmargs file. This will depend on one’s installation directory, which will vary by operating system. For me, running sudo vim /opt/webstorm-eap/bin/webstorm64.vmoptions and updating my JVM args as reflected below

-Xms8g
-Xmx24g
-XX:ReservedCodeCacheSize=1024m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:MaxJavaStackTraceDepth=-1
-Dawt.useSystemAAFontSettings=lcd

My machine has 32 GB of RAM, so much higher values were appropriate. I also bumped up the value for ReservedCodeCacheSize which has a maximum allowed value of 1024m. I will need to re-start WebStorm after making this change to the webstorm64.vmoptions file, but I should now see these parameters reflected in the running webstorm process that I can check as shown above in the initial step.

Firefox 47.0 official release & Selenium breaking (!) changes

Firefox 47.0 was officially released yesterday. I usually wouldn’t comment too much on a browser version release, but this costed me several hours of thorough investigation. Some Selenium scripts written in python which I have been using regularly abruptly stopped working, and given the number of interactions between python 3.x, Firefox, and one’s setup and environment, I did not come to think initially that this was the source of the problem.

➜  thePlatform python get-auth-token.py      
Traceback (most recent call last):
  File "get-auth-token.py", line 6, in 
    driver = webdriver.Firefox()
  File "/usr/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 81, in __init__
    self.binary, timeout)
  File "/usr/lib/python3.5/site-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/usr/lib/python3.5/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "/usr/lib/python3.5/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 98, in _wait_until_connectable
    raise WebDriverException("The browser appears to have exited "
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

A useless message. I downgraded to the “firefox-esr” (45.2.0-1) version available in the AUR, and my scripts worked perfectly again. For those not using Arch Linux, one can always downloaded past released versions from Mozilla’s website. Simply go to all Firefox downloads for your desired language/locale, but instead of clicking on the download link for your platform, copy the download location instead; simply change the version of 47.0 to 45.0 and you’ll have a Selenium-compatible version of Firefox once again. 🙂

Note that it is entirely possible to have multiple instances of Firefox installed on one’s machine.

Multi-process Firefox 48.x+

  1. Type about:config in the address bar.
  2. Search for dom.ipc.processCount and enter in the the number of concurrent processes you wish to allow (I have 8 virtual CPU cores and opted to use 8 processes, though this does not need to be based on the number of cores your machine has).