Skip to content

Instantly share code, notes, and snippets.

View snowch's full-sized avatar

Chris Snow snowch

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowch
snowch / divtags.rst
Created December 2, 2024 14:51 — forked from DanielKotik/divtags.rst
Colored note boxes inside Jupyter notebooks

############# Markdown parser in Jupyter notebooks ##################

<div class="alert alert-block alert-info"> <b>NOTE</b> Use blue boxes for Tips and notes. </div>

<div class="alert alert-block alert-success"> Use green boxes sparingly, and only for some specific purpose that the other boxes can't cover. For example, if you have a lot of related content to link to, maybe you decide to use green boxes for related links from each section of a notebook.

@snowch
snowch / log.txt
Created November 19, 2024 11:59
mount-s3 log
2024-11-19T11:57:48.454616Z DEBUG awscrt::libcrypto_resolve: searching process and loaded modules
2024-11-19T11:57:48.454649Z DEBUG awscrt::libcrypto_resolve: found static aws-lc HMAC symbols
2024-11-19T11:57:48.454653Z DEBUG awscrt::libcrypto_resolve: found static aws-lc libcrypto 1.1.1 EVP_MD symbols
2024-11-19T11:57:48.454670Z DEBUG awscrt::libcrypto_resolve: Compiled with libcrypto AWS-LC 1.36.1, linked to libcrypto AWS-LC 1.36.1
2024-11-19T11:57:48.454679Z INFO awscrt::tls-handler: static: Initializing TLS using s2n.
2024-11-19T11:57:48.454964Z DEBUG awscrt::tls-handler: ctx: Based on OS, we detected the default PKI path as /etc/ssl/certs, and ca file as /etc/ssl/certs/ca-certificates.crt
2024-11-19T11:57:48.455002Z INFO awscrt::event-loop: id=0x55b812b32a30: Initializing edge-triggered epoll
2024-11-19T11:57:48.455010Z INFO awscrt::event-loop: id=0x55b812b32a30: Using eventfd for cross-thread notifications.
2024-11-19T11:57:48.455016Z INFO awscrt::event-loop: id=0x55b
@snowch
snowch / log.txt
Created November 14, 2024 11:51
mount-t3 log output
2024-11-14T11:37:16.555306Z DEBUG mountpoint_s3::cli: waiting up to 30 seconds for child process to be ready
2024-11-14T11:37:16.555705Z INFO mountpoint_s3::cli: mount-s3 1.10.0
2024-11-14T11:37:16.555724Z DEBUG mountpoint_s3::cli: CliArgs { bucket_name: "csnow-bucket", mount_point: "/home/jovyan/s3", prefix: None, region: Some("VAST"), endpoint_url: Some("http://172.200.201.1:80"), force_path_style: false, transfer_acceleration: false, dual_stack: false, requester_pays: false, bucket_type: None, no_sign_request: false, profile: None, read_only: false, storage_class: None, allow_delete: true, allow_overwrite: false, auto_unmount: false, allow_root: false, allow_other: false, maximum_throughput_gbps: None, max_threads: 16, part_size: 8388608, read_part_size: None, write_part_size: None, uid: Some(1000), gid: Some(100), dir_mode: Some(509), file_mode: Some(436), foreground: false, expected_bucket_owner: None, log_directory: Some("/home/jovyan/s3.log"), log_metrics: false, debug: true, debug_crt: true, no_log:
@snowch
snowch / setup.sh
Last active September 25, 2024 12:35
NiFi 2.0.0-M4 TLS Setup (broken)
export EXT_HOST_NAME="vastdb-ingest"
export EXT_HOST_IP="10.71.212.111"
export STORE_PASSWORD="abcdef"
if [ -d ./certs ]; then
echo "Directory ./certs already exists. Exiting."
exit 1
fi
mkdir ./certs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowch
snowch / gist:5128013f4b37682afccd7628d75a159e
Created June 18, 2024 20:36
build and run xv6 in amd64 UTM virtual machine on Mac M3 host
sudo apt-get install qemu qemu-system-x86
sudo apt-get install libc6-dev:i386
git clone https://github.com/mit-pdos/xv6-public.git xv6
chmod 700 -R xv6
cd xv6
make
make qemu

Definition

(from: https://en.wikipedia.org/wiki/Linear_independence)

A sequence of vectors $\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k$ from a vector space ${{mvar|V}}$ is said to be 'linearly dependent', if there exist scalars $a_1, a_2, \dots, a_k,$ not all zero, such that : $a_1\mathbf{v}_1 + a_2\mathbf{v}_2 + \cdots + a_k\mathbf{v}_k = \mathbf{0},$ where $\mathbf{0}$ denotes the zero vector.

Understanding Linear Dependence

@snowch
snowch / vector_subspace_example.py
Last active April 18, 2024 13:22
Example vector subspace for the book "Practical Linear Algebra for Data Science"
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define the vectors
v1 = np.array([1, 0, 2])
v2 = np.array([-1, 2, 3])
# Create a grid of values for t1 and t2
t1, t2 = np.mgrid[-1:1:0.1, -1:1:0.1]
@snowch
snowch / script-template.sh
Created December 18, 2020 08:47 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]