Skip to content

Instantly share code, notes, and snippets.

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

SATOH Fumiyasu fumiyas

💭
> 突然の死 <
View GitHub Profile
#!/bin/bash
##
## RHEL binutils ld(1) wrapper to do chrpath(1) hacks
## Copyright (c) 2016 SATOH Fumiyasu @ OSS Technology Corp.
## <http://www.OSSTech.co.jp/>
##
## License: GNU General Public License version 3 or later
##
set -u
@fumiyas
fumiyas / dmesg-T.txt
Created March 17, 2016 07:37
Page allocation error on Linux + LVM + XFS + rsync
[Thu Mar 17 05:54:02 2016] kworker/3:1H: page allocation failure: order:0, mode:0x2204020
[Thu Mar 17 05:54:02 2016] CPU: 3 PID: 649 Comm: kworker/3:1H Tainted: G O 4.4.0-1-amd64 #1 Debian
4.4.4-2
[Thu Mar 17 05:54:02 2016] Hardware name: HP ProLiant ML110 G6/ProLiant ML110 G6, BIOS O27 12/15/2010
[Thu Mar 17 05:54:02 2016] Workqueue: kblockd cfq_kick_queue
[Thu Mar 17 05:54:02 2016] 0000000000000086 000000005e844957 ffffffff812ea6b5 0000000002204020
[Thu Mar 17 05:54:02 2016] ffff88043fd83ab0 ffffffff8116d1aa 000000005e844957 0000000000000000
[Thu Mar 17 05:54:02 2016] ffff88043fff0b20 0000000000000100 0000000000000000 000000005e844957
[Thu Mar 17 05:54:02 2016] Call Trace:
[Thu Mar 17 05:54:02 2016] <IRQ> [<ffffffff812ea6b5>] ? dump_stack+0x5c/0x77
// ズンドコキヨシ 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