Skip to content

Instantly share code, notes, and snippets.

View pcdinh's full-sized avatar

Pham Cong Dinh pcdinh

View GitHub Profile
@pcdinh
pcdinh / stripe-keys-and-ids.tsv
Created September 24, 2020 09:27 — forked from fnky/stripe-keys-and-ids.tsv
Stripe keys and IDs
Prefix Description Notes
sk_live_ Live secret key Secret key in a live environment.
pk_live_ Live public key Public key in a live environment.
pst_live_ Live Connection token Connection token in a live environment.
sk_test_ Test secret key Pecret key in a test environment.
pk_test_ Test public key Public key in a test environment.
pst_test_ Test Connection token Connection token in a test environment.
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
ch_ Charge ID Identifier for a Charge object.
@pcdinh
pcdinh / 1_stripe-schema.md
Created September 24, 2020 08:18 — forked from FGRibreau/1_stripe-schema.md
Stripe database schema (extracted from their sigma product) as of 2019-10-09
jqn -r markdown-table 'map(x => "## " + x.name + "\n\n" + markdownTable(x.columns.map(y => [y.name, y.type]))  ) | join("\n\n")' < /tmp/stripe.json

accounts

id varchar
business_name varchar
business_url varchar
@pcdinh
pcdinh / ttf-vista-fonts-installer.sh
Created December 30, 2019 09:32 — forked from maxwelleite/ttf-vista-fonts-installer.sh
Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
# Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007.
# These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas.
# Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today.
# Dependencies: wget, fontforge and cabextract
# Note: Microsoft no longer provides the PowerPoint Viewer 2007 (v12.0.4518.1014) or any version anymore for download
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
@pcdinh
pcdinh / python-ml-notebook-windows
Created September 10, 2019 10:05
Install Jupyter and required libs and datasets
1. Download 3.7
https://www.python.org/ftp/python/3.7.0/python-3.7.0-amd64.exe
Assuming that you will install Python 3.7 into C:/Python37 and allow Python installer to add python.exe into Windows's PATH environment variable.
2. Upgrade Python's pip
python -m pip install --upgrade pip
./amdgpu-pro-install --opencl=legacy,pal
sudo apt list --installed | grep icd
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
ocl-icd-libopencl1/bionic,now 2.2.11-1ubuntu1 amd64 [installed,automatic]
opencl-amdgpu-pro-icd/unknown,now 18.50-708488 amd64 [installed]
opencl-orca-amdgpu-pro-icd/unknown,now 18.50-708488 amd64 [installed]
@pcdinh
pcdinh / beam0
Last active January 1, 2019 00:49
sudo apt install -y gcc make perl git
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update -y
sudo apt install -y g++-7 libboost-all-dev libssl-dev -y
sudo apt -y autoremove
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc
sudo wget "https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh"
sudo sh cmake-3.12.0-Linux-x86_64.sh --skip-license --prefix=/usr
apt-get --no-install-recommends --yes install clang libclang-dev llvm-dev libncurses5 libncursesw5 cmake git
ubuntu-drivers devices
sudo apt-get purge nvidia*
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt install nvidia-390
lsmod | grep nvidia
nvidia-smi
sudo apt install nvidia-cuda-toolkit
https://blog.aeternity.com/q-a-at-reddit-with-john-tromp-inventor-of-the-cuckoo-cycle-mining-algorithm-c316119c07e9
Trong Cuckoo Cycle, chứng cứ xử lý có dạng một chu trình 42 cạnh (khép kín) nằm trong 1 đồ thị lớn ngẫu nhiên hình thành trên một vài con số dùng một lần (nonce) nào đó. Thử tưởng tượng 2 quốc gia, mỗi quốc gia có 1 tỉ thành phố, và thử tưởng tượng chọn 1 tỉ con đường chạy cắt qua biên giới kết nối 1 thành phố ngẫu nhiên ở một quốc gia này với 1 thành phố ngẫu nhiên của một quốc gia khác (PoW này thật ra là dùng một hàm băm không dùng nhiều tài nguyên để ánh xạ 1 con số dùng một lần, số của con đường, và quốc gia đến một thành phố). Câu hỏi ở đây là liệu có tồn tại 1 chu trình gồm 42 con đường kết nối 42 thành phố khác nhau hay không. Nếu một ai đó trao cho bạn một con số dùng một lần và con số của 42 con đường thì bạn sẽ thấy là cực kì dễ kiểm chứng (verify) trong thời gian và bộ nhớ rất nhỏ. Nhưng để tìm ra được 1 chu trình như vậy thì lại không hề là một bài toán dễ giải. Tuy nhiên lưu ý ở đ
@pcdinh
pcdinh / install.sh
Created August 10, 2018 10:08 — forked from sergeyklay/install.sh
Install Nginx with Nchan
#!/usr/bin/env bash
# Works fine on Ubuntu 14.0.4 LTS
NGINX_VERSION="1.9.9"
NCHAN_VERSION="0.97"
HEADERS_MORE_VERSION="0.29"
DEV_KIT_VERSION="0.2.19"
ECHO_VERSION="0.58"
FANCY_INDEX_VERSION="0.3.5"