Skip to content

Instantly share code, notes, and snippets.

View Tknott95's full-sized avatar
🍀

TKnott Tknott95

🍀
View GitHub Profile
@Tknott95
Tknott95 / gist:0f3d0bd9adabff6cc97a8e9c68507788
Last active October 2, 2023 00:27
external hdd restore write from read-only

ls -la <path-to-external>

example ls -la /dev/sda

sudo mount -o remount,uid=1000,gid=1000,rw <path-to-external>

example ls -la sudo mount -o remount,uid=1000,gid=1000,rw /dev/sda

this is after I already mounted mount /dev/sda /run/media/x4

@Tknott95
Tknott95 / install.sh
Last active August 29, 2023 09:58
Quick install Model Quantized huggingface via pip
#!/bin/sh
pkgs=(
"huggingface_hub"
"python-dotenv" "openai"
"torch torchvision torchaudio"
"bitsandbytes"
"accelerate>=0.20.3"
"git+https://github.com/huggingface/transformers"
)
@Tknott95
Tknott95 / install.sh
Created August 8, 2023 21:47
install.sh way of doing 00
#!/bin/sh
pkgs=("huggingface_hub" "python-dotenv" "openai")
for pkg in "${pkgs[@]}"; do
echo -e '\n INSTALLING: ' + $pkg
pip install $pkg
done
@Tknott95
Tknott95 / nvidia_set.sh
Last active March 5, 2024 18:42
shell script clocking SETTERS (from honeybadgerminer aka platform137)
#!/bin/bash
# p - power draw | NVIDIA-SMI
# t - temp threshold | NVIDIA-SMI
# f - fan speed | NVIDIA-SETTINGS
# m - memory transfer rate offset | NVIDIA-SETTINGS
# g - graphics clock offset | NVIDIA-SETTINGS
# NEEDS TO BE REFACTORED AS THIS IS SLOPPY CODE
@Tknott95
Tknott95 / nvidia_get.sh
Last active August 25, 2023 05:06
shell script clocking GETTERS (from honeybadgerminer akja platform137)
#!/bin/bash
# f - is fan speed by provding a gpu-index-#
# l - list amount of GPUs
# m - memory clock
# g - graphics clock
# p - power draw
# @TODO - NEED A SCRIPT TO PULL TEMP LIMIT
# CODE NEEDS TO BE REFACTORED THIS IS SLOPPY
addr1q8aez3jp4m2zzangdhvux0952hhnsp6w3mep7xzsru7mmxneddtv450pl94c7n6xtlnp9dgwksv5z4aczj575jjgk9esn9x8ur
@Tknott95
Tknott95 / pychive.py
Last active March 21, 2023 19:15
pychive - the quick and dirty python yotuube playlist archiver (willk add flags for diff types of archiving). This is faster than yt_dlp
import os
import pytube
from multiprocessing import Process
playlist_url = input("Enter the playlist url: ")
folder_name = input("Enter the folder name where the videos will be downloaded: ")
procs_running = []
@Tknott95
Tknott95 / x7A65726F5F7A65726F.MD
Created February 27, 2023 22:41
x7A65726F5F7A65726F

semantics as spears whilst logic a red herring

@Tknott95
Tknott95 / perms.py
Last active April 20, 2023 17:13
A sloppy python permutative-based "precision" wallet brute forcer (have to run local-node and cardano wallet)
# A sloppy python permutative-based "precision" wallet brute forcer (have to run local-node and cardano wallet)
# if you recover too many at once syncs can take a crazy amount of time, which you need a certain % synced to check balance even if keys worked and a wallet was found, so this might be a bad way to approach this
# on big scrapes you will recover many empties with successful keys
import itertools
import requests
import json
from twilio.rest import Client
@Tknott95
Tknott95 / query_ex_00.MD
Created February 23, 2023 05:41
cardano-db-sync query example to interact with ada handles
-- ADA HANDLES FROM STAKE-KEY
SELECT convert_from(multi_asset.name, 'UTF8') FROM utxo_view JOIN stake_address ON stake_address.id = utxo_view.stake_address_id RIGHT JOIN tx_metadata ON utxo_view.tx_id = tx_metadata.tx_id RIGHT JOIN ma_tx_mint ON ma_tx_mint.tx_id = tx_metadata.tx_id LEFT JOIN multi_asset ON ma_tx_mint.ident = multi_asset.id WHERE view = ? AND multi_asset.policy='\xf0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a';

(test skey on preview: 'stake_test1urc63cmezfacz9vrqu867axmqrvgp4zsyllxzud3k6danjsn0dn70')

 -- w/ naming shortened -- 
SELECT convert_from(ma.name, 'UTF8') FROM utxo_view uv JOIN stake_address sa ON sa.id = uv.stake_address_id RIGHT JOIN tx_metadata txm ON uv.tx_id = txm.tx_id RIGHT JOIN ma_tx_mint ON ma_tx_mint.tx_id = txm.tx_id LEFT JOIN multi_asset ma ON ma_tx_mint.ident = ma.id WHERE view = ? AND ma.policy='\xf0ff48bbb7bbe9d59a40f1ce90e9e9d0ff5002ec48f232b49ca0fb9a';