Skip to content

Instantly share code, notes, and snippets.

View cheeseonamonkey's full-sized avatar
😅
Sweating, and smiling

Alexander H cheeseonamonkey

😅
Sweating, and smiling
View GitHub Profile
@cheeseonamonkey
cheeseonamonkey / backup_home.zsh
Last active October 18, 2024 19:45
backup_home.zsh
#!/bin/bash
# Set the backup filename
BACKUP_FILE="home_backup_$(date +%Y%m%d).squashfs"
# Create a temporary directory to hold the files to be backed up
TEMP_DIR=$(mktemp -d)
# Copy the files to the temporary directory
cp -r "$HOME"/.bash_logout "$TEMP_DIR"
@cheeseonamonkey
cheeseonamonkey / bcache_benchmarker.zsh
Last active October 13, 2024 20:38
bcache_benchmarker.zsh
#!/bin/zsh
# Define paths and test file size
TEST_FILE_SIZE=1024 # Size in MB (1G = 1024MB)
TEST_FILE_PATH_ROOT="/testfile"
TEST_FILE_PATH_HDD="/hdd/testfile"
# Clear bcache stats
echo "Clearing bcache stats..."
echo 1 | sudo tee /sys/block/bcache0/bcache/clear_stats > /dev/null
// Piece values
const piece = {
"P": 100,
"N": 280,
"B": 320,
"R": 479,
"Q": 929,
"K": 60000
};
@cheeseonamonkey
cheeseonamonkey / chesscomapi.js
Created May 20, 2024 20:09 — forked from replete/chesscomapi.js
get game data from chess.com API
//https://api.chess.com/pub/player/{username}/games/2023/02
(async function main () {
async function getChessGamesForMonth(username, year, month) {
const res = await fetch(`https://api.chess.com/pub/player/${username}/games/${year}/${month}`);
if (res.ok) {
const data = await res.json();
return data.games
} else {
console.error('Problem loading chess.com games from API', res);

Most Important Azure Services

Service Description Example
Azure Compute Virtual Machines, Virtual Machine Scale Sets, Azure Kubernetes Service Azure VMs hosting web applications
Azure Storage Blob Storage, File Storage, Queue Storage, Table Storage Storing user files in Azure Blob Storage
Azure Networking Virtual Network, Load Balancer, Application Gateway, VPN Gateway Creating a secure network for an application
Azure Databases Azure SQL Database, Cosmos DB, Azure Database for MySQL/PostgreSQL Storing customer data in Azure SQL Database
Azure Identity Azure Active Directory, Azure AD B2C, Azure AD B2B Managing user identities for an application
Azure AI Azure Machine Learning, Azure Cognitive Services, Azure Bot Services Integrating chatbots into a website using Azure Bot Services
Azure D
@cheeseonamonkey
cheeseonamonkey / GithubReadmeTemplate.md
Created May 5, 2024 00:16
github readme template (source: /othneildrew/Best-README-Template/)

@cheeseonamonkey
cheeseonamonkey / downloadWikiDumps.js
Created April 27, 2024 02:07
Wikipedia dumps download script
/*
npm install axios cheerio fs-extra
*/
// Import the necessary libraries
const axios = require('axios');
const cheerio = require('cheerio');
const fs = require('fs-extra');
const path = require('path');

usage:

ui:

image

shell:

    py wiki_to_text.py '/hdd/Downloads/simplewiki-20240120-pages-meta-current.xml.bz2' `pwd`/output/
@cheeseonamonkey
cheeseonamonkey / scalers.py
Last active March 6, 2024 00:03
python scalers and transforms cheatsheet
import numpy as np
import matplotlib.pyplot as plt
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, MaxAbsScaler, Normalizer
# Generate demonstration data ensuring positivity
better_datasets = [
np.random.rand(100, 2) * 20 + 10,
np.random.rand(100, 2) * 100,
np.random.beta(100, 2, size=(100, 2)),
np.random.f(100, 2, size=(100, 2)),
@cheeseonamonkey
cheeseonamonkey / Float32_Base64_Encoding_Decoding.js
Created December 23, 2023 08:51 — forked from sketchpunk/Float32_Base64_Encoding_Decoding.js
Encode Float32Array to base64 , then decode it back
let verts = new Float32Array( [ 0, 2, 0, -1, 0.2, 0, 1, 0.2, 0 ] );
let v = base64_test( verts );
function base64_test( fary ){
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ENCODING TEST
console.log("Origin Data", fary );
let uint = new Uint8Array( fary.buffer );
console.log( "Convert F32 to Uint8 : Byte Length Test", fary.length * 4, uint.length );