Skip to content

Instantly share code, notes, and snippets.

View dvdtoth's full-sized avatar
🏓
Focusing

David Toth dvdtoth

🏓
Focusing
View GitHub Profile
@dvdtoth
dvdtoth / gist:cdd9dfdde92cee54ba3cfdb38d152969
Last active January 28, 2025 10:54
48 VRAM deepseek-r1 setup
# How to run DeepSeek-R1 and other recent models on a dual CUDA GPU setup with layers offloaded to GPUs.
# I'm running these on 2x4090 with 48Gb combined VRAM.
# Installation
# Ensure you have cmake installed
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build -DGGML_CUDA=ON -DLLAMA_CURL=ON
cmake --build build --config Release
@dvdtoth
dvdtoth / npub2hex.py
Created February 3, 2023 11:44
Nostr Bech32 npub to hex
from nostr.key import PublicKey
print(PublicKey('').from_npub("npub18km328aqzchsrd9lhhfkedyah9qs0umjhletrncfq29w9jkm78gqjkw66k").hex())
@dvdtoth
dvdtoth / init.sh
Last active December 30, 2020 12:22
HackTheBox Pwnbox init script
#### Initialize pwnbox ####
#### sudo /bin/bash -c "$(curl -fsSL [gist-url])"
export U=htb-scl
## Prompt update
cat << EOT >> /home/$U/.bashrc
@dvdtoth
dvdtoth / gsinit.sh
Last active March 6, 2023 02:06
Google cloud shell
#!/bin/bash
sudo apt install -y masscan nmap netcat openvpn
echo "#!/bin/bash" > /tmp/full
echo "masscan -p1-65535,U:1-65535 $1 --rate=1000 -e eth0" >> /tmp/full
chmod +x /tmp/full
echo "#!/bin/bash" > /tmp/scan
@dvdtoth
dvdtoth / gist:33c791dc214b0d46c4db
Created November 30, 2015 18:24
cloud-config-deis
#cloud-config
coreos:
etcd2:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: #DISCOVERY_URL
# multi-region and multi-cloud deployments need to use $public_ipv4
advertise-client-urls: http://$private_ipv4:2379
initial-advertise-peer-urls: http://$private_ipv4:2380
# listen on both the official ports and the legacy ports
#cloud-config
hostname: kenobi
coreos:
etcd2:
advertise-client-urls: "http://$public_ipv4:2379"
listen-client-urls: "http://0.0.0.0:2379"
units:
- name: etcd2.service
#!/bin/bash
# Usage:
# sql-importer.sh yourdb.sql.gz target_db
zcat < $1 |pv --format 'Importing... %t - %e - %r - %b %p' --size `gzip -l $1 | sed -n 2p | awk '{print $2}'` | mysql -uroot -pyourrootpass $2
@dvdtoth
dvdtoth / puppet-userdata.sh
Last active August 29, 2015 14:02
Puppet Enterprise agent user data setup
#!/bin/bash
# Puppet User Data
# Basic initialization script to set up hostname and puppet enterprise agent on new instances
# Author: David Toth
HOSTNAME='rabbit1'
PUPPETMASTER='ip-10-0-0-131'
# Set hostname
var pane = $('#pane'),
box = $('#box'),
maxValue = pane.width() - box.width(),
keysPressed = {},
distancePerIteration = 3;
function calculateNewValue(oldValue, keyCode1, keyCode2) {
var newValue = parseInt(oldValue, 10)
- (keysPressed[keyCode1] ? distancePerIteration : 0)
+ (keysPressed[keyCode2] ? distancePerIteration : 0);