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
@shawnhank
shawnhank / main.py
Created January 23, 2024 22:01 — forked from mberman84/main.py
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
@shawnhank
shawnhank / templogger.sh
Created December 8, 2023 07:24 — forked from i3luefire/templogger.sh
This is a variation of fkleon's temperature.sh script that puts the info in a simple text file instead of an email. It is also my first gist on github. :)
#! /bin/sh
# This is your log filename
LOGFILE=/path/to/temp.log
# Create empty file
touch $LOGFILE
# Define adastat function, which writes drive activity to temp file
adastat () {
@shawnhank
shawnhank / 01-pihole.conf
Created October 25, 2023 17:34 — forked from mtrimarchi/01-pihole.conf
pi.hole dnsmasq conf
# /etc/dnsmasq.d/01-pihole.conf
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
#
# Dnsmasq config for Pi-hole's FTLDNS
#
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
@shawnhank
shawnhank / homelab.markdown
Created September 17, 2023 06:12 — forked from zhen-huan-hu/homelab.markdown
Personal Notes on Home Lab Administration

Personal Notes on Home Lab Administration

This is a collection of personal notes on self-hosted home lab administration. This reference assumes the underlying OS is Ubuntu Server 22.04.

Installing a New Hard Drive

List block devices and get UUIDs for the partitions

It is recommended to use lsblk command to get information about block devices rather than blkid. lsblk provides more information, better control on output formatting and it does not require root permission to get actual information.

@shawnhank
shawnhank / PVE-host-backup.md
Created April 26, 2023 23:35 — forked from mrpeardotnet/PVE-host-backup.md
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
(*
The Hit List Mail Import
Copyright © 2012 Potion Factory LLC.
Licensed under a Creative Commons Attribution 3.0 License: http://creativecommons.org/licenses/by/3.0/
To customize this script, copy it first to:
@shawnhank
shawnhank / gist:db0603d2ad6b2ff8f96f4aa783388fbd
Created April 14, 2023 20:13 — forked from BrettBukowski/gist:5347463
Filter emails in Mail.app with regular expressions
-- Mail.app can't run a "Contains" filter with a regex,
-- so you can't filter on HTML content. Until now.
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
try
repeat with theMessage in theMessages
-- Getting the content as string converts all HTML tags to '?' and just leaves text content
set theBody to quoted form of (theMessage's content as string)
-- It's awkwardly hard to get sed to work w/ mult. lines, so collapse newlines
set theCommandString to "echo " & theBody & " | tr '\\n' ' ' | sed \"s/brett Author/*MATCHED*(&)/\"" as string
@shawnhank
shawnhank / Mail - Update Rule.applescript
Created April 14, 2023 20:11 — forked from logic2design/Mail - Update Rule.applescript
This will add either the Sender's email address or the Sender's Domain to a Mail rule.
#################################################################################
# Title: Mail - Update Rule
#################################################################################
#Iain Dunn
#Logic2design.com
#[email protected]
# Contributors, inspration and sources
# https://leancrew.com/all-this/2021/06/hey-i-sped-up-apple-mail-rules/
@shawnhank
shawnhank / mail-to-day-one.applescript
Created April 14, 2023 20:11 — forked from poritsky/mail-to-day-one.applescript
Create Day One Entry From Selected Message in Apple Mail (Requires Day One CLI)
(*
Apple Mail to Markdown Formatted Day One Entry
!!! IMPORTANT !!!
Requires the Day One Command Line Interface. Download and install from here:
http://dayoneapp.com/tools/
Adapted from 'Apple Mail -- Text File Exporter w/ Basic Header Info' by Justin Lancy:
http://veritrope.com/code/apple-mail-export-to-text-file-w-basic-header-info