Skip to content

Instantly share code, notes, and snippets.

View namuyan's full-sized avatar

namuyang namuyan

View GitHub Profile
@namuyan
namuyan / portscan.py
Created September 30, 2018 03:12
Pythonでポートスキャンするプログラムを作成
from socket import socket, gethostbyname, AF_INET, SOCK_STREAM
from threading import Thread, Lock
from time import sleep, time
def _thread(address, ports, opened, lock):
while True:
with lock:
try:
port = ports.pop()
@namuyan
namuyan / setfreq.sh
Last active October 31, 2018 13:37
Bananaの周波数を下げて落ちるのを下げる🍌
#!/bin/bash
#Script to quickly adjust the CPU clock rate of the Banana Pi M3
# ____ _____ _ __ __ ____
# | _ \ | __ (_) | \/ |___ \
# | |_) | __ _ _ __ __ _ _ __ __ _ | |__) | | \ / | __) |
# | _ < / _` | '_ \ / _` | '_ \ / _` | | ___/ | | |\/| ||__ <
# | |_) | (_| | | | | (_| | | | | (_| | | | | | | | | |___) |
# |____/ \__,_|_| |_|\__,_|_| |_|\__,_| |_| |_| |_| |_|____/
#Nargren, 2016.09.03.
@namuyan
namuyan / BananaPi-M3.md
Last active October 31, 2018 15:42
BananaPi-M3 の使用方法

Frequensy

熱いので周波数下げるべし

Wifi

ぶっちゃけIP取得まで確認できたが接続できなかった。

  1. sudo sh -c 'wpa_passphrase SSID PASSWORD >> /etc/wpa_supplicant/wpa_supplicant.conf'
  2. wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
  3. sudo modprobe bcmdhd
@namuyan
namuyan / nanoPi-fire3.md
Last active November 12, 2018 13:06
nanoPi-fire3を使用する時の手順

Login

  • username: pi
  • password: pi

/etc/apt/sources.list のリンクを修正する

sed -e 's/192.168.1.9/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list &gt; tmp.txt
@namuyan
namuyan / index.js
Last active February 24, 2020 13:09 — forked from novi/logger.js
node-http-proxyを使ったWebsocket対応Proxy
let https = require('https'),
httpProxy = require('http-proxy'),
fs = require('fs');
var ssl = {
key: fs.readFileSync('/etc/letsencrypt/live/pycontract.tk-0002/privkey.pem', 'utf8'),
cert: fs.readFileSync('/etc/letsencrypt/live/pycontract.tk-0002/fullchain.pem', 'utf8')
};
@namuyan
namuyan / ipv6_server.py
Created December 26, 2018 08:56
Pythonのipv6のSocketサーバコード
import socket
import selectors
import sys
import time
HOST = None
# HOST = "localhost" # "::1" # "127.0.0.1", "None"
PORT = 2000
BACKLOG = 5
BUFSIZE = 1024
@namuyan
namuyan / doc.md
Last active March 12, 2020 02:07
How to install plyvel on wondows
@namuyan
namuyan / rpipypy.md
Last active August 29, 2019 15:42 — forked from troeger/rpipypy.md
Cross-compilation of PyPy for RaspberryPi
@namuyan
namuyan / nuitka3-help.sh
Created September 7, 2019 15:53
nuitka3 help commands 0.6.5
Usage: nuitka3 [--module] [--run] [options] main_module.py
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--module Create an extension module executable instead of a
program. Defaults to off.
--standalone Enable standalone mode in build. This allows you to
transfer the created binary to other machines without
it relying on an existing Python installation. It
@namuyan
namuyan / bug.md
Created September 28, 2019 11:01
lightningのFoundingTXを検証しない問題

source

https://lists.linuxfoundation.org/pipermail/lightning-dev/2019-September/002174.html https://twitter.com/chaintope/status/1177771818007982081?s=21

abstract

LNの脆弱性は、チャネルオープン時のチェックが問題。 通常、既存のBOLTの仕様でチャネルをオープンする際は、資金提供者がFunding Txを作成し、そのTXIDとアウトプットの番号を受信者に渡す。 受信者はその情報から最初のコミットメントTxの署名を作成し、資金提供者に返す。その後資金提供者はFunding Txをブロードキャストしてチャネルをオープンする。