Skip to content

Instantly share code, notes, and snippets.

View carterprince's full-sized avatar

Carter Prince carterprince

View GitHub Profile
#!/bin/bash
# configuration
HOSTNAME=desktop
TIMEZONE="America/New_York"
DISK=/dev/sda
EFI=/dev/sda1
SWAP=/dev/sda2
ROOT=/dev/sda3
# Define the board
board = [
[5, 3, 0, 0, 7, 0, 0, 0, 0],
[6, 0, 0, 1, 9, 5, 0, 0, 0],
[0, 9, 8, 0, 0, 0, 0, 6, 0],
[8, 0, 0, 0, 6, 0, 0, 0, 3],
[4, 0, 0, 8, 0, 3, 0, 0, 1],
[7, 0, 0, 0, 2, 0, 0, 0, 6],
[0, 6, 0, 0, 0, 0, 2, 8, 0],
[0, 0, 0, 4, 1, 9, 0, 0, 5],
@carterprince
carterprince / split_file.py
Last active March 17, 2023 16:50
python script that takes a given file and splits it into N new files with N GPT-3 tokens each
import sys
from transformers import GPT2Tokenizer
def split_file(file_path, output_prefix, tokens_per_file):
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
with open(file_path, 'r') as file:
text = file.read()
tokens = tokenizer.encode(text)
@carterprince
carterprince / libby-rewrite
Created July 25, 2022 18:59
libby rewrite by stewie410 w/ modifications
#!/usr/bin/env bash
#
# A simple CLI tool to quickly download books from Library Genesis
cleanup() {
rm --recursive --force "${stage}"
unset stage
}
show_help() {
#!/bin/bash
while true; do
/data/data/com.termux/files/home/countdown &
sleep 0.9
done
@carterprince
carterprince / password.py
Created March 30, 2017 18:29
Generates a random password using common ascii numbers, letters and symbols.
import math
import random
#get user input as to how long they want the password
passwordlen = int(input("How long would you like your password to be? : "))
#our chars
chars = "abcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*"
charlist = []