Skip to content

Instantly share code, notes, and snippets.

@userbox020
userbox020 / get_model_info.py
Created February 19, 2024 07:51
Get LLM data info
import os
import gguf # pip install gguf
import hashlib
import argparse
def calculate_file_hash(filepath):
"""Calculate and return the SHA-256 hash of the file specified by filepath."""
print("Calculating SHA256...", end="\r")
sha256_hash = hashlib.sha256()
@userbox020
userbox020 / nvidia_pcie_test.py
Last active February 17, 2024 02:45
Check nvidia gpu pcie lines, seep and memory
#Works for Windows and Linux
import re
import subprocess
def get_gpu_details():
try:
# Execute the nvidia-smi command to get detailed GPU information
result = subprocess.run(['nvidia-smi', '-q'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
@userbox020
userbox020 / scapy_tcp_handshake.py
Created November 12, 2022 00:43 — forked from tintinweb/scapy_tcp_handshake.py
simple scapy tcp three-way handshake
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Author : tintinweb@oststrom.com <github.com/tintinweb>
'''
A simple TCP three-way handshake example
#> python scapy_tcp_handshake.py
DEBUG:__main__:init: ('oststrom.com', 80)
DEBUG:__main__:start
DEBUG:__main__:SND: SYN
/**
* Generates a client ID in the format historically used by the Google Analytics
* JavaScript libraries. Note that any alphanumeric value may be used, but
* ideally each should be unique to a given client.
*
* More information on Client IDs:
* https://developers.google.com/analytics/devguides/collection/protocol/v1/email#client-id-cid
*/
function generateGaClientId() {