Skip to content

Instantly share code, notes, and snippets.

View yjlo123's full-sized avatar

Siwei Liu yjlo123

View GitHub Profile
@crazysal
crazysal / linking with C C++ libraries with gcc g++ when building an existing project
Created October 15, 2020 11:30
linking with C/C++ libraries with gcc/g++ when building an existing project
Notes on linking with C/C++ libraries with gcc/g++ when building an
existing project.
-- Iain Murray, 2015.
There are at least three things that can go wrong when trying to link
with a library that is in a non-standard location on your machine:
1. The compiler can't find the .h header files.
2. The linker can't find the library's binary .a or .so files.
@joseluisq
joseluisq / terminal-git-branch-name.md
Last active September 8, 2024 00:43
Add Git Branch Name to Terminal Prompt (Linux/Mac)

Add Git Branch Name to Terminal Prompt (Linux/Mac)

image

Open ~/.bash_profile in your favorite editor and add the following content to the bottom.

# Git branch in prompt.

parse_git_branch() {
def sign_data(private_key_loc, data):
'''
param: private_key_loc Path to your private key
param: package Data to be signed
return: base64 encoded signature
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode, b64decode