Skip to content

Instantly share code, notes, and snippets.

View juzam's full-sized avatar

Giovanni Angoli juzam

  • Italia
View GitHub Profile
@juzam
juzam / Dockerfile.golang:1.7.4-wheezy-armv6l
Created January 1, 2017 15:24
Golang 1.7.4 ARM v6l Dockerfile
FROM armhf/buildpack-deps:wheezy-scm
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
- name: Install Hypriot/Schatzkiste GPG key
apt_key: url="https://packagecloud.io/Hypriot/Schatzkiste/gpgkey"
- name: Install Hypriot/Schatzkiste repository
apt_repository: repo="deb https://packagecloud.io/Hypriot/Schatzkiste/debian/ wheezy main" state=present
- name: Install arm-machine
apt: name={{ item }} state=installed update-cache=yes
with_items:
- docker-machine
@juzam
juzam / apt-main.yml
Last active November 21, 2016 17:00
Visual Studio code for Linux (apt) Ansible install tasks, suitable to be put in a role.
- name: Install bintray GPG key
apt_key: keyserver=keyserver.ubuntu.com id=379CE192D401AB61 state=present
- name: Install headmelted GPG key
apt_key: url="https://bintray.com/user/downloadSubjectPublicKey?username=headmelted"
- name: Install headmelted repository
apt_repository: repo="deb https://dl.bintray.com/headmelted/deb-code-oss wheezy main" state=present
- name: Install Visual Studio Code
@juzam
juzam / rPi3-ap-setup.sh
Last active April 18, 2016 10:20 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Must be root"
exit
fi
if [[ $# -ne 1 ]]; then
echo "You need to set a password!"
echo "Usage:"
@juzam
juzam / iss_stream
Last active August 7, 2017 22:47
Stream Ustream.tv ISS live video feed locally without using web player, re-encode the stream as audio only (using livestreamer and vlc)
# prerequisites: livestreamer http://docs.livestreamer.io/ with ustream plugin (python-librtmp required)
# video lan client: http://www.videolan.org/
# grab the video stream and expose the stream locally as is on port 8082
livestreamer http://www.ustream.tv/channel/9408562 worst --player-continuous-http --player-external-http --player-external-http-port 8082
# grab the locally streamed video feed and transcode it audio only (mp3,16k/s,44100)
vlc -vvvv http://livestreamerip:8082 --loop --no-sout-video --sout-keep --sout '#gather:transcode{vcodec=none,acodec=mp3,ab=16,channels=1,samplerate=44100}:http{mux=raw,dst=:8083}'
@juzam
juzam / Mqtt-Launcher Blinkstick.md
Last active August 29, 2015 14:13
BlinkStick Square mqtt-launcher https://github.com/jpmens/mqtt-launcher config on Windows (cygwin, requires python, paho-mqtt and blinkstick debug command line util: https://www.blinkstick.com/system/releases/windows/blinkstick-command-line.zip)

Simple mqtt-launcher setup.

install python and paho-mqtt (pip install paho-mqtt) in your cygwin environment. dowload the blinkstick debug client and unzip it in your desired directory (/usr/local/bin in the example)

the topic structure in the example is this:

blinkstick/serialn/pixelindex

where serialn is the serial number of your blinkstick device.

Keybase proof

I hereby claim:

  • I am juzam on github.
  • I am gangoli (https://keybase.io/gangoli) on keybase.
  • I have a public key whose fingerprint is 8103 AC90 94B8 BDEA BAC3 298D 0255 DFFC 6D1F 1B40

To claim this, I am signing this object:

#!/bin/bash
### BEGIN INIT INFO
# Provides: node-red
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop the node-red server
### END INIT INFO
# Can be downloaded and installed in one go by using this command
@juzam
juzam / pinoccio_proxy.flow
Last active August 29, 2015 13:59
Pinoccio Node Red command proxy flow - First Draft
[{"id":"1f8dc6c2.cba389","type":"mqtt-broker","broker":"localhost","port":"1883","clientid":"nodered-1"},{"id":"fb5bdbec.60523","type":"mqtt out","name":"","topic":"","broker":"1f8dc6c2.cba389","x":1010.25,"y":158,"z":"f1e02243.ca166","wires":[]},{"id":"fd3d9542.f0877","type":"inject","name":"\"print power.percent\" Command Example","topic":"","payload":"{\"troop\": \"1\", \"scout\": \"1\", \"topic\": \"result\", \"command\": \"print power.percent\"}","payloadType":"string","repeat":"","crontab":"","once":false,"x":200.5,"y":227.5,"z":"f1e02243.ca166","wires":[["1e34db31.3aea5d"]]},{"id":"b16c8037.41ae8","type":"http request","name":"REST POST","method":"POST","url":"","x":620,"y":158.25,"z":"f1e02243.ca166","wires":[["898e121d.69f8d","cab5ea3b.2ee23"]]},{"id":"898e121d.69f8d","type":"function","name":"Prepare Output","func":"data = JSON.parse(msg.payload);\n\nreading = { payload: data.data.reply.trim() , topic: msg.topic, retain: 1 };\ntstamp = { payload: data.data._t, topic: msg.topic + \"/tstamp\", retain
@juzam
juzam / check_nf_conntrack_count
Created March 10, 2014 09:04
Nagios/Icinga nf_conntrack_count check
#!/bin/sh [0/329]
# takes warning and critical percentage as $1 and $2 parameters
# if not specified defaults to 95% and 97% respectivley
STATUS_CRITICAL=1
STATUS_WARNING=2
STATUS_OK=0
WARNING_LEVEL=${1:-95}