Skip to content

Instantly share code, notes, and snippets.

View amane-katagiri's full-sized avatar

Amane Katagiri amane-katagiri

View GitHub Profile
@amane-katagiri
amane-katagiri / custom.css
Created January 11, 2021 18:48
https://forum.amane.moe/ で default-dark/theme.css に追加して使用しているCSS (under GNU Affero General Public License v3.0)
.h-entry {
min-width: 80%;
min-height: 0;
}
.h-entry main {
margin: 0 20px;
}
.card h3 {
margin: 20px;
}
@amane-katagiri
amane-katagiri / dnskey_to_dsrecord.py
Created December 21, 2020 00:56 — forked from wido/dnskey_to_dsrecord.py
Calculate DS record from DNSKEY with Python 3
"""
Generate a DNSSEC DS record based on the incoming DNSKEY record
The DNSKEY can be found using for example 'dig':
$ dig DNSKEY secure.widodh.nl
The output can then be parsed with the following code to generate a DS record
for in the parent DNS zone
@amane-katagiri
amane-katagiri / compare-ujisv-jlreqv.md
Last active December 28, 2021 10:34
jlreqのJFMで区切り約物後ろのアキを入れるようにする
ujisv jlreqv glue from !? glue to !?
0 0 1.0 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 0, 0, 0, kanjiskip_shrink=1
1 (〔[{〈《「『【⦅〘〖«〝‘“ 0.5 , 0.0, 0.5, ratio=1, kanjiskip_stretch=1 0, 0, 0, kanjiskip_shrink=1
2 )〕]}〉》」』】⦆〙〗»〟’” 0, 0, 0, kanjiskip_shrink=1 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1
6 4 !?‼⁇⁈⁉ 0, 0, 0, kanjiskip_shrink=1 0, 0, 0, kanjiskip_shrink=1
3 5 ・:; 0.75, 0.0, 0.25, priority=1, ratio=1 0.25, 0.0, 0.25, priority=1, ratio=1
4 6 。. 0, 0, 0, kanjiskip_shrink=1 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1
2 7 、, 0, 0, 0, kanjiskip_shrink=1 0.5 , 0.0, 0.5, ratio=0, kanjiskip_stretch=1
5 8 —…‥〳〴〵 0, 0, 0, kanjiskip_shrink=1 0, 0, 0, kanjiskip_shrink=1
@amane-katagiri
amane-katagiri / dns-01-auth-netlify.sh
Last active July 19, 2022 00:52
/etc/letsencrypt/scripts/dns-01-auth-netlify.sh
#!/bin/sh
API_TOKEN='YOUR_NETLIFY_API_TOKEN'
if [ "$CERTBOT_VALIDATION" != "" ] && [ "$CERTBOT_DOMAIN" != "" ]; then
DNS_ZONE_ID=$(curl -Ss \
-H 'Authorization: Bearer '"$API_TOKEN" \
'https://api.netlify.com/api/v1/dns_zones' \
| jq -r '(.[] | select(.name == "'"$CERTBOT_DOMAIN"'")).id')
curl -Ss -X POST \
-H 'Content-Type: application/json' \
@amane-katagiri
amane-katagiri / danime_list.sh
Last active July 5, 2020 11:58
ランダム・アニメ・ピックアップ
#!/bin/bash -Ceu
URL_ROOT='https://anime.dmkt-sp.jp/animestore/rest/WS000108'
LENGTH=300
for KANA_COLUMN in $(seq 1 10); do
for KANA_ROW in $(seq 1 5); do
TEMP=$(mktemp)
curl -o $TEMP -Ss "$URL_ROOT"'?workTypeList=anime&length='"$LENGTH"'&initialCollectionKey='"$KANA_COLUMN"'&consonantKey='"$KANA_ROW"'&vodTypeList=svod_tvod'
ERROR="$(cat $TEMP | jq -r '.error.code')"
if [ "$ERROR" == "null" ]; then
@amane-katagiri
amane-katagiri / girondl
Last active May 18, 2020 03:25
画像で議論
#!/bin/bash -eu
GIRON_URL='https://rara.jp/giron/photo'
DOWNLOAD_DIR=$HOME/Pictures/tmp
MAX_PAGE=10
CURSOR=$DOWNLOAD_DIR/.last_download_url
VERBOSE=0
CURL_OPT="-Ss"
if [ $# -gt 0 ]; then
if [ "$1" = "-v" ]; then
@amane-katagiri
amane-katagiri / suiseiseki.txt
Created February 16, 2020 11:59 — forked from neon-izm/suiseiseki.txt
インターネットの海に漂っていたコピペをアーカイブしておきます。
あまりにも翠星石が好きすぎたから地域の家出少女の掲示板探して12万用意して釣った19歳無職女に1週間翠星石コス&口調マネさせて暮らさせた最終的に4日目で逃げられたけど……
翠星石としては駄目だったよ
そもそも衣装はLLで女のサイズはMでブカブカ
タバコ吸うし茶髪と金髪混じってるしリスカしてるし
マトモに演じられるタマではなかった
でも2日目あたりの「◯◯さん冷蔵庫のアイス食べていいんですぅ?」は今も心に残ってる
ていうか「逃げたかったら別に逃げてもいいよ」って言ってたし
@amane-katagiri
amane-katagiri / build-python.sh
Last active July 30, 2020 02:44
パイソンのビルドは温かみのある手で
#!/bin/bash -ue
VERSION="$1"
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
libjpeg-dev libncurses5-dev libncursesw5-dev liblzma-dev tk-dev xz-utils libffi-dev \
libgdbm-dev libdb-dev libffi-dev uuid-dev wget
cd /tmp
wget -O - "https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz" | tar zxvf -
@amane-katagiri
amane-katagiri / pdfpun.sh
Last active May 6, 2020 09:18
pdfpun互換
#!/bin/bash -ue
INFILE=$1
if [ $# -ge 2 ]; then
OUTFILE=$2
else
OUTFILE=nup-$1
fi
pdfjam $INFILE --a5paper --reflect true -o /dev/stdout | pdfjam /dev/stdin --nup 2x1 --a4paper --landscape --reflect true -o $OUTFILE
@amane-katagiri
amane-katagiri / main.py
Created November 30, 2019 16:35
Write access log in JSON.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
import json
import logging
import os
import uuid