This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# https://medium.com/mycrypto/the-journey-from-mnemonic-phrase-to-address-6c5e86e11e14 | |
# pip3 install bip_utils | |
# python3 bip_demo.py | |
# For the 1st example, private key and address of path0 | |
# have been verified using exodus wallet. | |
# For the 2nd example, the computed master key does not match the article...? | |
# If you have a private key stored in a file named priv_key_file.txt | |
# this program will also create a derived pair of keys from it | |
# as a 3rd example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// usage: | |
// http://.../gecko.pgp??q=bitcoin,ethereum,solana,polkadot | |
// or | |
// http://.../gecko.pgp??q=mycrypto.csv | |
// where mycrypto.csv contains the id of a coin on each line. | |
// Find the exact id of your coin in this list: | |
// https://api.coingecko.com/api/v3/coins/list | |
// See this doc for more info: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# multicast netcat | |
# https://newtoypia.blogspot.com/2021/09/netcat.html | |
# 齊步走! 用 netcat 同步指揮教室裡的所有電腦 | |
import argparse, sys, re, readline | |
from warnings import warn | |
from subprocess import Popen, PIPE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import argparse, os, re | |
from warnings import warn | |
import subprocess | |
parser = argparse.ArgumentParser( | |
description='invoke pocketsphinx and produce keystrokes', | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument('-k', '--kwokfn', type=str, default='', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# for f in *.xml ; do xml-js $f --compact | jq . > ${f/%xml/json} ; done | |
# python3 prj2html.py *.json > new.html | |
# 詳見 https://newtoypia.blogspot.com/2021/09/xml-js-jq-rss.html | |
import argparse, json, re | |
from warnings import warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# https://github.com/pyexcel/pyexcel-ods/issues/41 | |
# pyexcel-ods issue: use "<text:p>" instead of "<text:line-break/>" for newlines (line breaks) in cells | |
import argparse, re, sys, json | |
from pyexcel_ods3 import save_data | |
from warnings import warn | |
parser = argparse.ArgumentParser( | |
description='read many text files into two columns of an ods file, with filenames as the key column and contents as the value column', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# https://newtoypia.blogspot.com/2021/05/android-app-size.html | |
# 揪出手機上的腫脹軟體: android app 佔用空間大小散點圖 | |
import argparse, fileinput, re, json | |
parser = argparse.ArgumentParser( | |
description='print android app size as .csv: adb shell dumpsys diskstats | aasize.py', | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter) | |
parser.add_argument('files', nargs='*', help='files') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# https://stackoverflow.com/a/66546687 | |
# https://newtoypia.blogspot.com/2021/05/ffmpeg.html | |
# 一口氣串接爆多影片? ffmpeg 拯救可憐的手指 | |
import argparse, subprocess, re | |
def gen_filter(segments, effect='fade', duration=0.3): | |
video_fades = '' | |
# fail! audio_fades = '\\\n[0:a]aresample=async=1;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# convert the output (as json) of | |
# https://github.com/iamcal/SQLParser | |
# to the input of | |
# https://github.com/BurntSushi/erd | |
# or to the input of | |
# https://github.com/ehne/ERDot | |
# | |
# For example, suppose you have ~/sakila-schema.sql from https://downloads.mysql.com/docs/sakila-db.tar.gz |