Below you will find pages that utilize the taxonomy term “Development”
Setting up MultiTech LoRaWAN gateway on Ubuntu
As the convener for the Adelaide community of The Things Network, I am frequently setting up Multitech Conduit Gateways. Depending on your PC or notebook hardware you might have some problems with the Exar USB-UART driver on Linux.
Here are the steps to getting this unit setup from an Ubuntu (should work for any other Linux distro) machine.
lsusb
Should show something like this:
Bus 002 Device 006: ID 04e2:1410 Exar Corp. XR21V1410 USB-UART IC
Moving to KVM virtual machines
Installing VirtualBox is getting increasingly painful on Ubuntu due to the problems with UEFI Secure Boot and the VirtualBox kernel modules. Another reason for an alternative is that running VirtualBox VM’s completely in the background is not as straightforward as it could be.
From the available alternatives I looked into (VMWare, Xen & KVM) it was KVM that fitted my needs (casual VM usage with mostly headless VM’s for testing purposes). Main reasons:
RaspberryPi Version 3 SOE
Since there is now a supported Raspbian version without GUI and other unneeded add-ons available as Raspbian Lite the need to use other installers (with sometimes some downsides) is now not a necessity anymore. Below is a list of steps I like to perform before using them for any purpose as my Standard Operating Environment.
Download Raspbian Lite
Download link: https://www.raspberrypi.org/downloads/raspbian/
Write to SD Card
dd bs=4M if=2016-05-27-raspbian-jessie-lite.img of=/dev/sdb
Boot RPi
Default login details are
UID: pi
PWD: rasbperry
Install Hugo on Ubuntu to generate static websites
Whilst there is a .DEB installer to download from the GoHugo sites I get all matter of warnings that the package is of bad quality and I am not comfortable to run these kinds of installers.
I rather install from sources in this case which is very straight forward since the main dependencies (largely GO) are in the Ubuntu main repositories.
Install dependencies
sudo apt-get install golang git mercurial python-pygments
ChromeOS - removing SSH known_hosts from Chromebook
One of the things that is not implemented in the Secure Shell Chrome extension is the ability to remove know_host fingerprints which alert you if the fingerprint for a specific IP address has changed.
However there are times when you upgrade a systems and this need to be done.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
d6:be:12:7e:22:23:c3:e1:56:30:d6:cd:65:b7:ab:42.
Please contact your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /.ssh/known_hosts:7
ECDSA host key for xxxxxxxxxxxxx.yyy.au has changed and you have requested strict checking.
Host key verification failed.
NaCl plugin exited with status code 255.
(R)econnect, (C)hoose another connection, or E(x)it?
Install Ubuntu 14.04 on a Chromebook
There are plenty of sites out there that give advise on this topic, unfortunately most of them are highly ad-infested to the point of being unreadable as well as only containing single bit rather that an overall picture. This is a collection of useful links to source materials as well as steps necessary to install.
[](https://farm9.static.flickr.com/8643/16670196069_db9c19def6.jpg “Toshiba Chromebook 2 Ports by Joe Wilcox, on Flickr” https://www.flickr.com/photos/joewilcox/16670196069/ http://i.creativecommons.org/l/by-nc-sa/2.0/80x15.png “Creative Commons Creative Commons Attribution-Noncommercial-Share Alike 2.0 Generic License” http://creativecommons.org/licenses/by-nc-sa/2.0/)
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).
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.
Google Android Studio - Ubuntu repository install
Thanks to Paolo Rotolo there is now a Ubuntu Launchpad PPA for Android Studio
sudo apt-add-repository ppa:paolorotolo/android-studio<br></br>sudo apt-get update<br></br>sudo apt-get install android-studio
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).
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.
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;`
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.
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.
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
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.
Accessing 1-wire devices on Raspberry Pi using OWFS
To connect 1-wire serial devices to the RPi I am using a DS9490R USB 1-wire adapter (rather than wiring I2C 1-Wire master components to GPIO I2C – which I might look at sometime down the track)
Install packages
sudo apt-get install owfs ow-shell
Edit config file
vim /etc/owfs.conf
! server: server = localhost:4304<br></br># USB device: DS9490<br></br>server: usb = all<br></br>######################### OWFS ##########################<br></br>mountpoint = /mnt/1wire<br></br>allow_other<br></br>####################### OWHTTPD #########################<br></br>http: port = 2121<br></br>####################### OWFTPD ##########################<br></br>ftp: port = 2120<br></br>####################### OWSERVER ########################<br></br>server: port = localhost:4304
Raspberry Pi - Text to Speech
Just a quick note on Speech Synthesis a Raspberry Pi project. I had to research some of the options on the Raspberry Pi while looking into a project where I need some audio announcements.
Configuring Sound
echo 'snd-bcm2835' >> /etc/modules<br></br>sudo modprobe snd-bcm2835
sudo apt-get install mplayer alsa-base alsa-utils pulseaudio mpg123<br></br># make mplayer use mpg123 codec instead of default ffmp3float<br></br>echo "afm=mp3lib" >> ~/.mplayer/config
Since I am using Raspbian which is a Debian based (Wheezy) Distribution I used some Ubuntu documentation (https://help.ubuntu.com/community/TextToSpeech) as the starting point.
Enable GeoIP lookups on CentOS
GeoIP enables you to identify the location, organization, connection speed, and user type of your website visitors.
yum install GeoIP mod_geoip<br></br>cd /usr/share/GeoIP/<br></br>wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz<br></br>wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz<br></br>gunzip GeoIP.dat.gz<br></br>gunzip GeoLiteCity.dat.gz<br></br>rm -f *.gz<br></br>
Edit the VirtualHost settings in httpd.conf
<ifmodule mod_geoip.c><br></br>GeoIPEnable On<br></br>GeoIPDBFile /usr/share/GeoIP/GeoIP.dat Standard<br></br>GeoIPDBFile /usr/share/GeoIP/GeoLiteCity.dat Standard<br></br></ifmodule>
Restart Apache
/etc/init.d/httpd restart
Accessing Amazon RDS from Desktop
Every once in a while it is handy to be able to access an Amazon RDS Database Instance remotely from a desktop.
ssh -i <strong>YOUR-AMAZON-PRIVATE-KEY</strong>.pem -l <strong>YOUR-AMAZON-RDS-USERNAME</strong> -L 33060:<strong>YOUR-AMAZON-RDS-PRIVATE-IPADDRESS</strong>:3306 -N ec2-usr@<strong>YOUR-AMAZON-EC2-INSTANCE-PUBLIC-ADDRESS</strong>
Note: YOURAMAZONRDSPRIVATEIPADDRESS needs to be the AWS internal RDS IP Address – not the external hostname
You can then connect to RDS using mysql commands or any GUI tool such as MySQL Workbench via localhost:33060
Thanks to: Dirk Taggesell via AWS Forums
Installing the latest stable version of LibreCAD on Ubuntu
I have recently been looking at different CAD options on Ubuntu and LibreCAD (http://librecad.org/) is looking like the best option for my needs at current (apart from the wish there would be some DWG support).
Since the main Ubuntu repositories are usually a fair bit behind the lastest stable realeases of LibreCAD you need to add the LibreCAD Dev PPA Repository
sudo add-apt-repository ppa:librecad-dev/librecad-stable<br></br>sudo apt-get update<br></br>sudo apt-get install librecad<br></br>
Mobile Browser Testing on the Desktop
If you need to check websites for mobile compliance on a regular basis you know that having a device to constantly check is painful and slows down your work during debugging and phases of constant change.
by adactio
There are a few tools that will make this work a lot easier:
BESPIN - another nice one from Mozilla.org
Getting excited about a new text editor of all things is not something I like to admit to easily, but in my line of work (although less and less is actually doing hands on coding) text editing is an important part.
That’s why I checked out the BESPIN project as soon as I heard of it. The prospect of being able to edit your files from anywhere is very appealing to me since I spend a lot of time away from the desk and on devices that not always have good text editor (let alone all the files necessary). The thought of being able to edit files from a netbook while on the run is coming to mind straight away.
Mobile 2D codes gathering pace (outside of Asia)
FINALLY !!! As somebody that has been experimenting with this technology for over 2 years now I am quite exited to see that the adoption of this technology is gathering some steem. While it has bee widely adopted in Asia for some years now, it has taken some time to get a foothold in the rest of the world this seems to be changing now. At least in Europe as I can see for myself at the moment. In my opinion with Nokia finally getting serious and throwing its (considerable) weight behind this technology (http://mobilecodes.nokia.com/) and some other industry heavyweights joining forces in the Mobile Codes Consortium.� This will hopefully produce one key outcome, the stadardisation of the label technology, which up to now has been one of the stumbling blocks that has kept people such as myself from adopting these codes in real-world projects. Along with the adoption by some major companies in their advertising this should produce the momentum that was needed to push mobile 2D codes into some broad adoption.