Skip to content

Instantly share code, notes, and snippets.

@Hello1024
Hello1024 / hierarchical_compression.py
Created March 16, 2022 14:14
test code to try out hierarchical compression for ZIM files
#!/bin/python3
import pyzstd
import os
import re
from collections import Counter
import itertools
# All files in "wiki/A" directory get added
# Create with:
#!/bin/env python
from pygcode import *
import pygcode
import math
prefix = """
M82 ;absolute extrusion mode
M140 S60 ; set bed temperature to 55 C and continue
M104 S200 ; set hot end temperature to 210 C and continue
@Hello1024
Hello1024 / wastedpages.py
Created March 3, 2021 18:26
Quick script to find out how much RAM is being used inefficiently or wasted.
#!/bin/env python3
# Requires https://github.com/Hello1024/devmem-full-access
# Requires pip install
from bloom_filter import BloomFilter #
import re
import hashlib
def allRamPages():
with open('/proc/iomem', 'r') as iomemfile:
#!/bin/bash
# Run this on This AMI on AWS:
# https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-b36981d8
# You should get yourself a fully working GPU enabled tensorflow installation.
cd ~
# grab cuda 7.0