Skip to content

Instantly share code, notes, and snippets.

@numpde
numpde / notes-collection.json
Created March 15, 2024 15:25
Typesense `notes` collection
{
"default_sorting_field": "",
"enable_nested_fields": true,
"fields": [
{
"facet": false,
"index": true,
"infix": false,
"locale": "",
"name": "summary",
@numpde
numpde / crawler-openapi.yml
Created March 15, 2024 14:16
ChatGPT Custom Action Server for Web Crawling
openapi: 3.0.3
info:
title: ChatGPT Custom Action Server for Web Crawling
description: This server enhances ChatGPT with real-time web crawling functionalities.
version: "1.0.0"
servers:
- url: https://crawler.counter-resistance.org/
paths:
/api/view/md/:
post:
@numpde
numpde / typesense-openapi.yml
Created March 5, 2024 06:24
Typesense document basic I/O
openapi: 3.0.3
info:
title: Typesense Notes API
description: An API for creating and searching notes.
version: 0.25.0
externalDocs:
description: Find out more about Typesense
url: https://typesense.org
servers:
- url: https://************.a1.typesense.net
@numpde
numpde / ethz-vpn.sh
Created February 25, 2024 15:23
ETHZ VPN (with OTP/MFA)
#!/bin/bash
# This script connects to ETH Zurich via `openconnect`
# using the `oathtool` to generate the OTP (of MFA's fame).
# Attempts to reconnect if the connection appears broken.
# Run as:
# bash ethz-vpn.sh
LOGIN_NAME="*************@student-net.ethz.ch"
@numpde
numpde / elasticsearch-index-openapi.yaml
Created February 15, 2024 18:11
Elasticsearch Index OpenAPI Specification
openapi: 3.0.0
info:
version: 1.0.0
title: Elasticsearch Index API
license:
name: Apache 2.0
servers:
- url: ****
paths:
/search-backend1:
@numpde
numpde / add_pwd_to_path.sh
Created November 6, 2023 10:44
Add current path to $PATH
#!/bin/bash
# This script will add the directory where it is located to the PATH
# if it's not already included.
# Get the directory of the current script, regardless of where it's called from
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# Check if the directory is already in PATH
if [[ ":$PATH:" != *":$DIR:"* ]]; then
# Add the script directory to PATH for the duration of this session or
@numpde
numpde / .bashrc-set-title
Created June 10, 2023 07:49
Set title for the terminal immediately
set-title() {
if [[ -z "$PS1_BAK" ]]; then
PS1_BAK=$PS1
fi
# Change the title immediately using printf
printf "\033]0;%s\007" "$1"
# Update PS1 for future prompts
TITLE="\[\e]2;$1\a\]"
@numpde
numpde / cleanup-venv.sh
Created May 21, 2023 10:09
Find python venv folders, perform pip freeze and uninstall all packages.
#!/bin/bash
IFS=$'\n'
# Find all unique directories containing 'venv*' subdirectories
for dir in $(find . -type d -name "venv*" -printf '%h\n' | sort -u)
do
echo "Found directory: $dir"
# Find all requirement files in the directory
@numpde
numpde / webui-user.sh
Last active January 19, 2023 12:40
Settings for the SD server (CPU)
#!/bin/bash
# MODIFIED FROM
# https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui-user.sh
# Install directory without trailing slash
install_dir="/home/$(whoami)/apps/1111"
# Name of the subdirectory
clone_dir="sd-webui"
@numpde
numpde / rCRS.fasta
Created April 26, 2022 09:27
rCRS for MT
>MT
GATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTT
CGTCTGGGGGGTATGCACGCGATAGCATTGCGAGACGCTGGAGCCGGAGCACCCTATGTC
GCAGTATCTGTCTTTGATTCCTGCCTCATCCTATTATTTATCGCACCTACGTTCAATATT
ACAGGCGAACATACTTACTAAAGTGTGTTAATTAATTAATGCTTGTAGGACATAATAATA
ACAATTGAATGTCTGCACAGCCACTTTCCACACAGACATCATAACAAAAAATTTCCACCA
AACCCCCCCTCCCCCGCTTCTGGCCACAGCACTTAAACACATCTCTGCCAAACCCCAAAA
ACAAAGAACCCTAACACCAGCCTAACCAGATTTCAAATTTTATCTTTTGGCGGTATGCAC
TTTTAACAGTCACCCCCCAACTAACACATTATTTTCCCCTCCCACTCCCATACTACTAAT
CTCATCAATACAACCCCCGCCCATCCTACCCAGCACACACACACCGCTGCTAACCCCATA