- いにしえのscreen時代からのssh-agentが変にならない設定
- なにしてるかわからん
- moshがいいなってときもあったけどscreen->tmuxになって、いまはet+tmuxをつかってる
- moshはagent-forward/port-forwardできないから
- なんかへんなときがある
- etつかってるとなんかへんなときがあるような
- vscodeのターミナルも使いだして、なんかへんなときがふえたような?
- てきとうに再接続してごまかしてる
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 proxy(obj: any) { | |
return new Proxy(obj, { | |
set: function (target, property, value, receiver) { | |
console.log(`[proxy.set] property=${String(property)} value=${value}`); | |
return Reflect.set(target, property, value, receiver); | |
}, | |
get: function (target, property, receiver) { | |
const value = Reflect.get(target, property, receiver); | |
if (typeof value !== "function") { | |
console.log(`[proxy.get] property=${String(property)}`); |
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
set -xe | |
# INSTANCE=xxxxx | |
# ZONE=us-central1-a | |
# PROJECT=yyyyy | |
# #ACCELERATORTYPE="" | |
# ACCELERATORTYPE="nvidia-tesla-t4" | |
# #ACCELERATORTYPE="nvidia-tesla-v100" | |
# MACHINETYPE=n1-standard-2 |
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
# python -m venv .venv | |
# .venv/bin/python3 -m pip install google-cloud-storage chardet | |
# .venv/bin/python3 download.py gs://xxx/xxx/xxx.txt xxx.txt | |
import sys | |
from google.cloud import storage | |
from urllib.parse import urlparse | |
_, gsurl, output_path = sys.argv |
The simplest open protocol that is able to create a censorship-resistant global "social" network once and for all.
検閲に強いグローバルな「ソーシャル」ネットワークを一挙に構築することができる最もシンプルなオープンプロトコルです。
It doesn't rely on any trusted central server, hence it is resilient; it is based on cryptographic keys and signatures, so it is tamperproof; it does not rely on P2P techniques, therefore it works.
信頼できる中央サーバーに依存しないので弾力性があり、暗号鍵と署名に基づくので改ざん防止になり、P2P技術に依存しないので機能するのです。
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
# 0,10,20,30,40,50 * * * * /home/pi/switchbot_plug_onoff.sh on | |
# 2,12,22,32,42,52 * * * * /home/pi/switchbot_plug_onoff.sh off | |
#!/bin/bash | |
arg1="$1" | |
export SWITCHBOTDEVICEID=xxxxxxxxxxxx SWITCHBOTTOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
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
"""Delete old Slack messages at specific channel.""" | |
from datetime import datetime | |
from time import sleep | |
import json | |
import re | |
import sys | |
import urllib.parse | |
import urllib.request | |
import os |
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/bash | |
#PING_HOST=192.168.0.1 | |
PING_HOST=$1 | |
if [ -z "$PING_HOST" ] ; then | |
logger "PING_HOST missing." | |
exit 1 | |
fi |
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
# /etc/systemd/system/shutdown_by_usb.service | |
[Unit] | |
Description=shutdown_by_usb | |
[Service] | |
Type=simple | |
ExecStart=bash -c 'while : ; do if [ -e /sys/bus/usb/devices/1-1.2 ] ; then echo "shutdown_by_usb!"; sleep 5; sudo shutdown -h now; sleep 60; else true; fi; sleep 1; $ | |
Restart=always |
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/[email protected] | \
sudo tee /etc/systemd/system/[email protected]
sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
NewerOlder