Skip to content

Instantly share code, notes, and snippets.

View otofune's full-sized avatar
👒

otofune

👒
View GitHub Profile
@otofune
otofune / README.md
Last active January 24, 2017 08:31
Misskey Config Sample

Misskey 設定ファイル サンプル集

情報

これらのファイルはそれぞれのsrc/config.tsを参考にしている。
WebについてはTravis Ciでビルドが通った最後のコミットDisplay title時を参考にしている。
現在は以降のコミットによりWebのjsonの書式が変更になっているので注意。
またWebのみビルド時に設定ファイルが存在しないとビルドできない。

必須環境

node、mongoDB、redis、graphicsmagickが動作する環境であれば問題がない
確認が取れているのはArchLinux、Ubuntu 16.04

@otofune
otofune / config-template.yml
Last active July 23, 2016 02:08
misskey-core's config-template
# Misskey API Configuration
### サーバーの管理者情報
# ex) "Your Name <youremail@example.com>"
maintainer: <string>
### APIアクセス時のパスワード
apiPass: <string>
### アクセスするときのドメイン
find . -type f | xargs sed -i -e "s/This API is Auth Required/This API requires Auth/g" -e "s/This API is Web Only/This API can only be called from Web/g" -e "s/This API is Web and Admin User Only/This API can only be called from Admin User at Web/g" -e "s/This API is No Parameters/This API has no parameters/g"
find . -type f | xargs perl -pi -e 's/\n\n+/\n\n/g'
@otofune
otofune / uuid.js
Last active March 6, 2017 09:07
アホUUIDジェネレーター
const uuid = () => {
const random = (range = 16) => Math.floor(Math.random() * range);
const hexadecimal = num => num.toString(16);
const array = new Array(30).fill().map(() => hexadecimal(random()));
const slice = (x,y) => array.slice(x,y).join('');
const pack = (delimiter, ...content) => content.join(delimiter);
return pack('-',
slice(0,8),
slice(8,12),
'4' + slice(12,15),

これなに?

これね、Ubuntuでのapt install letsencryptしたcertbot (だと思う) で自動更新するやつ。nginxで常時httpリクエストでの.well-known/acme-challenge/usr/share/nginx/letsencryptに通してると出来る

おきかた

全部を /etc/systemd/network においておもむろに systemctl start renewal.timer する、ついでに systemctl enable renewal.timer

{
"User-Agent": "~.*~",
"Disallow": "~(?:\/.*\/edit$)|(?:\/.*\/feed$)|(?:\/.*\/new$)|(?:\/.*\/private$)|(?:\/adcal)|(?:\/api)|(?:\/auth)|(?:\/drafts)|(?:\/follow)|(?:\/images)|(?:\/items)|(?:\/registration)|(?:\/search)|(?:\/settings)|(?:\/unfollow)|(?:\/users)|(?:\/.*\\?page\\=.*)|(?:\/.*&page\\=.*)|(?:.*\/contextual\\-ee)|(?:.*\/wrap\\-events)|(?:.*\/wrap\\-function)|(?:.*\/wrap\\-raf)|(?:.*\/wrap\\-xhr)~",
"Allow": "~(?:\/api\/.*\/docs$)~",
"Instant": false
}

Keybase proof

I hereby claim:

  • I am otofune on github.
  • I am otofune (https://keybase.io/otofune) on keybase.
  • I have a public key ASC4Jz8J0yrABZ-7p4RAAx13MmUuY_SGcaCX-lwDYFOaUAo

To claim this, I am signing this object:

import fetch, { Response, RequestInfo, RequestInit } from "node-fetch";
import toughCookie from "tough-cookie";
type ArgumentsOf<T extends Function> = T extends (...args: infer T) => any
? T
: void;
export type Fetch = (
info: RequestInfo,
init?: Omit<RequestInit, "headers"> & {
headers?: { [k: string]: string };
@otofune
otofune / ajl.md
Created March 6, 2023 12:04
ICTSC2022

原因・解決方法

2つあります。

1. protoc を実行するための共有ライブラリが不足している

Alpine Linux には最小限のライブラリしか入っていないため、そのままではバイナリが動作しません。 builder コンテナで ldd すると次の結果が得られます。

# ldd $(which protoc)
 /lib64/ld-linux-x86-64.so.2 (0x7f7f183d2000)