Skip to content

Instantly share code, notes, and snippets.

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

walkure walkure

🦆
鴨川ラジオ体操同好会
View GitHub Profile
#!/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 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'
})
@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 / ipbycc.py
Created October 14, 2020 18:25
指定地域のIPアドレス割り振り・割り当て一覧を作るスクリプト
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 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 / 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 / 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 / HTTProxy.cs
Created September 12, 2015 13:00
HttpListenerを使ってFiddlerCoreを代替してみた http://www2.hatenadiary.jp/entry/2015/09/12/220008
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Net;
using System.IO;
using System.Threading;
namespace KCB2
@walkure
walkure / wmr100.c.diff
Created October 18, 2014 05:11
workaround patch for https://github.com/barnybug/wmr100/ (commit d28e072) building/running on Raspbian(libzmq1 2.2.0+dfsg-2)
diff --git a/wmr100.c b/wmr100.c
index 9b43c21..d6f3153 100644
--- a/wmr100.c
+++ b/wmr100.c
@@ -271,6 +271,7 @@ void wmr_output_stdout(WMR *wmr, char *msg) {
}
void wmr_output_zmq(WMR *wmr, char *topic, char *msg) {
+ zmq_msg_t zmsg;
int len = strlen(topic) + 1 + strlen(msg);