Skip to content

Instantly share code, notes, and snippets.

@ToMe25
ToMe25 / import.py
Created July 8, 2022 16:16
A python implementation of the OC2 import.lua script
#!/usr/bin/micropython
import devices
import math
import sys
io_device = devices.bus().find("file_import_export")
if not io_device:
@ToMe25
ToMe25 / backup.sh
Last active April 4, 2022 17:09
A simple rsync based bash script to create backups on a ftp server.
#!/bin/bash
# Change to where you want your backup to be.
# This script will create two backups in there, called "Backup1" and "Backup2".
# Note that the directory you set here has to exists, while Backup1 and Backup2 do not matter.
BACKUP_DIR="ftp_user@ftp_server:/some/path/for/backups/"
# The directory in which the directories to be backed up(specified in backup.txt) are.
BACKUP_ROOT_DIR=..
# The mac address to wake up using Wake on Lan.
@ToMe25
ToMe25 / sftp.yaml
Last active December 14, 2022 14:13 — forked from jujhars13/sftp.yaml
A improved version of jujhars13s kubernetes pod example for atmoz/sftp.
# This kubernetes manifest for http://github.com/atmoz/sftp is made by ToMe25, based on a similar one by jujhars13.
#
# Usage:
# 1. Create the sftp namespace using `kubectl create namespace sftp`.
# 2. Copy your `~/.ssh/id_rsa.pub` file(can be generated with `ssh-keygen` if missing) to a new folder named `client_keys`.
# Also add the `id_rsa.pub` files of all other users you want to be able to log in without a password to this folder.
# 3. Create host keys for the sftp server in a new folder named `host_keys` by running `ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key`
# and `ssh-keygen -t ed25519 -f ssh_host_ed25519_key` in it.
# 4. Create a Kubernetes secret from the client keys by running `kubectl create secret generic sftp-client-public-keys -n sftp --from-file=client_keys`.
# 5. Create another Kubernetes secret from the host keys by running `kubectl create secret generic sftp-host-keys -n sftp --from-file=host_keys`.
@ToMe25
ToMe25 / WorldProfiler.java
Created January 19, 2020 21:27
A tiny minecraft mod to get the ore rarity values for botania based on https://gist.github.com/Vazkii/9493322.
package com.tome.worldprofiler;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;