Accessing your cloud desktop from Chromebook

One of the main reasons for setting up a cloud desktop is that I tend to use a lot of different devices some of which are not very powerful. One of my favorite devices of late has been a HP 11 Chromebook. I originally bought it for a new employee and wanted to check myself how this thing stacks up to do day-to-day computing tasks more efficiently than a standard laptop without all the headaches of running Windows (viruses, endless driver installs, bloatware, malware, ...). We already have several people at work working exclusively from Chromebooks and they absolutely love them. Long story short - I ended up keeping the Chromebook for myself as it's an absolutely great secondary device for me. I can carry it with me everywhere (doesn't weigh much more than a tablet, roughly the same size as a tablet & has a keyboard and is so much more useful than a tablet). Initially I was using it more as a secondary device, but lately I have been thinking that I will not even take my main notebook at all for travels. The problem with this is that I do (sometimes - very infrequently) need access to software not available on such a limited device. Accessing your Cloud Desktop via SSH (I know there seem to be people allowing direct VNC access - but that is just asking for trouble) is highly recommended. I also use RSA keys instead of password authentication. Copy SSH Private Key (generated…

Continue Reading

Upgrade Rikomagic MK902 Android MiniPC from Ubuntu

If there would be an Oscar for the WORST firmware upgrade procedure (and associated drivers, documentation and general quality of software) Rikomagic should win this by a country mile ! Since all the information I found on the interwebs said Linux was not supported I ended up borrowing friends notebooks (as I don't own any Windows machinery anymore). My main Toshiba Ultrabook seemed to have issues with picking up the USB from a Windows Virtual Machine). After not being able to get the absolute crap USB drivers that come with the firmware download with any of the machines (Vista & Win7_64) I was ready to throw in the towel and put the purchase of this unit (in hindsight I would not do it again anyway) down as a total waste. I tried a last search on upgrading using Linux it turns out there was a very recent Rockchip Linux Upgrade Tool release. Download Upgrade Tool http://dl.radxa.com/rock/tools/linux/Linux_Upgrade_Tool_v1.16.zip Dependencies If you haven't got the Android SDK or tools yet you need to install sudo apt-get install android-tools-adb android-tools-fastboot USB Configuration sudo vim /etc/udev/rules.d/51-android.rules #add the following line SUBSYSTEMS=="usb", ATTRS{idVendor}=="2207", MODE="0666", GROUP="plugdev" Restart udev sudo udevadm control --reload-rules vim ~/.android/adb_usb.ini #add at the end of the file 0x2207 Restart the adb server adb kill-server adb start-server You should be able to test with adb devices The output should be like the following: adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices…

Continue Reading

Apache Cordova development environment install on Ubuntu

Apache Cordova has very nice documentation, however as so many projects it is focused on the Windows/MacOS duopolies only. Fortunately it's not too hard to work out the differences. Installing dependencies Thanks to: https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager sudo apt-get install python-software-properties python g++ make ant openjdk-7-jre openjdk-7-jdk Installing Android SDK Please note: one of the problems I found was that I had some Android tools from the Ubuntu repos that were conflicting with the SDK install. It's probably a good idea to remove them first. That might save you from a lot of headaches down the line (and time to troubleshoot). sudo apt-get remove android-tools-adb android-tools-fastboot Download as per http://developer.android.com/sdk/index.html wget http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz Note: check for updated link version obviously vim ~/.bashrc Add the PATH variables to the top of the file #AndroidDev PATH export PATH=${PATH}:~/android-sdk-linux/tools export PATH=${PATH}:~/android-sdk-linux/platform-tools Reload bash variables without reboot / logout source ~/.bashrc Testing SDK android This command should now bring up the SDK manager. Installing Eclipse IDE This is obviously an optional step depending on the IDE you want to use. I have previously covered a manual Eclipse install (as opposed to the Ubuntu repositories). Install Eclipse ADT Plugin As per: http://developer.android.com/sdk/installing/installing-adt.html Node.js Install The main difficulty on Ubuntu (as with so many development tools - see Eclipse above) is that the included node.js version in the Ubuntu repositories is outdated (remove the Ubuntu version with 'sudo apt-get remove node'). sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install python-software-properties python g++ make nodejs Install Cordova sudo npm install…

Continue Reading

Automatically posting GooglePlus articles to Twitter

I have switched most of my Social Media postings to Google+ over the last year. Despite popular opinion being that Google+ is some 'ghost town', I find G+ the most useful environment for my particular needs & interests (specially since the introduction of groups). It has in my experience a vastly better signal-to-noise than other social media in particular Facebook. However I would still like to feed postings through to my Twitter stream. Unfortunately Google has (stupidly / purposely / nastily) not included RSS support to make this possible without much work. There are a few publicly accessibly services out there, but they generally are either not updated or tend to fail very frequently as they hit the API Access limits as soon as they get a few users on their services. To achieve this I have created a PHP script utilising the Google API Client to convert the public activities to a standard RSS feed. The code is available on GitHub. I used to use a script by by Michael Mahemoff (https://plus.google.com/106413090159067280619/posts/8NE3cFi4cB6) - thank you ! The main reasons for needing to change were IFTTT having issues with the initial script output (not valid RSS and illegal characters). Create API Project Go to https://cloud.google.com/console/ Create a project Go to 'APIs & auth' --> 'APIs' and turn "Google+ API" on (see Screenshot below) Go to 'APIs & auth' --> 'APIs' and create a 'Public API access' key (see Screenshot below) Copy the API Key for the next step Setting up…

Continue Reading

Making VIM the default text editor on Ubuntu

In my never ending quest to find the ideal text editor here is another installment. Since I have been using VIM as my default command line editor for years I thought I give it a try for basic GUI editing as well. Install and set desktop app & icon sudo apt-get install vim vim-gnome sudo wget --output-document=/usr/share/applications/gvim.desktop https://raw.github.com/leogaggl/misc-scripts/master/gvim.desktop sudo wget --output-document=/usr/share/icons/hicolor/scalable/apps/gvim.svg http://gfxmonk.net/images/vim-logo/vim-logo.svg sudo update-desktop-database Set MIME defaults vim ~/.local/share/applications/mimeapps.list #add or edit the following mime type and add others as needed text/plain=gvim.desktop;

Continue Reading

Install FirefoxOS on Nexus S (GT-9023)

I just had one of my old hand-me-down phones returned by my offspring in a great condition (junior is very careful with his equipment - well done young man !). This doesn't happen all too often shows that the Nexus S is a decently built phone. This is also a good example of breaking the built-in obsolescence of modern phones. This particular unit has served me well for nearly 2 years (my average is one year) and served 2 kids after that. These instructions have been compiled on Ubuntu 13.10 64bit to allow me to re-do this process in future. It should work on any Linux based distro (see pre-requisites) - if you are using another Operating System it might be time to switch. Hopefully it might be useful for other people as well. Installing pre-requisites As per https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Linux_Prerequisites wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py python bootstrap.py Ubuntu 13.10 additions As per https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites#Ubuntu_13.10. sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git lib32ncurses5-dev lib32z1-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip libxml2-utils sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 1 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 2 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 1 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 2 sudo update-alternatives --set gcc "/usr/bin/gcc-4.6" sudo update-alternatives --set g++ "/usr/bin/g++-4.6" Check out & build Firefox OS git clone git://github.com/mozilla-b2g/B2G.git cd B2G echo "export HIDPI=1" > .userconfig ./config.sh nexus-s ./build.sh -j3 The config script will take quite some time depending on your internet connection as…

Continue Reading

Enabling the watchdog timer on the Raspberry Pi

Turns out that the Broadcom BCM2708 chip on the RPi has a hardware watchdog. This can be very useful if your RPi is located remotely and locks up. However, this would not the preferred method of restarting the unit and in extreme cases this can result in file-system damage that could prevent the RPi from booting. If this occurs regularly you better find the root cause of the problem rather than fight the symptoms. Enable Watchdog Kernel Module echo 'bcm2708_wdog' >> /etc/modules sudo modprobe bcm2708_wdog Install Watchdog Daemon sudo apt-get install watchdog chkconfig chkconfig watchdog on sudo /etc/init.d/watchdog start sudo vim /etc/watchdog.conf # Uncomment the line watchdog-device = /dev/watchdog # You might also want to uncomment max-load-1, or add something like "max-load-1 = 24" to reset your Pi if the load average exceeds 24 in any 1-minute span. sudo /etc/init.d/watchdog restart The watchdog daemon will send /dev/watchdog a heartbeat every 10 seconds. If /dev/watchdog does not receive this signal it will brute-force restart your Raspberry Pi. If you are feeling adventurous you can test the setup by launching one of the fork-bombs you can find out there. Just make sure you don't have anything of importance running. : (){ :|:& };: Thanks to gadgetoid for the original tip !

Continue Reading

Dropping the wires on the Raspberry PI

Testing the RPi for some remote sensing application I needed to use a wireless connection as it would have been a pain to reach with an Ethernet cable. Parts Raspberry Pi Series B 512MB Raspbian 3.6.11+ Kernel Comfast 802.11n - Realtek RTL8188CUS WLAN Adapter Install WPA Supplicant sudo apt-get install wpasupplicant See http://en.wikipedia.org/wiki/Wpa_supplicant Check for the USB adapter sudo lsusb This should show output similar to this (depending on your USB adapter) Bus 001 Device 004: ID 0bda:8176 Realtek SemicondRTL8188CUSuctor Corp. 802.11n WL:AN Adapter Generate PSK Key If you want to use the cleartext PSK you could probably skip this step. wpa_passphrase YOUR_SSID YOURCLEARTEXTWPAKEY This should show output similar to this: network={ ssid="YOUR_SSID" #psk="YOURCLEARTEXTWPAKEY" psk=c885c4288a0c68b989289586cb075c0ccd1729d2c035820d02ed813fc729f317 } Edit network configuration sudo vim /etc/network/interfaces auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid "YOUR_SSID" wpa-psk c885c4288a0c68b989289586cb075c0ccd1729d2c035820d02ed813fc729f317 Finish off sudo shutdown -h now Unplug ethernet cable Power up the RPi and you should see another wireless DHCP assignment on the router

Continue Reading

Webserver and database combination on Raspberry Pi

My normal combination on the big-server side would be Apache + MySQL (or PostgreSQL), but on the RPi this seems to be absolute overkill. For data-logging operations I would not use the local system anyway (looking at MQTT as well as Remote MongoDB datastore via REST Webservices). After some poking around and reading up on the options I decided to go for the following combo: LightHTTPD + SQLite. Both are lightweight replacement of their fully-featured big-server counterparts (Apache HTTP & MySQL) and have very familiar configurations. There would be other options that have even less resource usage, but I really don't have the time to start from scratch somewhere. Another reason to go for this combination is that these are very well supported systems with regular security audits. Even though I am not planning to use my RPi's for anything mission-critical this is always worth a consideration as you don't need to unnecessarily introduce vulnerabilities to your network. Install & configure LightHTTPD sudo apt-get install lighttpd php5 php5-cgi php5-sqlite sudo lighty-enable-mod fastcgi sudo lighty-enable-mod fastcgi-php Further config changes can be also made via the config file. sudo vim /etc/lighttpd/lighttpd.conf sudo service lighttpd force-reload Install & configure SQLite sudo apt-get install sqlite3 sqlite3 /home/username/database_name.db All other commands are standard SQL from the 'sqlite>' command prompt or via SQL scripts like sqlite3 /home/username/database_name.db < sql_script.sql Access Databases from the webserver (using PHP) < ?php $db = new SQLite3('mysqlitedb.db'); $results = $db->query('SELECT bar FROM foo'); while ($row = $results->fetchArray()) { var_dump($row); } ?>…

Continue Reading