Skip to content

Instantly share code, notes, and snippets.

View shawnhank's full-sized avatar

Shawn Hank shawnhank

View GitHub Profile
@mberman84
mberman84 / main.py
Created November 10, 2023 16:17
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
# Clone the repo
git clone https://github.com/imartinez/privateGPT
cd privateGPT
# Install Python 3.11
pyenv install 3.11
pyenv local 3.11
# Install dependencies
poetry install --with ui,local
@shawnhank
shawnhank / letsencrypt-acme-guide.md
Created February 1, 2023 03:35 — forked from ammgws/letsencrypt-acme-guide.md
Using acme.sh script to renew LetsEncrypt certs using non-standard SSL port

1. Install acme.sh shell script

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install

Optionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.

# Github Repo for this Project: https://github.com/Weilbyte/PVEDiscordDark
# Download the Python Script & Run
$ wget https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.py
$ python3 PVEDiscordDark.py
@ilude
ilude / !proxmox_k3s_cluster.sh
Last active August 21, 2024 11:03
Proxmox k3s cluster creation scripts
#!/bin/bash
# curl -s https://gist.githubusercontent.com/ilude/457f2ef2e59d2bff8bb88b976464bb91/raw/cluster_create_setup.sh?$(date +%s) > ~/bin/setup_cluster.sh; chmod +x ~/bin/setup_cluster.sh; setup_cluster.sh
echo "begin cluster_create_setup.sh"
export CREATE_TEMPLATE=1 #false
while test $# -gt 0; do
case "$1" in
--template)
export CREATE_TEMPLATE=0 #true
@darwin
darwin / readme.md
Created November 16, 2020 21:59
APFS Container cloning/replicating under macOS 11.0 (Big Sur) - with a bootable system

It is the year 2020 and replicating APFS containers still sucks. One would expect it would be a simple copy and paste in the Disk Utility app but this is still far from reality.

Last year I wrote how I managed to clone my macOS system under Catalina. The main trick was to create a DMG file with multiple volumes, mount it on target machine and drop to command-line to do asr restore from synthetised disk while avoiding possible pitfalls.

The good news is that Apple devs definitely worked on improving this under Big Sur and added some documentation (see man asr). But I didn't understand it fully on first read. Maybe someone could explain how is this supposed to work?

@chabala
chabala / using-google-takeout.md
Last active October 29, 2024 11:49
Merge and extract tgz files from Google Takeout

Recently found some clowny gist was the top result for 'google takeout multiple tgz', where it was using two bash scripts to extract all the tgz files and then merge them together. Don't do that. Use brace expansion, cat the TGZs, and extract:

$ cat takeout-20201023T123551Z-{001..011}.tgz | tar xzivf -

You don't even need to use brace expansion. Globbing will order the files numerically:

$ cat takeout-20201023T123551Z-*.tgz | tar xzivf -
@alexellis
alexellis / install-k3sup.sh
Last active September 4, 2022 10:27
Multi-master / HA k3s for my Raspberry Pi cluster
#!/bin/bash
set -e
CH=latest
echo Installing Server 1
k3sup install --user pi --ip 192.168.2.147 \
--k3s-channel $CH \
--cluster \
@hdnl
hdnl / daily_template.md
Last active March 29, 2024 18:44
Template to faciliate taking daily notes in Markdown, featuring start and end day reflections, schedule, and logging

Start-of-Day Reflections

I am grateful for...

What would make today great?

@sebstyle
sebstyle / rancher-on-k3os.md
Last active March 21, 2024 03:43
Install rancher on k3os

Rancher cluster on k3os

Goal

Install rancher on k3os with centralized datastore on mysql cluster.

Environment

  • Host: Ubuntu 18.04.4 Desktop (32gb ram 4 cpu)
  • Virtualisation: kvm/qemu (virtual machine manager)
  • Local network: 192.168.0.0/16
    • Gateway: 192.168.0.1