Skip to content

Instantly share code, notes, and snippets.

View snowch's full-sized avatar

Chris Snow snowch

View GitHub Profile

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...]
@snowch
snowch / tmux-sync.sh
Created December 9, 2020 14:13 — forked from kizzx2/tmux-sync.sh
Run multiple commands, and open them all in synchronized tmux panes
#!/bin/sh
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Chris Yuen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
{"level":"info","ts":1600529431.7823222,"logger":"kubedirector","msg":"KubeDirector Version: 0.5.0-unstable"}
{"level":"info","ts":1600529431.7824512,"logger":"kubedirector","msg":"Go Version: go1.13.7"}
{"level":"info","ts":1600529431.782459,"logger":"kubedirector","msg":"Go OS/Arch: linux/amd64"}
{"level":"info","ts":1600529431.7824628,"logger":"kubedirector","msg":"Version of operator-sdk: v0.15.2"}
{"level":"info","ts":1600529432.0865393,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":"0.0.0.0:8383"}
{"level":"info","ts":1600529432.0867908,"logger":"kubedirector","msg":"Registering Components."}
{"level":"info","ts":1600529432.0873418,"logger":"kubedirector","msg":"Waiting for client cache sync"}
{"level":"info","ts":1600529432.0874023,"logger":"kubedirector","msg":"Client cache sync successful"}
{"level":"info","ts":1600529432.106008,"logger":"kubedirector","msg":"Starting the Cmd."}
{"level":"info","ts":1600529432.106404,"logger":"controller-runtime.manager","ms
f().
ClientCertFromKubeconfig = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJZkY0OFZJcTRFZmN3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBek1EVXhPREl6TVRGYUZ3MHlNVEF6TURVeE9ESXpNVFJhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXVJL1c1eTA0NEZPUWlwSlEKclovSjBINW50VmhwbkQ5cUZNaWg0L3kyQVdKMDNBd3NmbU1HbE81d3RnZUNwSGRFZFdzQ05yWDE2N3Y3RUtWVApxUU1MWFBmN1Njd0Z4R1VNUVdaZUZHMTJjc2wzMmxkbEdMc1FtM24vSk5EM1NlZVU5N0Q2cHhMTHRQK2J3UE1wClZkRm8zZG1ER1MwUEtEd3RWY0prdVZNbU1jMFRaY3ovWmN0YUVySVpxUTZqZHdTZWM2NzQ1VDJiOG1nS0JkZ0kKRjhnS2pFQnVCNEFRbzd3OXRuQjhnWjczZUdZb203Q215MGJaYzRRQnBqUWk2V1YzL2tDeExHbW5hSVZDOFRoOQo3VldsTTFZaDB1WDdUbTlrVndwQnZOYVd6UXllTlU5K0RnZmVsRHUzTGdEY2xQM3NZYTB3WWNHci9xUXVDRjVmCkN1QkxoUUlEQVFBQm95Y3dKVEFPQmdOVkhROEJBZjhFQkFNQ0JhQXdFd1lEVlIwbEJBd3dDZ1lJS3dZQkJRVUgKQXdJd0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFDZVBNV0toUERZeTlJQ3ByY2ErblRITFU3MjY5Y0MwNWc3agp
@snowch
snowch / .inputrc
Created June 22, 2020 14:01 — forked from johnlim/.inputrc
Set bash to use Vi-mode and remap <Esc> to jj
# want vi to be the default editor for readline
set editing-mode vi
# vi settings
$if mode=vi
# normal mode
set keymap vi-command
# insert mode
set keymap vi-insert
"jj": vi-movement-mode # remap escape
@snowch
snowch / check.sh
Created April 4, 2020 20:35
Check command exists or exit
## Check 1# ldapmodify installed or not
[[ -x $(command -v ldapmodify) ]] || { echo "Please Install Openldap-clients"; exit 1; };
@snowch
snowch / wireshark_over_ssh.sh
Last active May 16, 2020 21:49
tcpdump over ssh to wireshark
ssh user@remotehost tcpdump -i eth1 -U -s0 -w - 'not port 22' | sudo wireshark -k -i -
ssh user@remotehost tcpdump -i eth1 -U -s0 -w - 'not port 22' | sudo /Applications/Wireshark.app/Contents/MacOS/Wireshark -k -i -
@snowch
snowch / springer-free-maths-books.md
Created January 13, 2019 12:55 — forked from jnpaulson/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links