Skip to content

Instantly share code, notes, and snippets.

Avatar
🌐
CATVインターネットを許すな

walkure walkure

🌐
CATVインターネットを許すな
View GitHub Profile
@walkure
walkure / .zshrc
Created Nov 25, 2021
zsh(Mac) configuration file
View .zshrc
# 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}+"
View keybase.md

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:

View .gitconfig
[alias]
st = status
co = checkout
br = branch
cp = cherry-pick
df = diff
cm = commit -m
unstage = reset -q HEAD --
uncommit = reset --mixed HEAD~
last = log -1 HEAD --format=format:"%Cred%H"
@walkure
walkure / imap2gmail.py
Created May 26, 2021
XOAUTH2対応のIMAP転送スクリプト Python雑移植
View imap2gmail.py
#!/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
XOAUTH2対応のIMAP転送スクリプト
View str2imap.rb
#!/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"
View oauth2.py
#!/usr/bin/python
#
# Copyright 2012 Google Inc.
#
# 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
#
@walkure
walkure / getTwitterFollower.py
Last active Feb 1, 2021
Twitterのフォロワー数を取得する (2021年2月版)
View getTwitterFollower.py
import requests
def getTwitterFollowers(username):
res = requests.options('https://api.twitter.com/1.1/guest/activate.json',
headers={
'access-control-request-method': 'POST',
'origin': 'https://twitter.com',
'user-agent':'Mozilla/5.0'
})
@walkure
walkure / result_of_mvn_archetype_generate.txt
Created Jan 12, 2021
mvn archetype:generate の実行結果 (2021/01/13)
View result_of_mvn_archetype_generate.txt
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.2.0:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.2.0:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
@walkure
walkure / ipbycc.py
Created Oct 14, 2020
指定地域のIPアドレス割り振り・割り当て一覧を作るスクリプト
View ipbycc.py
from netaddr import IPSet, IPRange, IPAddress
import requests
import time
rirs = (
'http://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest',
'http://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest',
'http://ftp.apnic.net/pub/stats/apnic/delegated-apnic-extended-latest',
'http://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest',
@walkure
walkure / rpi_cooler.py
Created Sep 6, 2017
Raspberry Piのファン制御スクリプト
View rpi_cooler.py
#!/usr/bin/python3
import RPi.GPIO as GPIO
def main() -> None:
tmp = get_cpu_temp()
print("CPU temp:{0}".format(tmp))
if(tmp > 60):
fan_control(True)