Skip to content

Instantly share code, notes, and snippets.

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

walkure walkure

🦆
鴨川ラジオ体操同好会
View GitHub Profile
@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}+"

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@walkure
walkure / .gitconfig
Last active August 1, 2023 06:59
git config
[alias]
st = status
co = checkout
sw = switch
br = branch
cp = cherry-pick
df = diff
cm = commit -m
unstage = reset -q HEAD --
uncommit = reset --mixed HEAD~
@walkure
walkure / imap2gmail.py
Created May 26, 2021 04:57
XOAUTH2対応のIMAP転送スクリプト Python雑移植
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import imaplib
from oauthlib.oauth2 import BackendApplicationClient
import urllib.request
import json
import datetime
@walkure
walkure / str2imap.rb
Created May 25, 2021 17:26
XOAUTH2対応のIMAP転送スクリプト
#!/usr/bin/ruby
require 'net/imap'
require 'oauth2'
IMAP_SERV = 'imap.gmail.com'
IMAP_PORT = 993
IMAP_SSL = true
folder = ARGV[0] || 'INBOX'
user = 'GMailアドレス'
pass = "XOAuth2 Refresh Token"