Skip to content

Instantly share code, notes, and snippets.

View james-see's full-sized avatar
make your own luck

JC james-see

make your own luck
View GitHub Profile
james-see /
Created January 7, 2024 22:54
get system info for linux or mac os
# Function to check if a command exists
command_exists() {
type "$1" &> /dev/null
# Function to gather system information
function gather_system_info() {
info="System Information Report\n"
james-see / firstnames.txt
Created December 29, 2023 15:12
list of 1219 first names
View firstnames.txt
james-see /
Created November 24, 2023 19:48
download and convert and quantize a model from huggingface
from huggingface_hub import snapshot_download
snapshot_download(repo_id=model_id, local_dir="vicuna-hf",
local_dir_use_symlinks=False, revision="main")
# convert to gguf clone llama.cpp first git clone git clone
# python3 /Users/jc/projects/models/01ai/vicuna-hf --outfile /Users/jc/01ai.gguf --outtype f16
# ./quantize /Users/jc/01ai.gguf /Users/jc/01ai-q5.gguf Q5_K_M
james-see /
Created November 23, 2023 00:30
homebrew & pyenv mac os 2023
eval "$(/opt/homebrew/bin/brew shellenv)"
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
james-see / fixit.txt
Last active February 4, 2024 22:59
mdm bypass sonoma
View fixit.txt
Remove / bypass MDM on Sonoma. Working as of November 2023.
For you being part of group one all you have to do is access recovery mode and disable SIP.
Reboot then go back in recovery mode, open a safari tab, go to and press the button to copy the code.
Should be this: (curl -o && chmod +x ./ && ./
Then exit safari, open terminal, paste it there & hit enter, follow the steps and then boom done. Restart computer and once in for added reassurance:
View Disable Device Enrollment Notification on

Disable Device Enrollment Notification on

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable
james-see /
Created November 16, 2023 14:36
draft kings api example with jq bare bones
## must have jq installed already and curl
curl | jq '[.draftables[] | select(.isDisabled != true) | {displayName: .displayName, position: .position, salary: .salary, FPTG: (.draftStatAttributes | map(select(.id == 90)) | first.value // null), OPTS: (.draftStatAttributes | map(select(.id == -2)) | first.value // null)}] | unique_by(.displayName)'
james-see / blah.txt
Created October 26, 2023 14:14
git alias for quickness
View blah.txt
git config --global alias.rando '!sh -c "git add -A && git commit -m \"$(curl -s\" && git push"'
james-see /
Created September 25, 2023 17:03
using bark to generate audio from text
from transformers import AutoProcessor, BarkModel
import scipy
processor = AutoProcessor.from_pretrained("suno/bark")
model = BarkModel.from_pretrained("suno/bark")
voice_preset = "v2/fr_speaker_2"
inputs = processor("[clears throat] Destroying is an act of creation, it makes room for new things to begin. Fire is the best method. Let the spark ignite your soul.", voice_preset=voice_preset)
james-see /
Created September 13, 2023 14:17
one liner to kill a list of pattern matching processes, in this example selenium
sudo ps -ef | grep selenium | cut -d\ -f4 | xargs kill -9;