Skip to content

Instantly share code, notes, and snippets.

Beast Mode

Beast Mode is a custom chat mode for VS Code agent that adds an opinionated workflow to the agent, including use of a todo list, extensive internet research capabilities, planning, tool usage instructions and more. Designed to be used with 4.1, although it will work with any model.

Below you will find the Beast Mode prompt in various versions - starting with the most recent - 3.1

Installation Instructions

  • Go to the "agent" dropdown in VS Code chat sidebar and select "Configure Modes".
  • Select "Create new custom chat mode file"
@0xack13
0xack13 / nginx-config-auth-cert-ssl.md
Created November 24, 2023 03:29 — forked from alexishida/nginx-config-auth-cert-ssl.md
Tutorial to configure Nginx client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Original: https://gist.github.com/mtigas/952344

Convert SSL certificate from CRT format to PEM

openssl x509 -in server.crt -out server.der -outform DER
openssl x509 -in server.der -inform DER -out server.pem -outform PEM
@1devm0
1devm0 / table.c
Last active December 3, 2023 05:45
A Hash Table in C
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef uint8_t u08;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int32_t i32;
@fatih
fatih / poly-file-layer.txt
Created March 19, 2023 17:44
Poly file layer
Poly File Layer
Idea: A single file content to represent a set of identical or similar files.
* Files can be templated. Files generated by the template are identical in the PFL (Poly File Layer)
* Files that have common lines, can be linked and marked as a Poly File.
Prior Art
* [ ] Read the paper
* Extracting a Unified Directory Tree to Compare Similar Software Products: https://sel.ist.osaka-u.ac.jp/lab-db/betuzuri/archive/1012/1012.pdf
* Fast Search in Hamming Space with Multi-Index Hashing: http://www.cs.toronto.edu/~norouzi/research/papers/multi_index_hashing.pdf
@0xack13
0xack13 / go-ssh-encrypted-pem.go
Created February 12, 2023 23:09
Using golang ssh client with an encrypted private key
package main
import (
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"golang.org/x/crypto/ssh"
"io/ioutil"
"net"
trap("SIGINT") { exit! }
total_width = `stty size`.scan(/\d+/)[1].to_i # terminal width
snowflakes = {}
puts "\033[2J"; # clearing output
loop do
snowflakes[rand(total_width)] = 0
@rsms
rsms / cgroup2-cpu-limit.sh
Last active August 25, 2025 15:59
Example of limiting how much CPU a process can use in linux with cgroup2
#!/bin/sh
set -e
# Documentation and guides:
# https://docs.kernel.org/admin-guide/cgroup-v2.html
# https://lore.kernel.org/lkml/[email protected]/T/
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_monitoring_and_updating_the_kernel/using-cgroups-v2-to-control-distribution-of-cpu-time-for-applications_managing-monitoring-and-updating-the-kernel
# remove if already exists
[ -e /sys/fs/cgroup/test1 ] && rmdir /sys/fs/cgroup/test1
@rsms
rsms / apk-size-list.sh
Created September 1, 2022 17:50
apk: list installed packages sorted by file size (e.g. alpine linux)
#!/bin/ash
# list installed packages sorted by file size
apk info -e -s \* >/tmp/apksize
awk 'NR % 3 == 1' /tmp/apksize | cut -d ' ' -f 1 > /tmp/apkname
awk 'NR % 3 == 2' /tmp/apksize > /tmp/apksize2
while read -r n unit; do
B=$n
case "$unit" in
@apsun
apsun / lrucache.go
Last active May 15, 2022 13:10
LRU cache using Go 1.18 generics
package main
type lruNode[K comparable, V any] struct {
prev *lruNode[K, V]
next *lruNode[K, V]
key K
value V
}
type LRUCache[K comparable, V any] struct {
@rsms
rsms / example.txt
Last active March 11, 2023 23:00
source line-length histogram script
./linelen_hist.sh src '*.c'
COLS COUNT
2 1317 ████████████████████████████████████████████████████████████▌
4 583 ██████████████████████████▏
6 500 ██████████████████████▎
8 253 ███████████▊
10 264 ████████████▊
12 448 ████████████████████▋
14 417 ███████████████████▌
16 476 █████████████████████▍