This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")| #!/bin/bash | |
| # | |
| # Copy data from a Time Machine volume mounted on a Linux box. | |
| # | |
| # Usage: copy-from-time-machine.sh <source> <target> | |
| # | |
| # source: the source directory inside a time machine backup | |
| # target: the target directory in which to copy the reconstructed | |
| # directory trees. Created if it does not exists. | |
| # |
| Byobu Commands | |
| ============== | |
| byobu Screen manager | |
| Level 0 Commands (Quick Start) | |
| ------------------------------ | |
| <F2> Create a new window |
This is a quick guide to Kotlin programming language. The previous part of this guide is here
#Object Oriented
fun main(args : Array<String>) {
class local (val x : Int)
val y = local(10)
println("${y.x}")| #ifndef __dbg_h__ | |
| #define __dbg_h__ | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <string.h> | |
| #ifdef NDEBUG | |
| #define debug(M, ...) | |
| #else |
| #!/usr/bin/php5 | |
| <?php | |
| /* | |
| * Speedtest.net linux terminal client. | |
| * This is free and open source software by Alex based on a script from Janhouse | |
| * Script uses curl, executes ifconfig commands in shell and writes temporary files in temp_down folder. Make sure you have everything set up before using it. | |
| */ | |
| header("content-type: text/plain"); | |
| /* * * Configuration * * */ | |
| $iface="eth0"; |
| # http://stackoverflow.com/a/28818420/484780 | |
| git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1` |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| "time" | |
| ) | |
| // humanizeDuration humanizes time.Duration output to a meaningful value, | |
| // golang's default ``time.Duration`` output is badly formatted and unreadable. |
# View public IP
| curl http://spark-cluster-ip:6066/v1/submissions/status/driver-20151008145126-0000 |
| # Create a RPi with consul running on it | |
| docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.3 swl-consul | |
| docker $(docker-machine config swl-consul) run -d --restart=always -p 8500:8500 -h consul nimblestratus/rpi-consul -server -bootstrap | |
| # Create a RPi swarm with consul discovery | |
| docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.4 --swarm --swarm-master --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" swl-demo0 | |
| docker-machine-hypriot create -d hypriot --hypriot-ip-address=192.168.1.5 --swarm --swarm-discovery="consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-store=consul://$(docker-machine ip swl-consul):8500" --engine-opt="cluster-advertise=eth0:0" --engine-label "storage=ssd" swl-demo1 | |
| # Connect to the RPi swarm | |
| eval $(docker-machine env --swarm swl-demo0) |