Skip to content

Instantly share code, notes, and snippets.

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

walkure walkure

🦆
鴨川ラジオ体操同好会
View GitHub Profile
@walkure
walkure / mdns.pl
Created November 14, 2016 14:47
Multicast DNS test code
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Socket::Multicast;
use Net::DNS::Packet;
my $target = '224.0.0.251';
my $port = 5353;
@walkure
walkure / nine_komaba.js
Created March 13, 2017 18:24
ないんたん駒場( http://sx9.jp/weather/tokyo.html )の情報を読み込んでCSVに変換
#!/usr/local/bin/node
const http = require('http');
const vm = require('vm');
const fs = require('fs');
const util=require('util');
const url = 'http://sx9.jp/weather/tokyo-komaba.js';
const dst = '/dev/shm/ninetan/';
@walkure
walkure / rpi_cooler.py
Created September 6, 2017 12:09
Raspberry Piのファン制御スクリプト
#!/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)
@walkure
walkure / slack.py
Created March 27, 2017 14:51
ZabbixからSlackへ通知を送る実装
#!/usr/bin/python
import json
import os
import sys
import pprint
import io
import requests
gyazo_token = 'GYAZO_TOKEN'
@walkure
walkure / _ininet_ssl_f.c
Created January 4, 2013 08:36
Irvine( http://hp.vector.co.jp/authors/VA024591/ )でオレオレSSL(証明書エラーが出る)なサーバからファイルを引っ張ってくるためのWinInet.dllハック http://www.chiyoclone.net/ からlistexp2.exe拾ってきて、Win32のWinInet.dllラッパを作り、HttpOpenRequestAとHttpSendRequestAの処理を上書きする。
#include <stdio.h>
#include <windows.h>
#include <WinInet.h>
#include "_ininet.h"
#define HINTERNET void*
EXTERN_C HINTERNET STDAPICALLTYPE d_HttpOpenRequestA(
__in HINTERNET hConnect,
__in_opt LPCSTR lpszVerb,
@walkure
walkure / result_of_mvn_archetype_generate.txt
Created January 12, 2021 16:11
mvn archetype:generate の実行結果 (2021/01/13)
[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 / getTwitterFollower.py
Last active February 1, 2021 17:29
Twitterのフォロワー数を取得する (2021年2月版)
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'
})
#!/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 / 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"
@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