Skip to content

Instantly share code, notes, and snippets.

View lo48576's full-sized avatar
✔️
activated

YOSHIOKA Takuma lo48576

✔️
activated
View GitHub Profile
@ThomasLeister
ThomasLeister / rspamd-whitelisting.md
Last active February 15, 2025 06:19
How to whitelist IP addresses or domains in Rspamd

Whitelist IP addresses based on pre-filter policy

/etc/rspamd/local.d/multimap.conf:

  IP_WHITELIST {
      type = "ip";
      prefilter = true;
      map = "/${LOCAL_CONFDIR}/local.d/ip_whitelist.map";
 action = "accept";
@fay59
fay59 / Quirks of C.md
Last active May 23, 2025 21:05
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@unarist
unarist / mastodon-add-older-newer-link.user.js
Last active July 7, 2022 19:32
Mastodon - Add older/newer link
@hcmiya
hcmiya / mastodon-ni-teikeibun-kino-wo-tukeru-yatu.user.js
Last active June 23, 2018 14:20
マストドンに定型文機能を付けるやつ
// ==UserScript==
// @name マストドンに定型文機能を付けるやつ
// @namespace https://js4.in/ns/
// @include *
// @version 1.0.11
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @author Miyagi Hikaru
// @website https://gist.github.com/hcmiya/3645e7ef572685c56e58fca5e1375e0e
@rinsuki
rinsuki / mastodon-compose-form-sticky.user.css
Last active February 25, 2018 11:02
Stylusで自分のMastodonインスタンス/web/*で読み込ませるようにして使ってね
.columns-area .drawer {
position:sticky;
left:0;
z-index:100;
background-color:rgba(25, 27, 34, 0.75);
}
.privacy-dropdown__dropdown {
z-index: 101;
}

トラップはよい機能だけど完全に信頼できるというわけではないよ。SIGKILLとSIGSTOPはトラップできない。

大昔のいくつかのUnixにはSIGKILLをトラップする怪しげな方法があった。もしプログラムがptraceされていたら、どのようなシグナルでも(SIGKILLでも)、そのプロセスを停止させてptraceをしている側のプロセスに通知するという動作になっていた。

そこで僕は"sh"という名前のプログラムを書いた。そのプログラムはメモリサイズを/bin/shと同じになるように注意深く調整したあと、fork & execして、子プロセスをptraceした。子プロセスは"superman"というプログラムだった。僕の偽shは、supermanが何らかのシグナルを受け取ると、そのシグナル番号をsupermanのメモリに書き込んだ後、つねにSIGINTでsupermanを再開するという動作になっていた。supermanのSIGINTハンドラはシグナル番号をみて面白メッセージを表示するようになっていた。

僕はそのプログラムを起動して、システム管理者のところにいって、何かプロセスがkillできないんだけど、と言った。システム管理者は^Cや^\を一応試した後、別の端末からログインしてrootになって、psでsupermanを見つけて、それをkill -9した。

「クリプトン星人にはSIGKILLは効かないぞ」と表示されてプロセスが動き続けているのを見た時の彼の顔といったらなかなかのものだった。

@qnighy
qnighy / lightnovel-report-2016-2017.md
Created December 31, 2017 15:58
2016年と2017年に読んだラノベ

2016年と2017年に読んだラノベ

2016年頃から、「なろう小説」を中心としたライトノベル熱が再燃して大量に読んだので、2017年末のこの機会に一行感想を書くことでまとめとしたいと思います。

条件

  • 漫画などは除外しています。
  • 「小説家になろう」のサイトで読んだものはここでは除外しています。主に読んでいるのは、「小説家になろう」発の書籍版のほうです。

注意事項

@unarist
unarist / mastodon-open-link-in-webui.user.js
Last active October 20, 2024 16:38
Mastodon - Open post link in WebUI
@pacochi
pacochi / mastodon_animate_emoji.user.js
Last active August 3, 2020 18:56
Mastodon の静的ページで絵文字を動かします。
// ==UserScript==
// @name [Mastodon] animate emoji on static pages
// @namespace hen.acho.co
// @include /^https?:\/\/[^\/]+\/(?:@\w+|users\/\w+\/(?:statuses|updates))\/\d+/
// @version 1.200804
// @description We can 👀 animated emoji without logging in!
// @downloadURL https://gist.github.com/pacochi/d1a8e019fdfc02235df7686af62d9895/raw/mastodon_animate_emoji.user.js
// @run-at document-idle
// @grant none
// ==/UserScript==
@sile
sile / rfc.md
Last active June 2, 2022 15:19
Rustの『RFC 2033: 実験的なコルーチン』の要約メモ