Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
require 'pi_piper'
led = PiPiper::Pin.new :pin => 21, :direction => :out
loop do
p "LED ON"
led.on
sleep 1
@mattintosh4
mattintosh4 / Dockerfile
Created January 1, 2018 15:54
Dockerfile for qaac64.exe
FROM ubuntu:xenial
MAINTAINER m-yoshida
RUN \
dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y -o Dpkg::Progress-Fancy=1 curl ca-certificates apt-transport-https p7zip-full jq \
&& curl -O https://dl.winehq.org/wine-builds/Release.key \
&& apt-key add Release.key \
&& echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main' >>/etc/apt/sources.list \
#!/bin/bash
set -e
set -u
set -x
QAAC_VERSION=2.64
QAAC_SHA1=35081d830d17fc9925f102095ac8bbc4d08f4e0b
: ${1:?} # iTunes64Setup.exe
test -f "${1}"
#!/bin/bash
set -e
set -u
#set -x
### ENVIRONMENT ###
host=${1:?}
ping_count=4
sqlite_db_file="ping.sqlite"
sqlite_table_name="PING"
@mattintosh4
mattintosh4 / gist:c752770cef8be74730755b021b6aa3f0
Last active November 24, 2017 06:51
VULS 環境を構築してローカルスキャンを実行するとこまで勝手にやるナニカ
#!/bin/bash
################################################################################
# Distributor ID: CentOS
# Description: CentOS Linux release 7.3.1611 (Core)
# Release: 7.3.1611
# Codename: Core
################################################################################
set -e
set -u
PS4=$'\e[33;7mCOMMAND\e[m '
#!/bin/bash
set -e
set -u
set -x
## USAGE
# $ cd azur_lane
# $ ./gistfile1.sh
## DIRECTORY
#!/usr/bin/ksh
set -e
set -x
set -u
name=dnsmasq
srcdir=${HOME}/src/
prefix=/opt/local/${name}
(cd ${srcdir}${name} && git pull --rebase)
apt-get update
apt-get install -y curl language-pack-ja
curl -O http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-2+xenial_all.deb
dpkg -i zabbix-release_3.0-2+xenial_all.deb
rm -f zabbix-release_3.0-2+xenial_all.deb
apt-get update
apt-get install -y --install-recommends zabbix-server-mysql zabbix-frontend-php zabbix-agent php7.0-bcmath php7.0-mbstring php7.0-xml
sed -i'' '/php_value date.timezone/{s|# ||;s|Europe/Riga|Asia/Tokyo|}' /etc/zabbix/apache.conf
install -d -o zabbix -g zabbix /var/run/zabbix
mysqld_safe & sleep 5
@mattintosh4
mattintosh4 / Dockerfile
Last active July 17, 2017 07:38
CentOS 7 & Zabbix 3.0
FROM centos:centos7
MAINTAINER m-yoshida
## Initialization
RUN localedef -i ja_JP -f UTF-8 /usr/lib/locale/ja_JP.UTF-8 \
&& sed -i'' '/^mirrorlist/{s|^|#|};/^#baseurl/{s|^#||;s|mirror.centos.org|ftp.riken.jp/Linux|}' /etc/yum.repos.d/CentOS-Base.repo \
&& sed -i'' '/^enable/{s|1|0|}' /etc/yum/pluginconf.d/*.conf \
&& rpm --import http://ftp.riken.jp/Linux/centos/RPM-GPG-KEY-CentOS-7 \
&& yum clean all \
&& yum update -y
#!/bin/bash
### /etc/apt/sources.list ###
sed -i'' '/^deb/s/^/#/' /etc/apt/sources.list
cat >>/etc/apt/sources.list <<!
deb http://ftp.jaist.ac.jp/raspbian/ jessie main contrib non-free rpi
#deb-src http://ftp.jaist.ac.jp/raspbian/ jessie main contrib non-free rpi
!
### /etc/apt/sources.list.d/raspi.list ###