This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (c) 2023 Shiro Miminashi Nohara | |
# Released under the MIT license | |
# https://opensource.org/licenses/mit-license.php | |
# | |
# USAGE 使い方: | |
# $ wget -q -O - https://gist.githubusercontent.com/miminashi/7a7d6896419b2c4a79d6ff6a29454770/raw | sh -s | |
# # rootで実行する場合 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! TabWinNext() abort | |
let l:max_tab_number = tabpagenr('$') | |
let l:current_tab_number = tabpagenr() | |
let l:max_window_number = winnr('$') | |
let l:current_window_number = winnr() | |
if l:current_window_number < l:max_window_number | |
let l:next_window_id = win_getid(l:current_window_number + 1) | |
call win_gotoid(l:next_window_id) | |
elseif l:current_tab_number < l:max_tab_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 使い方: | |
# $ url="https://gist.githubusercontent.com/miminashi/f83a967f8c1a74dcb927aeb90947d766/raw"; (curl -L "${url}" || wget -O - "${url}") > /tmp/setup_tinc.sh; sudo sh /tmp/setup_tinc.sh <ノード名> <IPアドレス> | |
# $ url="https://bit.ly/3P7PumJ";(curl -L "${url}" || wget -O - "${url}") > /tmp/s; sudo sh /tmp/s <ノード名> <IPアドレス> | |
# | |
if test -d /etc/tinc/gsnet; then | |
printf 'エラー: /etc/tinc/gsnet は既に存在します\n' | |
printf 'セットアップを中止します\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (c) 2021 Shiro Miminashi Nohara | |
# Released under the MIT license | |
# https://opensource.org/licenses/mit-license.php | |
# | |
# USAGE 使い方: | |
# curl -s https://gist.githubusercontent.com/miminashi/19873ba70222981302e4f93a862433e0/raw | sh -s | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# run.sh | |
# | |
# 使い方: | |
# chmod +x run_mp.sh | |
# ./run.sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# dping | |
# | |
# 説明: | |
# 並列pingツール. | |
# 標準入力からホストの一覧を受け取り, 複数のホストに対して並列にpingを実行する. | |
# | |
# 使い方: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Copyright (c) 2021 Shiro Miminashi Nohara | |
# Released under the MIT license | |
# https://opensource.org/licenses/mit-license.php | |
# | |
# USAGE 使い方: | |
# - Armbianの初回起動後、 root/1234 でログインして、`pi`ユーザを作成する | |
# - 以下のコマンドを実行する |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# USAGE 使い方: | |
# $ curl -L https://gist.githubusercontent.com/miminashi/c9db10e278101fe09d77177eb19ed34a/raw | USERNAME=hoge sh -s | |
# | |
echo "${USERNAME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 表 | |
curl -s "https://www.e-stat.go.jp/stat-search/file-download?statInfId=000031881367&fileKind=1" | iconv -f sjis -t utf8 | tail -n +39 | cut -d ',' -f 1-3 | tr ',' ' ' | awk '{print($1, $2, $3, $3*100/$2)}' | awk 'BEGIN{print("年次", "届出総数", "〜19歳", "割合(%)")} {print $0}' | column -t -s ' ' | |
# グラフ | |
curl -s "https://www.e-stat.go.jp/stat-search/file-download?statInfId=000031881367&fileKind=1" | iconv -f sjis -t utf8 | tail -n +39 | cut -d ',' -f 1-3 | tr ',' ' ' | awk '{print($1, $2, $3, $3*100/$2)}' | feedgnuplot --domain --lines --points --title "marriage" --y2 2 --unset grid --terminal 'dumb 120,50' --exit --legend 0 "number, total" --legend 1 "number, women under 19" --legend 2 "percent, women under 19" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# USAGE 使い方: | |
# pi@raspberrypi$ export GITHUB_USERNAME=<your username> | |
# pi@raspberrypi$ export NEW_HOSTNAME=<new hostname> | |
# pi@raspberrypi$ export SSH_RPFW_SERVER=<new hostname> | |
# pi@raspberrypi$ export SSH_RPFW_SERVER_PORT=<new hostname> | |
# pi@raspberrypi$ export SSH_RPFW_PORT=<new hostname> | |
# pi@raspberrypi$ export SSH_RPFW_HOST_KEY=<new hostname> |
NewerOlder