| # TODO throwing error: | |
| # Cannot find a resource for to_ary on ubuntu version 12.04 | |
| require 'set' | |
| file "/root/chef_resources-#{node.name}.json" do | |
| resource_clxn = Chef::ResourceCollection.new | |
| run_context.resource_collection.each do |r| | |
| next if r.class.to_s == 'Chef::Resource::NodeMetadata' | |
| r = r.dup |
| # vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
| # Author: Avishai Ish-Shalom <[email protected]> | |
| SED=sed | |
| # first argument set the command level | |
| _get_knife_completions() { | |
| n=$1 | |
| shift | |
| # first argument is knife, so shift it |
| #!/bin/sh | |
| genpasswd() { | |
| local l=$1 | |
| [ "$l" == "" ] && l=16 | |
| cat /dev/urandom | LC_CTYPE=C tr -dc A-Za-z0-9_ | head -c ${l} | |
| echo | |
| } | |
| genpasswd "$@" |
| #!/usr/bin/env bash | |
| # | |
| # Author: Stefan Buck | |
| # License: MIT | |
| # https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | |
| # | |
| # | |
| # This script accepts the following parameters: | |
| # | |
| # * owner |
| # 1. First of all of course get Manjaro: | |
| https://manjaro.org/get-manjaro/ | |
| # I recommend using Etcher to copy the image to your USB: | |
| https://etcher.io/ | |
| # 2. Before installing make sure: | |
| # - Secure boot is disabled in BIOS | |
| # - Your SSD, HDD or NVME drive is set to AHCI instead of RAID | |
| # - Fastboot should be on Auto or minimal, but this shouldn't matter to much |
| #!/bin/sh | |
| # Launch a Pod ab-using a hostPath mount to land on a Kubernetes node cluster as root | |
| # without requiring `privileged: true`, in particular can abuse `DenyExecOnPrivileged` | |
| # admission controller. | |
| # Pod command in turn runs a privileged container using node's /var/run/docker.sock. | |
| # | |
| # Tweaked for PKS nodes, which run their docker stuff from different | |
| # /var/vcap/... paths | |
| node=${1} | |
| case "${node}" in |
| #!/bin/bash | |
| interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) ) | |
| rulefile="rules.tmp" | |
| echo "" > $rulefile | |
| sudo pfctl -a com.apple/tun -F nat | |
| for i in "${interfaces[@]}" | |
| do | |
| RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}" | |
| echo $RULE >> $rulefile | |
| done |
A pattern for building personal knowledge bases using LLMs.
This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.