Skip to content

Instantly share code, notes, and snippets.

View walkure's full-sized avatar
🦆
鴨川ラジオ体操同好会

walkure walkure

🦆
鴨川ラジオ体操同好会
View GitHub Profile
/*
* jjy_sender.c
* $ gcc -O2 -DIS_GPIOD_V2=0 -DGPIO_LINE_NUMBER=18 -DCHIP_PATH='"/dev/gpiochip1"' -DCONSUMER='"my_custom_sender"' jjy_sender.c -o jjy_sender -lgpiod
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
@walkure
walkure / worker.js
Last active April 30, 2026 13:07
YoutubeのRSS Feedが返す404をfeed readerに無視させるCloudflare Worker
export default {
async fetch(request, env, ctx) {
const url = new URL(request.url);
// 1. クエリパラメータまたはパスから channel_id を取得
// 例: https://worker-name.subdomain.workers.dev/?channel_id=UC...
// 例: https://worker-name.subdomain.workers.dev/UC...
let channelId = url.searchParams.get("channel_id") || url.pathname.split("/")[1];
const channelIdRegex = /^UC[a-zA-Z0-9_-]{22}$/;
@walkure
walkure / pfnull.c
Last active April 10, 2026 18:36
pfclientのログを黙らせ、NTP問い合わせをNICTに変更
/*
$ gcc -Wall -fPIC -shared -o pfnull.so pfnull.c -ldl
export LD_PRELOAD=/usr/local/lib/pfnull.so
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <dlfcn.h>
#include <stdarg.h>
#include <string.h>
@walkure
walkure / slack_reporter.pl
Last active February 14, 2025 12:15 — forked from acidlemon/slack_reporter.pl
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use 5.014;
use Encode;
use JSON::PP qw/encode_json decode_json/;
use Sys::Hostname;
use IPC::Open2;
@walkure
walkure / cf_updater.pl
Created May 16, 2023 13:04
Set Cloudflare IP Addresses to ipset and real_ip(nginx)
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
use Digest::MD5 'md5_hex';
my $prefix = 'cloudflare-origin';
updatelist('v4');
@walkure
walkure / cf_nginx.pl
Created May 15, 2023 16:12
Set Cloudflare IP Addresses to nginx real_ip
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
my $prefix = 'cloudflare-origin';
die "ERR: requires one argument: output file path" unless scalar @ARGV == 1;
@walkure
walkure / cf_ipset.pl
Created March 5, 2023 17:15
Set Cloudflare IP Addresses to ipset
#!/usr/bin/env perl
use strict;
use warnings;
use HTTP::Tiny;
my $prefix = 'cloudflare-origin';
updatelist('v4');
@walkure
walkure / kustdiff.yaml
Created December 11, 2022 13:00
GitHub Action for showing diff of kustomized ArgoCD Application
name: Show kustomized Application diff
on:
pull_request:
paths:
- '**.yaml'
- '**.yml'
jobs:
enumerate:
name: Enumerate ArgoCD Applications
@walkure
walkure / util.cpp
Last active February 19, 2022 10:04
Arduino便利関数
// Streamから一行読み込む関数
String readLine(Stream* s){
String ret;
bool start = false;
while(true){
int ch = s->read();
if(ch < 0){
return ret;
}
@walkure
walkure / .zshrc
Created November 25, 2021 07:05
zsh(Mac) configuration file
# home/end key
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# git
autoload -Uz vcs_info
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr "%F{magenta}!"
zstyle ':vcs_info:git:*' unstagedstr "%F{yellow}+"