Skip to content

Instantly share code, notes, and snippets.

View BirkhoffLee's full-sized avatar
🎓
Learning about CS

birkhoff BirkhoffLee

🎓
Learning about CS
View GitHub Profile
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 22, 2024 08:47
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@BirkhoffLee
BirkhoffLee / pkexec_block.stp
Last active January 27, 2022 04:08
Mitigate CVE-2021-4034 on CentOS 8 with Ansible
probe process("/usr/bin/pkexec").function("main") {
if (cmdline_arg(1) == "")
raise(9);
}
@jmatsushita
jmatsushita / README
Last active April 28, 2024 14:42
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@sbailliez
sbailliez / vagrant-vmware-tech-preview-apple-m1-pro.md
Last active April 10, 2024 07:51
Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

Vagrant and VMWare Tech Preview 21H1 on Apple M1 Pro

UPDATE November 20, 2022: VMWare Fusion 13

VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.

Summary

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated

@rayjanoka
rayjanoka / tailscale-enable-subnet-routes.sh
Last active January 11, 2022 10:25
Enable Tailscale Subnet Routes via API
#!/usr/bin/env sh
set -e
if [ "$TAILSCALE_APIKEY" = "" ]; then
echo "Missing TAILSCALE_APIKEY environment variable, exiting"; exit 21
fi
NAME="$(hostname -f)"
TAILSCALE_API="https://api.tailscale.com/api/v2"
@jerm
jerm / update_ts_dns.py
Created January 30, 2021 19:59
Sync Tailscale hosts to route53
#!/usr/bin/env python
#
# Sync your tailscale hosts to a route53 hosted zone.
#
import json
import platform
import subprocess
import boto3
import click
@BirkhoffLee
BirkhoffLee / README.md
Last active March 31, 2022 16:14
zer0zero. CS: GO configuration files

zer0zero. CS: GO configuration files

This configuration features:

  • Pro player settings. These are based on former Cloud9 player Shroud's config.
  • Human-readable explanations for every line of commands
  • Gameplay optimizations in technical aspects
    • Minimize shifting when firing the Weapon
    • Disable unnecessary video/audio effects
  • Useful shortcuts:
  • Jump throw: j
@karloskalcium
karloskalcium / run_file_dependent_scripts.py
Last active July 27, 2023 12:41
chezmoi script to run scripts based on dependent files changing
#!/usr/bin/env python3.8
# requires python3.8
from typing import Dict, Final
import hashlib
import os
import subprocess
# Expects a file of the format output by sha256sum (text mode)
CHECKSUM_FILE: Final = ".local_checksum"
@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@wancw
wancw / 0 - Readme.md
Last active July 4, 2023 09:34
移除 macOS 健保卡元件

檔案說明

  • removeNHIICC.sh : 移除健保卡元件與相關設定,須以 root (sudo) 權限執行。
  • postinstall.sh : 官方「MAC 元件移除安裝檔」的 script 內容(2020)