Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
VUIでシェル芸を実行できるようにしてみた
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
amanoese
August 10, 2019
Technology
2.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
VUIでシェル芸を実行できるようにしてみた
第43回シェル芸勉強会(2019/8/10)のLTで発表した内容です。
amanoese
August 10, 2019
More Decks by amanoese
See All by amanoese
BLEデバイスシェル芸
amanoese
0
17
魔術式シェル芸
amanoese
0
1.3k
シェル芸でなれるVTuber!
amanoese
0
970
Technopop shell-gei(テクノポップシェル芸)
amanoese
0
570
Alexaアカウントリンクの認証と申請で躓いた話
amanoese
0
110
シェル芸のおかげでUnicodeに怯えず楽しめるようになった話
amanoese
0
270
AlexaにSSMLで音声記号(IPA) 使って喋らせたかった
amanoese
0
530
インタラクティブなシェル芸実行コマンド作った感想
amanoese
0
210
静的WEBサイトをSPA化するワンライナー
amanoese
0
160
Other Decks in Technology
See All in Technology
構造で守らせる データ・法務・セキュリティ・開発チームとつくる AI時代のデータガバナンスとデータ基盤のリアル
legalontechnologies
PRO
3
700
AI AgentによるEmbedded SREの取り組み
tgidgd
1
300
キヨさん、67歳。AIコーディングエージェントに挑む
happysamurai294
0
130
Patterns in AI Driven Software Development
akosma
PRO
0
390
慶應義塾大学 AI実践05 論文執筆の仕組み化
keio_smilab
PRO
1
1.1k
Obsidian Vault Architectures
x5gtrn
PRO
0
220
素人でもできた!AIを使った短編小説創作入門
delhi09
PRO
0
270
AI Search (Foundry IQ) におけるRAGデータの準備と配置
ryomaru0825
1
110
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
2.6k
渡米前の準備を制す!re:Invent 2026徹底準備術 / The Ultimate Preparation Guide for re:Invent 2026
yuj1osm
1
460
バイブコーディングの特徴と「コケて直す」ループ
happysamurai294
0
130
Agent × Maestro で始める モバイル E2E 端末準備からテスト実行・結果確認まで
sansantech
PRO
0
240
Featured
See All Featured
Docker and Python
trallard
47
4.2k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Unsuck your backbone
ammeep
672
58k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Building Applications with DynamoDB
mza
96
7.3k
Rails Girls Zürich Keynote
gr2m
96
14k
Navigating Team Friction
lara
192
16k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
570
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Transcript
VUIでシェル芸を実行できるよう にしてみた
自己紹介 RustとElmに憧れてる自称うぇっぶけいふるすたっくえ んじにあ javascriptとシェル芸が好き 仕事では Java kotlin使い始めました taka@SIではたらくフレンズ @amanoese
VUIってなに? AlexaとかGoogle のスマートホームとか音声で操作するユーザーインターフェー スのこと 個人的にはAlexaが好き
VUIでシェル芸をしたい rm -rf / unko.shout
Alexaに実装してみた
シェル芸をどうやって音声で伝えるか
シェル芸 -> Base32 -> ひらがな Base64をひらがなにマップすると半濁音鼻濁音の発音難しいため シェル芸をBase32に変換後ひらがなにマップした発音をAlexaにする。 つまりこういうこと $ echo
'unko.shout 私が公式マスコット' | base32 -w0 | sed 'y@ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=@あいうえおかきく けこさし すせそたちつてとなにぬねのはひふへほまみむ@' そにねきぬふはそそせなきまほしなおえとひたあたえちききそしいせす へぬまけみのへえとふつのかそたえちさはまくあへえへそいのちうちむ
シェル芸 -> Base32 -> ひらがな しかし… さすがに脈絡の無い単語を発音するのは困難(やってみてわかった) なのでVUIを意識して変更してみる そにねきぬふはそそせなきまほしなおえとひたあたえちききそしいせす へぬまけみのへえとふつのかそたえちさはまくあへえへそいのちうちむ
シェル芸 -> dump echo -n 'unko.shout 私が公式マスコット' | od -tx1
-A n|tr '[:lower:]' '[:upper:]' 75 6E 6B 6F 2E 73 68 6F 75 74 20 E7 A7 81 E3 81 8C E5 85 AC E5 BC 8F E3 83 9E E3 82 B9 E3 82 B3 E3 83 83 E3 83 88
そして呪文(詠唱)を集めたJSONを用意 適当に集めてきた呪文(詠唱)をMecabで名詞と動詞に分けて、 0~FFまでの数字と対応付けたJSONファイルを作成します。 cat spell.txt | mecab | tr '\t'
,|awk -F, '$2~/名詞/||$1~/EOF/{print s;a=1;s=$1}a==2{a=0;s=""}a==1&&$2~/助詞/{a=0;if($3~/連体化 /){a=2}s=s$1}'|sed -n '/../p'|sort -u |grep -P '\p{Han}' paste - 255.txt | head -256 | sed -r 's/^(.*)\t/\"\1\":/;s/:(.*)/:"\1",/'| sed '1s/^/{/;256s/,/}/' > meisi.json {"安らぎ":"00","為す":"01","移る":"02","育み":"03","育む":"04","引き":"05","引き継 が":"06","引き裂く":"07","羽ばたき":"08","渦巻く":"09","汚し":"0A","汚れ":"0B","汚 れた":"0C", ... } https://gist.github.com/amanoese/92ee02989a1e3371981a96aa8dce36c1
シェル芸 -> dump -> 呪文 JSONを利用してシェル芸を呪文に変換 $ echo -n 'unko.shout
私が公式マスコット' | od -tx1 -A n|tr '[:lower:]' '[:upper:]' | xargs -n1 | sed -f <(cat meisi.json meisi.json meisi.json dousi.json |tr -d '{},'|sed -r 's#^$##;s#(.*):(.*)#s\2:\1#;s#:"##;s#"#/#g'|awk '$0'|awk '{print int((NR-1)/256 + 1)"~4"$0}') |sed '4~4s/$/。/'|tr -d \\n 客を希望を眼差しで示せ。永久に鬼を棺に示せ。客を義務を印を討つ。光に狭間の 雫よ囚われ。空を七色の極限の吹き飛べ。七色の砂の結晶渡れ。胸に言の雫よ終 わり。魂を雫よ狭霧清め。雫よ胸に胸に渡れ。胸に具現
かっこよく呪文を唱えて シェル芸を実行 客を希望を眼差しで示せ。永久に鬼を棺に示せ。客を義務を印を 討つ。光に狭間の雫よ囚われ。空を七色の極限の吹き飛べ。七 色の砂の結晶渡れ。胸に言の雫よ終わり。魂を雫よ狭霧清め。 雫よ胸に胸に渡れ。胸に具現
かっこよく呪文を唱えて シェル芸を実行 実際にデモ
感想とか今後とか がんばってリリース目指す(Alexaスキルアワード参加させてみたい) 生成した文言が呪文ぽくないので、良い感じになるように修正したい ツイートするだけでなく実際にシェルを実行するようにしたい
None