Skip to content

Instantly share code, notes, and snippets.

View fumiyas's full-sized avatar
💭
> 突然の死 <

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
// ズンドコキヨシ with Golang (未完成)
// http://qiita.com/shunsugai@github/items/971a15461de29563bf90
// FIXME: goroutine の実行が偏りすぎるのでスケジューラー的なにかが必要?
// FIXME: バグってら。「ドコ」を待っているときに「ズン」が来るとそいつが捨てられる…。
package main
import (
"fmt"
@fumiyas
fumiyas / socat-over-serial-getty.sh
Last active March 4, 2021 00:59
socat over serial port
#!/bin/sh
##
## socat over serial: getty
## Copyright (c) 2016 SATOH Fumiyasu @ OSS Technology Corp., Japan
##
## License: GNU General Public License version 3
##
set -u
#!/bin/sh
##
## Create a CISCO AnyConnect VPN Client *.deb from anyconnect-predeploy-linux-*.tar
## Copyright (c) SATOH Fumiyasu @ OSS Technology Corp., Japan
##
## License: GNU General Public License version 3
##
set -u
set -e
@fumiyas
fumiyas / weather-compact.sh
Created February 22, 2016 17:07
weather-compact.sh
#!/bin/sh
curl -s http://wttr.in \
|sed \
-e '/^$/d' \
-e '37,$d' \
-e '/[┼┌└]/d' \
-e 's/[―–]/-/g' \
-e "s/[‘’]/'/g" \
-e 's/\(°[^ ]*\) /\1/g' \
@fumiyas
fumiyas / escape-args.bash
Created May 1, 2015 05:28
escape-args.bash
#!/bin/bash
## or
#!/bin/zsh
##
## https://twitter.com/_hito_/status/593946874442186752
##
set - "${@//\\/\\\\}"
set - "${@//\$/\\\$}"
set - "${@//\`/\\\`}"
@fumiyas
fumiyas / tput2escstr.bash
Last active August 29, 2015 14:20
tput2escstr.bash
#!/bin/bash
# or
#!/bin/zsh
##
## Example:
## $ (
## echo -n "termcapinfo $TERM is="
## tput is2 \
## |tput2escstr \
## |perl -pe 's/\\E\[\?\d+(?:;\d+)*l/$_=$&;s#(\D)3(\D)#\1\2#;s#;;#;#;$_/e' \
LIBO= libreoffice --headless -env:UserInstallation="file://$$PWD/tmp"
ODF2PDF= $(LIBO) --convert-to pdf
ODF2DOC= $(LIBO) --convert-to doc
ODF2XLS= $(LIBO) --convert-to xls
ODF2PPT= $(LIBO) --convert-to ppt
ODTS= $(wildcard *.odt)
ODSS= $(wildcard *.ods)
ODPS= $(wildcard *.odp)
@fumiyas
fumiyas / net-device-wait.init
Last active August 29, 2015 14:17
stunnel mail client configurations for MS Office365 on RHEL 6 + upstart
start on runlevel [2345]
task
script
while :; do ip route |grep -q '^default via ' && break; sleep 1; done
initctl emit net-device-up
end script
@fumiyas
fumiyas / openssl-selfcert.bash
Last active August 29, 2015 14:15
openssl-selfcert.bash
## See https://github.com/fumiyas/openssl-hack/blob/master/bin/openssl-selfcert.bash
@fumiyas
fumiyas / ln-s-relative.sh
Last active August 29, 2015 14:14
ln-s-relative.sh - Make a symlink in relative path form
#!/bin/dash
set -u
ln_s_relative() {
local root=""
if [ $# -eq 3 ]; then
local root="$1"; shift
fi
local target="$1"; shift