-
Install and run an MQTT server (mosquitto is a good choise)
-
Install mqtt and ncurses-ruby gems
sudo gem install ruby-mqtt ncurses-ruby
-
Run the client
ruby ./mqtt-chat.rb
| package main | |
| // run this file with `go run clientDoGzip.go, and then file tmp.out to verify body is gzipped | |
| import "compress/gzip" | |
| import "net/http" | |
| import "fmt" | |
| import "io" | |
| import "log" | |
| import "os" |
| /* MAX7219 Interaction Code | |
| * --------------------------- | |
| * For more information see | |
| * http://www.adnbr.co.uk/articles/max7219-and-7-segment-displays | |
| * | |
| * 668 bytes - ATmega168 - 16MHz | |
| */ | |
| // 16MHz clock | |
| #define F_CPU 16000000UL |
| #!/usr/bin/env sh | |
| # Download lists, unpack and filter, write to stdout | |
| curl -s https://www.iblocklist.com/lists.php \ | |
| | sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \ | |
| | xargs wget -O - \ | |
| | gunzip \ | |
| | egrep -v '^#' |
| // https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works | |
| package main | |
| import ( | |
| "fmt" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| const privateKey = `content of id_rsa` |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "io" | |
| "log" | |
| "mime/multipart" | |
| "net/http" | |
| "os" |
| package main | |
| import ( | |
| "bytes" | |
| "compress/gzip" | |
| "database/sql/driver" | |
| "errors" | |
| "fmt" | |
| "github.com/jmoiron/sqlx" | |
| _ "github.com/mattn/go-sqlite3" |