end0tknr's kipple - web写経開発

太宰府天満宮の狛犬って、妙にカワイイ

2020-05-01から1ヶ月間の記事一覧

wget for linux でサイトをクローリング(スクレイピング?)する際の自分流オプション

おおよそ、次のようなオプションでdownloadすることで、 localにサイトのクローンを作成できてきます。 最近の世の中には、サイトクロールを行う高機能?なツールも存在すると思いますが、 wgetも十分すぎる程、高機能で、以下の他にも大量のoptionがあります…

情報銀行 - 情報信託機能の認定スキームの在り方に関する検討会

「情報銀行」って、その単語自体は分かりやすいのですが、何よりユースケースが思い浮かばない。 総務省の文書を読み返してみましたが、やっぱり理解できない。 ブロックチェーン同様、流行り言葉に向かう気がします。 総務省|情報信託機能の認定スキームの…

urllib.request for python における proxy 経由での http get

import urllib.request as req proxy = req.ProxyHandler({'http': r'$user_id:$user_pw@proxy_host:80'}) auth = req.HTTPBasicAuthHandler() opener = req.build_opener(proxy, auth, req.HTTPHandler) req.install_opener(opener) conn = req.urlopen('ht…

python で smb 接続し、dir以下を再帰探索

以下のように書くと、よさそう #!/usr/local/bin/python # -*- coding: utf-8 -*- import datetime import os import sys import platform from smb.SMBConnection import SMBConnection import time conf = {"user_id":"ないしょ", "user_pw":"ないしょ", "…

install modsecurity ver.2.9.3 (FOSS WAF) from source to apache 2.4 + centos8

ファイアウォール系の仕組みは、実運用に向けたルール選定や設定が非常に難しい。 特にWAFは単純導入だけでは、検知できないケースがあるだけでなく、過検知によりサービス不能に陥る。 2010年のIPAによる「オープンソースWAF「ModSecurity」導入事例 ~ IPA…

install clamav-0.102.3 from src to centos 8

過去、数回installしていますが、これまでのメモが不十分でしたので、再度、お試し 参考url https://www.clamav.net/ https://clamav-jp.osdn.jp/jdoc/clamav.html https://end0tknr.hateblo.jp/entry/20180408/1523163676 https://metacpan.org/pod/File::S…

IISへのSSL証明書登録には、linuxで使用する公開鍵(PEM)形式でなくPKCS#12(pfx)形式で

openssl による PKCS#12(pfx)形式への変換 秘密鍵も用意した上で、以下のopensslコマンドで変換できます。 $ openssl pkcs12 -export -inkey private.key -in ssl.crt -out ssl.pfx Enter Export Password: Verifying - Enter Export Password: IISサーバへ…

Google Maps Platform Directions API + python による道路距離計測

以下を参考に、python による http request の練習 cloud.google.com qiita.com で、以下の通り #!/usr/local/bin/python # -*- coding: utf-8 -*- import json import urllib import urllib.request import urllib.parse import sys conf = \ {"req_url" : …

国交省 - 新型コロナウイルス感染症対策のため、暫定的な措置として、建築士法に基づく重要事項説明について、対面ではない、ITを活用した実施が可能となりました

「暫定」といっても、もとの「対面説明」に戻すのは難しいと思います www.mlit.go.jp

social-app-django for pytho による google oauth ログイン (social login/auth)

https://nmomos.com/tips/2019/07/05/django-social-auth/ google の oauth を使用したログインを実現する為、 上記urlの google 関連部分を写経。 TODO 今回は、social-app-django を使用しましたが、 django-allauth の方が、多くの oauth provider に対応…

re: 動かして学ぶ!Python Django開発入門

軽量ScriptやWeb Application Framework の基礎があれば、 写経を迷わず進めることができる。 www.shoeisha.co.jp 良書というか、エラーの少なさがスゴい

django for python で、table "django_admin_log" violates foreign key エラー

IntegrityError at /admin/diary/diary/add/ insert or update on table "django_admin_log" violates foreign key constraint "django_admin_log_user_id_c564eba6_fk_auth_user_id" DETAIL: Key (user_id)=(2) is not present in table "auth_user". のよ…

perl で twitter api へ oauth 後、ユーザ情報を取得

https://blog.thingslabo.com/archives/000063.html OAUTHの練習として、上記urlの写経。 ただし、上記urlは2011年の内容で、その後のtwitterの仕様変更により 動作しない部分がありましたので、修正しています。 以下を callback.pl というfile名で保存し、…

PhpMetrics による php source の 循環複雑度計測( Cyclomatic complexity code metrics)

以下に、installや実行方法を記載しています。 https://github.com/phpmetrics/PhpMetrics php の code metrics は、sonar qube でも可能ですが、 sonar qube の実行には、mysql等の準備もある為、PhpMetrics の方がお手軽な印象。 Step1 install Composer h…

re: Google日本語入力APIを利用したメンテナンスフリーな住所補完機能 ( zip2addr )

確かに、郵便番号→住所変換であれば、Google日本語入力API は有効ですね。 http://kotarok.moo.jp/zip2addr/sample.html https://github.com/kotarok/jQuery.zip2addr https://www.google.co.jp/ime/cgiapi.html ただ、これ以外の Google日本語入力API 活用…