Fingerprint of PEM ssh key

The problem I was on AWS and needed to select SSH Key pair. It has been a while that I needed to create one that might require SSH Key pair. So to be sure I got the correct key, I needed to compare fingerprint listed on Key Pair list. I do have pem key with name contain aws so I want to generate finger print for that key. How to solve it openssl pkcs8 -in path/to/private_key_file -nocrypt -topk8 -outform DER | openssl sha1 -c or use AWS tool ...

April 3, 2019 · 1 min · Naoko Reeves

Get started with Cython

Cython is designed as a C-extension for Python. The developers can use Cython to speed up Python code execution. Performance gains are most significant in CPU-bound programs. Here is some cpu-intense code in python # cat compute_it.py import datetime import math def main(): t0 = datetime.datetime.now() do_math(num=30_000_000) dt = datetime.datetime.now() - t0 print("Done in {:,.2f} sec".format(dt.total_seconds())) def do_math(start=0, num=10): pos = start k_sq = 1000 * 1000 while pos < num: pos += 1 math.sqrt((pos - k_sq) * (pos - k_sq)) if __name__ == '__main__': main() Took 7.39 sec ...

March 24, 2019 · 2 min · Naoko Reeves

list changes of specific line(s) with git

If you only need to know who was the last person to change the line, git blame will do To see who modified the code on line # 85 and next 5 lines git blame ${path-to-the-file} -L 85,+5 output would look like this f1f66980053 (Naoko 2019-02-25 17:32:25 -0700 85) text = re.sub(r'{([^\n]+?)}', r'{0[\1]}', template["text"]) 50ccaf0f3b8 (Naoko 2019-02-16 10:44:54 -0700 86) template["text"] = text.format(template_vars) f373fd241db (Tom Bocklisch 2018-07-10 14:33:18 +0200 87) except KeyError as e: f373fd241db (Tom Bocklisch 2018-07-10 14:33:18 +0200 88) logger.exception( 390792a0008 (Tom Bocklisch 2018-11-16 12:51:21 +0100 89) "Failed to fill utterance template '{}'. " But often the above information is not good enough. ...

March 19, 2019 · 2 min · Naoko Reeves

How to fork and keeping your github repo in sync

Forking a Github Repository Just click “fork” button on upper right corner black tea Making a Local Clone $ git clone https://github.com/YOUR_USERNAME/YOUR_FORK.git Adding a Remote # list current configured remote repository for your fork $ git remote -v # add upstream $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git # list again to see upstream is added $ git remote -v origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch) origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push) upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch) upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push) Working in a Branch Create and checkout a feature branch. Personally, I like to set github issue number followed by summary of issue. This notation GH-${issue_num} will create a link to the issue on github. ...

February 19, 2019 · 1 min · Naoko Reeves

コンブチャの作り方

準備するもの スコビー(SCOBY - symbiotic culture of bacteria and yeast) スコビーはどこで手に入れる? - 自分で作ることもできるけどお友達にもらったりとかアマゾンでもかえるよ。 スコビーはスターター紅茶(コンブチャ)と一緒に運ばれてきます。 黒紅茶の茶葉 - ティーバックでもいいけどルースティーリーフのほうがお得なはず。 black tea 砂糖(グラニュー糖があ勧め) 広口のガラス瓶 (熱湯消毒してね) 私が使ってるのは 2.5 gallon (9.5 litter) と大きいけど 1 gallon (3.7 litter) サイズから始めるはよいスタートかとおもいます。ちなみに右の瓶はおよそ1リットルで 左側のがおよそ9.5リットルです。 Kombucha jars キッチンクロスまたはキッチンペーパー キッチンクロスを留めるゴムまたは紐 2次発行用のエアタイトボトルもしくは瓶 私はこんなボトルを使ってます。 Kombucha bottles 分量 瓶のサイズ: 1 little or 34 oz 紅茶: 2 tea bags or 1.5 tsp loos tea 砂糖: 1/4 cup 水: 3 1/4 cups スターター紅茶: 1/4 cup 瓶のサイズ: Half gallon ...

January 19, 2019 · 1 min · Naoko Reeves