Skip to content

Instantly share code, notes, and snippets.

View petebytes's full-sized avatar

petebytes petebytes

  • Apsion
  • Fountain Hills, AZ
View GitHub Profile
@petebytes
petebytes / increase_model_context.sh
Last active March 11, 2025 22:26
Script to increase Ollama model context
#!/bin/bash
# developed and tested on a macbook
# original instructions discovered at <https://www.youtube.com/@technovangelist>
# Check if correct number of arguments provided
if [ $# -ne 2 ]; then
echo "Usage: $0 <model_id> <context_size>"
echo "Example: $0 llama2:latest 8192"
exit 1
@petebytes
petebytes / README.md
Last active February 12, 2025 04:49 — forked from awni/README.md
Test Time Scaling with R1-based Models and MLX LM

Test Time Scaling with MLX LM and R1-based LLMs

Install MLX LM:

pip install mlx-lm

And run:

@petebytes
petebytes / setup_bark_wsl.sh
Last active May 2, 2023 04:51
Setup bark on WSL
#!/bin/zsh
# requires Nvidia GPU
# Update package list
sudo apt update
# Remove Outdated Signing Key
sudo apt-key del 7fa2af80
@petebytes
petebytes / Pghero on Rails with Dokku.txt
Created January 16, 2023 16:39 — forked from monsha/Pghero on Rails with Dokku.txt
Pghero on Rails with Dokku
#postgresql setup
ssh -i ~/.ssh/id_rsa root@<domain>
dokku postgres:connect <db>
psql=# SHOW config_file;
-> /var/lib/postgresql/data/postgresql.conf
psql=# \q
docker ps
@petebytes
petebytes / byebug_commands.md
Created August 22, 2021 04:31 — forked from elrayle/byebug_commands.md
Byebug Cheatsheet - organized by related commands

Byebug Cheatsheet

This cheatsheet includes most of the byebug commands organized by related commands (e.g. breakpoint related commands are together).

To see official help...

Command Aliases Example Comments
help h h list top level of all commands
help cmd h cmd-alias h n list the details of a command (example shows requesting details for the next command) (this works for all commands)
@petebytes
petebytes / shrine.rb
Created July 24, 2021 19:20
Attempt to have both Public and Private Shrine Storages
# frozen_string_literal: true
require "shrine"
require "shrine/storage/s3"
s3_options = {
access_key_id: ENV["AWS_ACCESS_KEY"],
secret_access_key: ENV["AWS_SECRET_KEY"],
endpoint: ENV["AWS_ENDPOINT"],
region: ENV["AWS_REGION"],
require 'data-anonymization'
DataAnon::Utils::Logging.logger.level = Logger::INFO
class MyRandomEmail
TLDS = ['com','org','net','edu','gov','mil','biz','info', 'io']
HOSTNAMES = ['google', 'outlook', 'hotmail']
def initialize hostname = nil, tld = nil
@hostname = hostname
@tld = tld
version: '2'
services:
mauticdb:
image: percona/percona-server:5.7
container_name: mauticdb
volumes:
- mysql_data:/var/lib/mysql
environment:
@petebytes
petebytes / _photo.json.jbuilder
Created October 20, 2019 18:24 — forked from TheRealNeil/_photo.json.jbuilder
Using the Trix Editor plus Private File Upload Attachments to S3
json.extract! photo, :id, :image_data, :created_at, :updated_at
json.url photo_url(photo, format: :html)
json.image_url image_url_photo_url(photo)
@petebytes
petebytes / dropzone_controller.js
Created October 10, 2019 06:10 — forked from lazaronixon/_form.html.erb
Dropzone.js + Stimulus + Active Storage
import { Controller } from "stimulus"
import { DirectUpload } from "@rails/activestorage"
import { getMetaValue, toArray, findElement, removeElement, insertAfter } from "helpers"
export default class extends Controller {
static targets = [ "input" ]
connect() {
this.dropZone = createDropZone(this)
this.hideFileInput()