wget https://storage.googleapis.com/golang/go1.8.linux-armv6l.tar.gz
tar -C /usr/local -xzf go1.8.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function convert_coord_to_dms (lat, lon) { | |
| /* | |
| Se Lat é positivo é Norte, senão Sul | |
| Se Long é positivo é Leste, senão Oeste | |
| */ | |
| var lat_orientation = lat < 0 ? "S" : "N", | |
| lon_orientation = lat < 0 ? "W" : "E"; | |
| function get_dms(decimal) { |
System: Ubuntu 14.04 (Trusty Tahr)
As mentioned here, to update a go version you will first need to uninstall the original version.
To uninstall, delete the /usr/local/go directory by:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "time" | |
| ) | |
| // Fake a long and difficult work. | |
| func DoWork() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Incredibly simple Node.js and Express application server for serving static assets. | |
| Given as an example from the React Router documentation (along with examples | |
| using nginx and Apache): | |
| - https://github.com/ReactTraining/react-router/blob/master/docs/guides/Histories.md#browserhistory | |
| */ | |
| const express = require('express'); | |
| const path = require('path'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Add to instance metadata with `gcloud compute instances add-metadata \ | |
| # instance-name --metadata-from-file startup-script=idle-shutdown.sh` and reboot | |
| # NOTE: requires `bc`, eg, sudo apt-get install bc | |
| # Modified from https://stackoverflow.com/questions/30556920/how-can-i-automatically-kill-idle-gce-instances-based-on-cpu-usage | |
| threshold=0.1 | |
| count=0 | |
| wait_minutes=60 | |
| while true |
The 'Git for Windows' by default does not come with MSYS2 package manager called 'Pacman' and hence it is a limited version or subset of the MSYS2. Also the bash which supplied wih 'Git for Windows' is not a full version of bash hence does not provide for full Linux environment.
However you can get package manager support inside 'Git for Windows' in following ways :
- Install full MSYS2 and build Git for Windows yourself (Most git users don't require all packages and MSYS2)
- Install Git for Windows SDK (heavy & consumes around 3-5 Gb space)
- Use a hack to merge the MSYS2 Pacman packages with your existing Git for Windows installation