Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / LLM.md
Last active April 8, 2025 13:49
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@antiops
antiops / auto-wayback.user.js
Created October 11, 2022 14:55
Automatically save the page you're on to the Internet Archive's Wayback Machine.
// ==UserScript==
// @name Auto Wayback
// @description Automatically save the page you're on to the Internet Archive's Wayback Machine.
// @version 1.0.0
//
// @match https://wsj.com/*
// @match https://cnn.com/*
// @match https://*.cnn.com/*
// @match https://theguardian.com/*
// @match https://snopes.com/*
@Fef0
Fef0 / wordnet3_infused_kindle_mobi_to_stardict.md
Created September 10, 2022 13:57
Convert a .mobi dictionary (Wordnet3 Infused in this example) to a StarDict .dict file (with it's .ifo)

After a whole day of struggles, I finally managed to convert a wordnet3 infused dictionary (that you can get here: http://eb.lv/) from .mobi format to .dict format (suitable for KOReader).

I tested this process on Arch Linux, so your process might be different from mine.

Step 1

  • Download the KindleUnpack program from here: https://github.com/kevinhendricks/KindleUnpack
  • Extract the .zip
  • Start the GUI with python 2 (IMPORTANT: python3 doesn't work!): python2 KindleUnpack.pyw
  • Select the .mobi file as input and choose your output directory
  • (optional) I don't know if it is necessary, but select ePub Output type: Auto-Detect
@jmatsushita
jmatsushita / README
Last active April 14, 2025 23:16
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.
@mikeslattery
mikeslattery / ssh2config.sh
Last active May 20, 2024 13:13
Convert shell history or CLI args into ~/.ssh/config format.
#!/bin/bash
ssh2append() {
ssh -G "$@" | sed -n 's/^hostname /Host /p'
comm -23 <(ssh -G "$@" 2>/dev/null | sort) <(ssh -G . 2>/dev/null | sort) | sed 's/^/ /'
# This loop+if is for remote command, -N, -W as -G lacks support
while getopts '1246AaCfGgKkMNnqsTtVvXxYyB:b:c:D:E:e:F:I:i:J:L:l:m:O:o:p:Q:R:S:W:w:' opt; do
#shellcheck disable=SC2254
case "$opt" in

Install navidrome on FreeNAS Jail / FreeBSD 11.4 & 12.2

https://www.navidrome.org/

  • date: 2020-08-21, navidrome 0.30.1, needs go 1.14 and node v14
  • update: 2020-10-28, navidrome 0.36.1, needs go 1.15 and node v14; newer go version in repo: pkg update, pkg upgrade followed by pkg install taglib and the build went through
  • update: 2021-01-20, FreeBSD 12, navidrome 0.39, needs go 1.15 and node v14; FreeBSD 12 repo contains node v15, installed node14 and npm-node14 instead of node and npm
  • update: 2021-04-30, FreeBSD 12, navidrome 0.42, needs go 1.16 (in repo), kept node v14 with a minor update; removed wrapper script from service below
  • update: 2021-08-04, FreeBSD 12, navidrome 0.44.1, needs node v16

Improvements / TODO

@Da-Juan
Da-Juan / opnsense_add_OCSP_stapling.md
Last active February 21, 2024 15:00
opnsense/haproxy: add OCSP stapling support

Here is a work around to automate OCSP stapling on Opnsense with HAproxy plugin.

Hope it helps :)

I created a script based on acme.sh's haproxy deploy hook.

As /tmp is emptied on reboot you need to regenerate ocsp files on startup so I put the script as a startup script: /usr/local/etc/rc.syshook.d/start/99-ocsp (symoblic links in rc.syshook.d don't work).

#!/bin/sh                          
@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active February 17, 2025 21:51
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@mecid
mecid / Calendar.swift
Last active November 28, 2024 14:25
SwiftUI Calendar view using LazyVGrid
import SwiftUI
extension Calendar {
func generateDates(
inside interval: DateInterval,
matching components: DateComponents
) -> [Date] {
var dates: [Date] = []
dates.append(interval.start)
@kimbo
kimbo / scrape-doh-providers.py
Last active December 11, 2024 05:07
Scrape DoH provider URLs from cURL's wiki page (see https://raw.githubusercontent.com/wiki/curl/curl/DNS-over-HTTPS)
#!/usr/bin/env python
#
# Scrape Doh provider URLs from Curl's DNS-over-HTTPS wiki (https://raw.githubusercontent.com/wiki/curl/curl/DNS-over-HTTPS).
#
# Example usage: ./scrape_doh_providers.py '"{} - {}".format(o["url"], o["name"])'
#
import argparse
import re
import urllib.request