Skip to content

Instantly share code, notes, and snippets.

@honeniq
honeniq / Dockerfile
Created March 27, 2018 08:00
trema-book-build Dockerfile
FROM ubuntu
MAINTAINER honeniq <honeniq@gmail.com>
RUN apt update && apt install gcc make ruby ruby-dev default-jdk git fonts-vlgothic -y
RUN gem install bundler
RUN git clone https://github.com/yasuhito/trema-book.git
RUN rm -rf trema-book/vendor/asciidoctor-fopub
RUN git clone https://github.com/asciidoctor/asciidoctor-fopub trema-book/vendor/asciidoctor-fopub
@honeniq
honeniq / install_peco.sh
Created January 12, 2018 02:58
Install peco to ~/.local/bin/
#!/bin/sh
latesturl=https://api.github.com/repos/peco/peco/releases/latest
binpath=~/.local/bin/
zipurl=`curl -s ${latesturl} | grep -o 'https://.*peco_linux_amd64.tar.gz'`
echo ${zipurl}
curl -sL ${zipurl} | tar xz -C ${binpath} --strip=1 peco_linux_amd64/peco
@honeniq
honeniq / i2c_scanner.rb
Created December 4, 2016 06:56
I2C device address scannner for GR-CITRUS.
#!mruby
@Usb = Serial.new(0, 115200)
@Dev = I2c.new(1) # SDA=>pin0, SCL=>pin1
@Address = 0x00 # Register address to read.
@Usb.println("I2C Scanner")
(1..127).each do |i|
r = @Dev.read(i, @Address)
@Usb.println(i.to_s(16) + ' ' + r.to_s(16)) if r != 255