Skip to content

Instantly share code, notes, and snippets.

View highgain86j's full-sized avatar

Tahiro Hashizume highgain86j

View GitHub Profile
#!/usr/bin/expect
set host "route-info.flets-east.jp"
set port "49881"
spawn "/bin/bash"
send "telnet $host $port\r"
expect "'^]'."
send "GET /v6/route-info HTTP/1.1\r"
send "Host: $host:$port\r"
@highgain86j
highgain86j / mydns.lua
Created January 28, 2017 05:31 — forked from shiwork/mydns.lua
YAMAHA RTXシリーズでDDNSをLuaで更新通知するスクリプト
------------------------------------
-- Config
------------------------------------
-- MyDNS ID
mid="MyDNSID"
-- MyDNS Password
pwd="MyDNSPASSWD"
@highgain86j
highgain86j / nginx config for icecast2
Last active February 3, 2023 13:06
nginx configuration for reverse-proxying icecast2 streaming server.
server {
listen 80;
listen [::]:80;
server_name radio.example.com;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
@highgain86j
highgain86j / nginx config for webmin
Last active March 11, 2018 16:46
Reverse-proxying for Webmin
server {
listen 80;
listen [::]:80;
server_name some_hostname;
#location / {
#location /webmin/ {
location / {
# Tell nginx that we want to proxy everything here to the local webmin server
# Last slash is important
@highgain86j
highgain86j / mts.sh
Last active March 6, 2018 09:21
A bash script with which you should be able to import MTS files to Ubuntu/Debian from AVCHD camcoders.
#!/bin/bash
MTS_LIST=`mktemp /tmp/mts.XXXXXX`
THREADS_TOTAL=(`cat /proc/cpuinfo | egrep '^processor' | awk '{print $3}'`)
SPANNED_FILE_SIZE=4288180224 #This number varies by camera. This value is optimized for Panasonic HDC-HS100.
function func_new_thread(){
local tmp_list=`mktemp /tmp/list.XXXXXX` || exit 1
ospf use on
ospf area backbone
bgp use on
bgp autonomous-system 64759
bgp log neighbor packet
bgp neighbor 1090 64656 10.1.255.90 gateway=tunnel9 local-address=10.2.255.200
bgp neighbor 2010 64759 10.2.255.10 local-address=10.2.255.200
bgp neighbor 2020 64759 10.2.255.20 local-address=10.2.255.200
bgp neighbor 2200 64759 10.2.255.200 local-address=10.2.255.200
bgp router id 10.2.255.200
@highgain86j
highgain86j / homebridge_install.bash
Last active June 21, 2018 14:17
homebridge_install.bash
#!/bin/bash
RUN_SETUP=false
NIC=wlan0
GPIO=(
"name momentary/toggle"
"disabled"
"Dinner-Bell momentary"
@highgain86j
highgain86j / screen.sh
Created September 25, 2018 05:04
A handy bash script to run almost any programs in the background using the screen command.
#!/bin/bash
function launch(){
local execbin="`which ${target}`"
local str="`screen -list "${target}" | egrep 'Detached|Attached' | awk '{print $1}'`"
ps aux | egrep -v 'grep|ps aux|screen|SCREEN' | grep pts | grep \^${USER} | grep ${target}
if [ "${str}" != "" ]; then
echo -e "\"${str}\" is present."
echo "Reattaching... (ignoring options)"
sleep 1
@highgain86j
highgain86j / vban_receptor.service
Created October 15, 2018 23:32
systemd definition for vban_receptor
[Unit]
Description=vban - Linux command-line VBAN tools
After=sound.target
Wants=network-online.target
After=network.target network-online.target
[Service]
ExecStart=/usr/local/bin/vban_receptor -i10.1.240.7 -p6980 -sStream1 -balsa -dplughw:UA25EX,0
User=vban
Group=vban
@highgain86j
highgain86j / install_vban_shairport_bluezalsa.sh
Last active November 25, 2018 03:02
Creates a network audio-sink automatically (without supports for PulseAudio and Jack).
#!/usr/bin/env bash
#sudo groupadd -r audiosink
#sudo useradd -r -M -g audiosink -s /usr/bin/nologin -G audio audiosink
function set_options(){
if ${INSTALL_VBAN}; then
VBAN_ENABLE_ALSA=true
VBAN_ENABLE_PULSE=false
VBAN_ENABLE_JACK=false
VBAN_ENABLE_JACK_VERSION=2