Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
:outside_you:

Amane Katagiri amane-katagiri

🙃
:outside_you:
View GitHub Profile
@amane-katagiri
amane-katagiri / message.txt
Created Jul 19, 2022
Last weekend’s Revue outage
View message.txt
Between 1:30pm ET on Friday, June 8, and around 6:15pm ET on Saturday, June 9, the Revue website was inaccessible.
We are sorry for the inconvenience this caused, and would like to explain what happened.
First off, some things to know:
Scheduled newsletter issues that were sent during the outage will have impacted delivery, but this incident will not affect future delivery
Analytics and aggregated data regarding your newsletters continued normally
The problem was caused by a Domain Name System (“DNS”) issue, which affected Revue between the hours stated above. The team worked hard to resolve the issue as swiftly as possible.
Once the issue was resolved, Revue came back online for a lot of people — but DNS changes can take up to 24 hours to propagate globally, which led to some people experiencing the outage for longer than others.
We sincerely apologize and we have taken the feedback you have shared into account. Our @TwitterWrite team will ensure that transparent, clear communication continues t
@amane-katagiri
amane-katagiri / emoji_search.json
Created Jul 9, 2022
JSON file mapped from emoji alias to twemoji image (72x72 png).
View emoji_search.json
{
":grinning:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f600.png",
":smiley:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f603.png",
":smile:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f604.png",
":grin:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f601.png",
":laughing:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f606.png",
":satisfied:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f606.png",
":sweat_smile:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f605.png",
":joy:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f602.png",
":rofl:": "https://raw.githubusercontent.com/twitter/twemoji/master/assets/72x72/1f923.png",
@amane-katagiri
amane-katagiri / tokyu-stations.csv
Last active Jun 18, 2022
東急線全96駅の一覧
View tokyu-stations.csv
えきめい 駅名
あおばだい 青葉台
あざみの あざみ野
いけがみ 池上
いけじりおおはし 池尻大橋
いしかわだい 石川台
いちがお 市が尾
うのき 鵜の木
えだ 江田
えばらなかのぶ 荏原中延
@amane-katagiri
amane-katagiri / test-former.ics
Last active Jun 14, 2022
Complete/Corrupted iCalendar files, fetched from Proton Calendar. ( See https://ama.ne.jp/post/proton-calendar-0x85/ )
View test-former.ics
BEGIN:VCALENDAR
PRODID:-//Proton AG//ProtonCalendar 1.0.0//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:corrupted calendar
X-WR-TIMEZONE:Asia/Tokyo
REFRESH-INTERVAL;VALUE=DURATION:PT240M
X-PUBLISHED-TTL:PT240M
BEGIN:VTIMEZONE
@amane-katagiri
amane-katagiri / build.sh
Last active Jun 26, 2022
Single binary HTTP server written in Go embedded with all static files.
View build.sh
#!/bin/bash -ue
if [ "$#" -lt 3 ]; then
echo "$0 BINARY_PREFIX STATIC_ROOT_DIR OUTPUT_DIR" >&2
exit 1
fi
export GOVER=1.18
export SUGOI_SRC='https://gist.githubusercontent.com/amane-katagiri/7b9e09f27d329515f423c97da35335b1/raw/0d1867886128375e30383f7b9aa470ff337a68a5/sugoi.go'
export PREFIX="$1"
@amane-katagiri
amane-katagiri / remove-RG60289.txt
Last active Dec 22, 2021
みんなで翻訳(ミンナデホンヤク)RG60289 を新着作品一覧から取り除くブックマークレットです。
View remove-RG60289.txt
javascript:(function(){Array.from(document.querySelectorAll('.maker_name a')).filter(function(x){return x.href.endsWith('RG60289.html')}).map(function(x){x.closest('.n_worklist_item').remove()})})();
@amane-katagiri
amane-katagiri / main.md
Last active Sep 27, 2021
busybox crond と non-root cronfile
View main.md

/* この記事は、ライフ 人間と科学シリーズ(Plume)の閉鎖処理の一環として、投稿した情報の整理を行うために書かれた。 */

busybox crondでは、root所有ではないcronfileを黙ってスキップしてしまうらしい: dockerでBusyBox crondが動かない – numa blog

通常のcrondならエラーが出るっぽい: /etc/cron.dへ置くファイルにはownerとpermissionに制約があるっぽい - モヒカンメモ

$ echo '0 0 * * * root true' > root
$ docker run --rm -v $(pwd)/root:/etc/crontabs/root --init alpine timeout 3 \
  sh -c 'mount | grep /etc/crontabs/root; \
View example_twitter.json
{
"consumer_key": "",
"consumer_secret": "",
"token": "",
"token_secret": ""
}
View nextcloud-upload
#!/bin/bash -Cue
if [ $# -ge 2 ]; then
SRC="$1"
DST="$2"
else
echo "usage: $0 SRC DST" >&2
exit 1
fi
if [ -f "${HOME}/.nextcloud_token" ]; then
View Raspberry Pi 4 Model B - USB power ON-OFF - uhubctl.md

Issue

I want to USB power ON/OFF on Raspberry Pi 4.
Raspberry Pi 4でUSBパワーをON/OFFしたい。

Raspberry PiのUSBポートに直接LEDライトを接続してオンオフを試しました。
ここでは、https://github.com/mvp/uhubctl というユーティリティを使います。
https://github.com/codazoda/hub-ctrl.c も、だいたい同じことができるようですが、こちらの uhubctl の方が扱いやすそうだったので、こちらを選びました。

個別のUSBポートのパワーのON/OFFはできないようで、全てのUSBポートのパワーを一緒に操作しています。