Skip to content

Instantly share code, notes, and snippets.

View yude's full-sized avatar

Takehiro Ogura yude

View GitHub Profile
@yude
yude / gist:d350a3f13e6701f5e36c8b1797e33e58
Created February 28, 2024 14:31
nftables で、特定のサブネット以外のトラフィックをマスカレードする
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0;
}
chain forward {
type filter hook forward priority 0;
hostname ix2215-tokyo
timezone +09 00
!
logging buffered 131072
!
no syslog ip enable
!
ip ufs-cache max-entries 20000
ip ufs-cache enable
ip route default Tunnel0.0
@yude
yude / svg2pdf.sh
Last active January 30, 2023 04:44
#!/bin/sh
# This script is for macOS and GNU/Linux.
# Check if rsvg-convert is installed on the system.
if ! command -v rsvg-convert &> /dev/null
then
echo "コマンド rsvg-convert (librsvg) がインストールされていません。"
echo "Homebrew などのパッケージマネージャから導入してください。"
exit
@yude
yude / BoardConfig-common.mk
Last active May 7, 2022 07:48
BoardConfig-common.mk for barbet (fix storage issue); Paste it to `device/google/redbull/BoardConfig-common.mk`
#
# Copyright (C) 2016 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@yude
yude / lol.css
Last active April 19, 2022 04:10
unipa.hiroshima-cu.ac.jp
@keyframes fuckColor{
0% { background-color: Magenta; }
33% { background-color: yellow; }
66% { background-color: Cyan; }
100% { background-color: Magenta; }
}
.headerBtn, .ui-c, .ui-widget-content, .ui-widget-header, .ui-commandlink, .textWeblearning {
animation: fuckColor 2s ease infinite;
}
12517[2022-04-10 03:30:38] VERBOSE[60317] res_pjsip/pjsip_options.c: Contact 300/sip:300@192.168.0.54:59980;ob is now Reachable. RTT: 8.165 msec
12518[2022-04-10 03:57:27] VERBOSE[60317] pbx_variables.c: Setting global variable 'SIPDOMAIN' to '192.168.0.80'
12519[2022-04-10 03:57:27] VERBOSE[60317] netsock2.c: Using SIP RTP Audio TOS bits 184
12520[2022-04-10 03:57:27] VERBOSE[60317] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field.
12521[2022-04-10 03:57:27] VERBOSE[60317] netsock2.c: Using SIP RTP Audio CoS mark 5
12522[2022-04-10 03:57:27] VERBOSE[118122][C-00000014] pbx.c: Executing [500@from-internal:1] Set("PJSIP/400-0000001a", "__RINGTIMER=15") in new stack
12523[2022-04-10 03:57:27] VERBOSE[118122][C-00000014] pbx.c: Executing [500@from-internal:2] ExecIf("PJSIP/400-0000001a", "0?Set(__CWIGNORE=)") in new stack
12524[2022-04-10 03:57:27] VERBOSE[118122][C-00000014] pbx.c: Executing [500@from-internal:3] Macro("PJSIP/400-0000001a", "exten-vm,novm,500,0,0,0") in new stack
12525[2022-04-10 03
BEGIN MESSAGE. cvxS3y4TKkkFIQX cnYadCFXxN3OKcr lCAt8BrGM2aontC e0XJYMIhrWx2Uup P5aDCLU95LzA15Q 1aSFffQ6JVdTCKq 6Xr2MZHgg6V6YzE deLmmUO4Orf822V aKFt9eZe5PEkinX BOtAFnhpNMdabmp kOs869Z9r1uqmHC Od8apLK5hDXjhOw 31fl8URKlwMLJfH rUylqugpRubBHTx XFlN. END MESSAGE.

Keybase proof

I hereby claim:

  • I am yude on github.
  • I am yude (https://keybase.io/yude) on keybase.
  • I have a public key ASDYIcC_sZx0_hF_cHKrHFCfPMAlop0pmbxf7eJRheHZwAo

To claim this, I am signing this object:

@yude
yude / bot.py
Created January 17, 2021 11:39
Discord のテキストチャンネルから systemd をこねくり回す
import discord
from discord.utils import get
import subprocess
import getpass
import tempfile
import os
client = discord.Client()
passwd = (getpass.getpass() + '\n').encode()
token = os.environ.get('DISCORD_TOKEN')
@client.event