Skip to content

Instantly share code, notes, and snippets.

View jamesbrink's full-sized avatar
💭
:trollface:

James Brink jamesbrink

💭
:trollface:
View GitHub Profile
@jamesbrink
jamesbrink / create_context_model.sh
Created April 15, 2025 16:59
Quickly create Ollama models with extended context sizes from existing models
#!/usr/bin/env bash
# Script to create an Ollama model with a custom context window size
# Usage: ./create_context_model.sh <source_model> <context_size_in_k>
# Example: ./create_context_model.sh qwen2.5-coder:14b 32
set -e
# Check if Ollama is installed
if ! command -v ollama &> /dev/null; then
echo "Error: Ollama is not installed or not in PATH"
@jamesbrink
jamesbrink / hmm
Last active February 19, 2025 23:00
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\MoSetup" /v AllowUpgradesWithUnsupportedTPMOrCPU /t REG_DWORD /d 1 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f
:: Download Windows 11 ISO using curl (run in PowerShell or Command Prompt)
curl -L -o Win11.iso "https://software-download.microsoft.com/download/sg/444969d5-f34g-4e03-ac9d-1f9786c69161/202111191455.0_x64.iso"
:: Mount the ISO
powershell -command "Mount-DiskImage -ImagePath (Join-Path $pwd 'Win11.iso')"
@jamesbrink
jamesbrink / .env
Last active December 10, 2024 02:57
Attendize setup
ATTENDIZE_DEV=false
ATTENDIZE_CLOUD=false
APP_NAME=Attendize
APP_ENV=local
APP_DEBUG=true
APP_URL=https://localhost:8043
LOG_CHANNEL=stack
#!/bin/bash
# Start all needed gource instances and connect them
# to a named pipe.
repo="misc"
mkfifo ./tmp/${repo}.pipe
title=$repo
# Set out video title.
title="ACME Software Development."
@jamesbrink
jamesbrink / README.md
Created July 8, 2019 21:16
DDOS Iptables rules

Aggresive IPTables Rules

echo "service iptables restart"| at now + 2 min

iptables --flush

### Drop invalid packets ### 
iptables -t mangle -A PREROUTING -m conntrack --ctstate INVALID -j DROP

Keybase proof

I hereby claim:

  • I am jamesbrink on github.
  • I am jamesbrink (https://keybase.io/jamesbrink) on keybase.
  • I have a public key ASCSmjflUWTdTg_CR_lxTsCAtWgUcv2u_VOW-5WxIB5qyAo

To claim this, I am signing this object:

@jamesbrink
jamesbrink / mac.sh
Created February 20, 2019 05:16
Generate random MAC
#!/usr/bin/env bash
hexdump -vn3 -e '/3 "52:54:00"' -e '/1 ":%02x"' -e '"\n"' /dev/urandom
@jamesbrink
jamesbrink / Dockerfile
Created February 8, 2019 02:07
IPFS Dockerfile
FROM golang:1.11.5-alpine3.9
ARG IPFS_VERSION="v0.4.18"
ARG IPFS_CLUSTER_VERSION="v0.8.0"
ARG IPFS_WEBUI_VERSION="v2.3.3"
ARG IPFS_SRC_DIR="/go/src/github.com/ipfs"
# Build IPFS & IPFS Cluster from source.
WORKDIR ${IPFS_SRC_DIR}
@jamesbrink
jamesbrink / patch.patch
Last active July 20, 2019 02:30
the file name is not a typo
From b0a9156259c1ff9f1a0d42a86e08250e37248a0b Mon Sep 17 00:00:00 2001
From: James Brink <[email protected]>
Date: Thu, 27 Dec 2018 04:50:56 -0700
Subject: [PATCH] Updated output_files function to prevent segfault.
I have updated the output_files function in patch.c to gracefully
handle the following scenario.
Given a git style patch like the following.
@jamesbrink
jamesbrink / pull_reps.sh
Created January 3, 2019 16:13
Pull all repos from private gitlab server
#!/usr/bin/env bash
BASE_PATH="https://yourgitlab.server/"
GROUP_OUTPUT="{ \"group_name\": .full_path, \"group_id\": .id }"
PROJECT_OUTPUT="{ \"project_name\": .path, \"project_url\": .ssh_url_to_repo }"
if [ -z "$GITLAB_PRIVATE_TOKEN" ]; then
echo "Please set the environment variable GITLAB_PRIVATE_TOKEN"
echo "See ${BASE_PATH}profile/account"
exit 1
fi
gitlab_groups=$(curl -s "${BASE_PATH}api/v4/groups?private_token=$GITLAB_PRIVATE_TOKEN&per_page=9999" | jq --raw-output --compact-output ".[] | $GROUP_OUTPUT")