Skip to content

Instantly share code, notes, and snippets.

View ttdoda's full-sized avatar

IWAMOTO Kouichi ttdoda

  • Kanagawa, Japan
View GitHub Profile
@ttdoda
ttdoda / resize.bash
Created November 19, 2023 16:12
xterm付属のresizeコマンドのbashスクリプトによる手抜き再実装
#!/bin/bash
#
# resize.bash -- resize コマンドの手抜き再実装 (bashスクリプト)
#
# xterm の付属コマンド resize[*1] の機能の内、端末(エミュレータ)の現在の
# サイズを調べて TTY の設定を合わせる機能の実装例です。
#
# 原理:
# rubyスクリプト版[*2]を参照
#
@ttdoda
ttdoda / dososuko.ttl
Created August 2, 2022 15:13
ドドスコ
strdim w 2
w[0] = "ドド"
w[1] = "スコ"
f1 = 4
f2 = 0
until f1 == 3 && f2 == 2
random n 1
dispstr w[n]
@ttdoda
ttdoda / teraterm-us-userkey.cnf
Last active January 29, 2021 11:36
JPキーボード設定のWindowsをUSキーボードで使うためのTera Termユーザキー設定
[User keys]
User1=515,0,@
User2=519,0,^
User3=520,0,&
User4=521,0,*
User5=522,0,(
User6=523,0,)
; - はキーが一致するので設定不要
;User7=12,0,-
User7=524,0,_
@ttdoda
ttdoda / gist:6b7afecfacf1363a0ed388b0c8dd1e28
Created August 12, 2020 09:39
OpenSSH 8.2/8.3でのchacha20-poly1305の速度比較
sue@hiyo% repeat 10 test/openssh/8.2/bin/scp -P 8222 -o Ciphers=chacha20-poly1305@openssh.com scptest.dat localhost:/dev/null
scptest.dat 100% 1024MB 82.1MB/s 00:12
scptest.dat 100% 1024MB 79.5MB/s 00:12
scptest.dat 100% 1024MB 80.3MB/s 00:12
scptest.dat 100% 1024MB 80.1MB/s 00:12
scptest.dat 100% 1024MB 80.7MB/s 00:12
scptest.dat 100% 1024MB 80.5MB/s 00:12
scptest.dat 100% 1024MB 78.2MB/s 00:13
scptest.dat
@ttdoda
ttdoda / ng-1.5beta1-utf8-fix2byteinput.patch
Created July 3, 2020 03:48
ng-1.5beta1-utf8に対する2byte utf-8の入力の修正
--- kanji.c.orig 2020-07-03 12:30:37.251639000 +0900
+++ kanji.c 2020-07-03 12:30:41.693271000 +0900
@@ -1018,9 +1018,11 @@
buf[0] = (char)c1;
buf[1] = (char)getkbd();
- if (!(c1 & 16))
+ if (!(c1 & 32)) {
+ /* nothing to do */
+ } else if (!(c1 & 16)) {
sue@taiyo% repeat 10 zsh -c 'ssh 192.168.56.53 rm -f benchmark3; time rsync benchmark3 192.168.56.53:'
rsync benchmark3 192.168.56.53: 9.16s user 4.13s system 54% cpu 24.191 total
rsync benchmark3 192.168.56.53: 9.16s user 4.01s system 55% cpu 23.929 total
rsync benchmark3 192.168.56.53: 9.09s user 4.10s system 54% cpu 24.172 total
rsync benchmark3 192.168.56.53: 9.20s user 4.11s system 55% cpu 24.163 total
rsync benchmark3 192.168.56.53: 9.10s user 4.02s system 53% cpu 24.397 total
rsync benchmark3 192.168.56.53: 9.24s user 4.22s system 55% cpu 24.085 total
rsync benchmark3 192.168.56.53: 9.11s user 4.04s system 54% cpu 24.182 total
rsync benchmark3 192.168.56.53: 9.18s user 4.04s system 55% cpu 24.034 total
rsync benchmark3 192.168.56.53: 8.98s user 4.00s system 53% cpu 24.107 total
sue@taiyo% wc test.dat
12780000 39280001 391120000 test.dat
sue@taiyo% repeat 10 time sed '/\(\)/d' test.dat
sed '/\(\)/d' test.dat 2.38s user 0.08s system 99% cpu 2.458 total
sed '/\(\)/d' test.dat 2.56s user 0.06s system 99% cpu 2.626 total
sed '/\(\)/d' test.dat 2.48s user 0.07s system 99% cpu 2.556 total
sed '/\(\)/d' test.dat 2.53s user 0.08s system 99% cpu 2.607 total
sed '/\(\)/d' test.dat 2.49s user 0.07s system 99% cpu 2.560 total
sed '/\(\)/d' test.dat 2.42s user 0.08s system 99% cpu 2.515 total
sed '/\(\)/d' test.dat 2.55s user 0.09s system 97% cpu 2.717 total
@ttdoda
ttdoda / dracula.ini
Created November 6, 2019 03:19
Tera Term用Dracula Color Theme
; Tera Term用 Dracula Theme 設定
; https://draculatheme.com
;
; License: CC0
;
; 以下の設定を、TERATERM.INI内の同じ設定と置き換えてください
; VTBoldColor, VTBlinkColor, URLColor の設定は適当なのでお好みに合わせて調整してください
;
[Tera Term]
ANSIColor=0,0,0,0, 1,255,110,103, 2,90,247,142, 3,244,249,157, 4,202,169,250, 5,255,146,208, 6,154,237,254, 7,230,230,230, 8,104,104,104, 9,255,85,85, 10,80,250,123, 11,241,250,140, 12,202,169,250, 13,255,121,198, 14,139,233,253, 15,191,191,191
@ttdoda
ttdoda / KEYBOARD-micro.cnf
Last active June 19, 2019 05:07
Tera Termでmicroを使う為のキーボード設定
;
; Tera Term で micro https://github.com/zyedidia/micro を使う為に必要なキーボード設定
;
; Shortcut keysセクションの以下の設定を変更する
[Shortcut keys]
; Ctrl + up-arrow
LineUp=off
; Ctrl + down-arrow
LineDown=off
@ttdoda
ttdoda / basicauth.txt
Created May 8, 2019 03:38
踊る大捜査線 THE MOVIEでのTera Termの表示内容とデコード結果
bWFzaGl0YTp5dS1zdWtl mashita:yu-suke
a2FubmRhOmtpdGFtdXJh kannda:kitamura
c2hpbWFkdTpoYW1hZGE= shimadu:hamada
YWtpeWFtYTpzYWl0b3U= akiyama:saitou
bmFrYW5pc2hpOmtvYmF5YXNoaQ== nakanishi:kobayashi
bW9yaXNoaXRhOnRvdXlhbWE= morishita:touyama
b2dhdGE6a291bW90bw== ogata:koumoto
a2Vpa286eXVrYQ== keiko:yuka
eW91a286bmFnaW5l youko:nagine
dGFla286dGFla28= taeko:taeko