Skip to content

Instantly share code, notes, and snippets.

View shawnhank's full-sized avatar

Shawn Hank shawnhank

View GitHub Profile
# 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
@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',
}
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active April 28, 2024 16:35
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@chabala
chabala / using-google-takeout.md
Last active April 27, 2024 08:03
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 -
@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@aarondavidpolley
aarondavidpolley / com.apple.SetupAssistant.managed.plist
Created April 7, 2020 00:14
Skip All macOS Setup Assistant Items for new user login: Plist to upload into Jamf Pro Application & Custom Settings Profile Payload
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SkipAppearance</key>
<true/>
<key>SkipCloudSetup</key>
<true/>
<key>SkipPrivacySetup</key>
<true/>
@pgib
pgib / bbedit_colours.sh
Created May 6, 2011 19:51
My BBEdit Color Scheme
defaults write com.barebones.bbedit Color:Background -string "rgb(0,0,0)"
defaults write com.barebones.bbedit Color:CTagsIdentifier -string "rgb(57825,39937,11422)"
defaults write com.barebones.bbedit Color:ColorAttributesSeparately -string 1
defaults write com.barebones.bbedit Color:Comment -string "rgb(21845,21845,21845)"
defaults write com.barebones.bbedit Color:Comment:Ruby -string "rgb(34992,34992,34992)"
defaults write com.barebones.bbedit Color:Foreground -string "rgb(65535,65535,65535)"
defaults write com.barebones.bbedit Color:Foreground:CSS -string "rgb(56342,56342,56342)"
defaults write com.barebones.bbedit Color:GuideContrast -string 7
defaults write com.barebones.bbedit Color:HTMLAnchor -string "rgb(43690,0,0)"
defaults write com.barebones.bbedit Color:HTMLAttributeName -string "rgb(57528,45076,5799)"
@kahlil
kahlil / Twilight.bbcolors
Created August 11, 2011 13:02
A Twilightish colorscheme for BBEdit 10+. Drop the file into '~/Library/Application Support/BBEdit/Color Schemes/' to use it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundColor</key>
<string>rgba(0.000000,0.000000,0.000000,1.000000)</string>
<key>CommentsColor</key>
<string>rgba(0.569157,0.569091,0.569188,1.000000)</string>
<key>CtagsIdentifierColor</key>
<string>rgba(0.6,0.0,0.4,1.0)</string>
@millermedeiros
millermedeiros / osx_setup.md
Last active April 12, 2024 12:40
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@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?