Skip to content

Instantly share code, notes, and snippets.

View brchiu's full-sized avatar

Bi-Ruei, Chiu brchiu

  • Taipei, Taiwan, Republic of China
View GitHub Profile
@brchiu
brchiu / gist:0ec5f35282944af06ec07e9e1c4ee4f4
Last active March 10, 2022 16:01
大衍之數揲卦法的後半段
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
# import numpy as np
# fmt: off
# from 易經
@brchiu
brchiu / gist:71bf87f51be35d6e334f4898b1ebd011
Last active February 20, 2023 20:02
first 500 Fibonacci numbers
0
1
1
2
3
5
8
13
21
34
@brchiu
brchiu / gist:91aa4ac49f024b564d18b50bed2d492f
Last active March 8, 2020 11:08
simple proof of concept for parsing Fibonacci Number web page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
def get_fibonacci(idx):
r = requests.get('http://www.protocol5.com/Fibonacci/' + str(idx) + '.htm')
t = html.fromstring(r.content.decode('utf8'))
li_elms = t.xpath("//*[contains(@class, 'number-result')]/li")
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
r = requests.get('http://www.protocol5.com/Fibonacci/60.htm')
tree = html.fromstring(r.content.decode('utf8'))
li_elms = tree.xpath("//*[contains(@class, 'number-result')]/li")
for li in li_elms:
@brchiu
brchiu / gist:4baabaed0444b31cfcbf41f8d8bbac5f
Created March 8, 2020 09:17
simple proof of concept for parsing Fibonacci Number web page
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from lxml import html
import requests
r = requests.get('http://www.protocol5.com/Fibonacci/60.htm')
tree = html.fromstring(r.content.decode('utf8'))
li_elms = tree.xpath("//*[contains(@class, 'number-result')]/li")
for li in li_elms:
@brchiu
brchiu / gist:4ef178e21a27b33f84bcdd94200c474e
Created December 17, 2019 02:09
sysrepo-plugind hang due to mutex status loaded from file is already acquired
brchiu@APPASSIONATA:/media/brchiu/79918428768101F8/DocCollect/Project$ sudo sysrepo-plugind -d -v 4
[sudo] password for brchiu:
[WRN]: Removing event pipe "sr_evpipe1" after a crashed subscription.
[INF]: Applying scheduled changes.
[INF]: No scheduled changes.
[INF]: Datastore copied from <startup> to <running>.
[INF]: Session 1 (user "root") created.
[INF]: Triggering "o-ran-software-management" "done" event on enabled data.
@brchiu
brchiu / gist:58f8c1c184377af0c102c8ada3026fc2
Created October 4, 2019 04:49
gdb log after increase NC_PS_QUEUE_TIMEOUT to 5000
(gdb) r -d -c MSG
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/netopeer2-server -d -c MSG
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[INF]: LY: Plugin "/usr/lib/libyang/extensions/metadata.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/extensions/yangdata.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/extensions/nacm.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/user_types/user_yang_types.so" successfully loaded.
@brchiu
brchiu / gist:6b3849d81063e5b873b756dfcd0caf48
Last active October 4, 2019 03:14
gdb_thread_info.log
root@xilinx-zcu111-2019_1:~# gdb netopeer2-server
GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-xilinx-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
root@xilinx-zcu111-2019_1:~# netopeer2-server -d -c MSG
[INF]: LY: Plugin "/usr/lib/libyang/extensions/metadata.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/extensions/yangdata.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/extensions/nacm.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/user_types/user_yang_types.so" successfully loaded.
[INF]: LY: Plugin "/usr/lib/libyang/user_types/user_inet_types.so" successfully loaded.
[INF]: LY: Reading module "ietf-yang-metadata".
[INF]: LY: Module "ietf-yang-metadata@2016-08-05" successfully parsed as implemented.
[INF]: LY: Reading module "yang".
[INF]: LY: Resolving "yang" unresolved schema nodes and their constraints...
typedef crl {
type binary;
description
"A CertificateList structure, as specified in RFC 5280,
encoded using ASN.1 distinguished encoding rules (DER),
as specified in ITU-T X.690.";
reference
"RFC 5280:
Internet X.509 Public Key Infrastructure Certificate
and Certificate Revocation List (CRL) Profile