Tag Archives: ubuntu

RStudio Server and Apache

rstudio2To install R and RStudio Server on Ubuntu:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo apt-get update
sudo apt-get install r-base
sudo -i R
wget https://download2.rstudio.org/rstudio-server-1.1.453-amd64.deb
sudo gdebi rstudio-server-1.1.453-amd64.deb

Configure Apache 2.4 to proxy RStudio, install required modules.

sudo apt-get install libapache2-mod-proxy-html
sudo apt-get install libxml2-dev

Edit configuration file 000-default.conf to add the followings. Assuming RStudio runs on default port 8787 and preferred path is /rstudio:

<Proxy *>
	Allow from localhost
< /Proxy *>

RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /rstudio/(.*) ws://localhost:8787/$1  [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /rstudio/(.*) http://localhost:8787/$1 [P,L]
ProxyPass /rstudio/ http://localhost:8787/
ProxyPassReverse /rstudio/ http://localhost:8787/
ProxyRequests Off

Finally restart apache.

sudo a2enmod proxy && sudo a2enmod proxy_http && sudo a2enmod proxy_wstunnel && sudo service apache2 restart


Deep Learning with the Movidius Neural Compute Stick


Deep Learning is a breakthrough in Artificial Intelligence. With its root from neural network, modern computing hardware advancement enabled new possibilities by sophisticated integrated circuits technology.

A branch of this exciting area in AI is machine learning. The leading development frameworks include TensorFlow and Caffe. Pattern recognition is a practical application of machine learning where photos or videos are analysed by machine to produce usable output as if a human did the analysis. GPU has been a favorite choice for its specialized architecture, delivering its supreme processing power not only in graphics processing but also popular among the neural network community. Covered in a previous installment is how to deploy an Amazon Web Services GPU instance to analyse real time traffic camera images using Caffe.

To bring this kind of machine learning power to IoT, Intel shrank and packaged a specialized Vision Processing Unit into the form factor of a USB thumb drive in the Movidius™ Neural Compute Stick.

It sports an ultra low power Vision Processing Unit (VPU) inside an aluminium casing, weights only 30g (without the cap). Supported on the Raspberry Pi 3 model B makes it a very attractive add-on for development projects involving AI application on this platform.IMAG1435

In the form factor of an USB thumb drive, the specialized VPU geared for machine learning in the Movidius performs as an AI accelerator for the host computer.IMAG1439

To put this neural compute stick into action, an SDK available from git download provided by Movidius is required. Although this SDK runs on Ubuntu, Windows users with VirtualBox can easily install the SDK with an Ubuntu 16.04 VM.

While the SDK comes with many examples, and the setup is a walk in the park, running these examples is not so straight forward, especially on a VM. There are points to note from making this stick available in the VM including USB 3 and filters setting in VirtualBox, to the actual execution of the provided sample scripts. Some examples required two sticks to run. Developers should be comfortable with Python, unix make / git commands, as well as installing plugins in Ubuntu.

The results from the examples in the SDK alone are quite convincing, considering the form factor of the stick and its electrical power consumption. This neural computing stick “kept its cool” literally throughout the test drive, unlike the FPGA stick I occasionally use for bitcoins mining which turn really hot.

Yubikey, Beagleboard, and Precise Pangolin

Yibico provided library for accessing the Yubikey API on linux platform, but unfortunately there is an issue with the signed char (OMAP is ARM) that will give an error message of “Server response signature was invalid (BAD_SERVER_SIGNATURE)”. A rebuild of the package from source is needed for this package to work, in this case, Ubuntu Precise Pangolin on Beagleboard XM.

A USB extension cord comes handy to connect the Yukikey. By the way, it looks like my RFID model is discontinued and being replaced by the NFC version at Yukikey.

Login with Yubikey.yubibeagle2