Skip to content

Instantly share code, notes, and snippets.

View Techcable's full-sized avatar
🇺🇸
Procrastinating

Techcable

🇺🇸
Procrastinating
View GitHub Profile
@Techcable
Techcable / Reflection.java
Created September 3, 2015 18:05
Get TPS
/**
* The MIT License
* Copyright (c) 2014-2015 Techcable
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@Techcable
Techcable / LICENSE
Created July 13, 2015 02:27
All rights reserved License
All Rights Reserved
Copyright (c) ${project.inceptionYear} ${owner}
Created by Techcable
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@Techcable
Techcable / LICENSE.md
Created March 23, 2024 23:08
License file for dual-licensing under Apache-2.0 and BlueOak-1.0.0

License

This project is dual-licensed under the either the Apache License 2.0 or the Blue Oak Model License 1.0.0, at your option.

Both licenses are OSI Approved. Copies are available in the licenses/ directory.

Automatic Contributor License

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

@Techcable
Techcable / start.sh
Last active February 25, 2024 11:02
Minecraft Launch Script (and options)
#!/bin/bash
# The type of the server: spigot, bukkit, paper, taco
SERVER_BRAND=taco
# The minecraft version
SERVER_VERSION=1.8.8
# The amount of memory you want the server to use
TARGET_MEMORY=512M
# The maximum amount of memory the server is allowed to use
@Techcable
Techcable / README.md
Last active January 6, 2024 21:27
Backup a set of SMS backup files from Android's "SMS Backup and Restore"

SMS Backups

Sms Backups (for the paranoid) using Andorid's "SMS Backup and Restore"

  1. Install "SMS Backup and Restore" to backup periodically
    • Configure backups to a cloud provider like "Google Drive"
    • Ideally backup phone clals as well
  2. Wait until the Cloud Provider runs low on storage
    • This should happen relatively quickly, since my SMS files take 300+ MB each (they include photo/videos)
  3. Download the backup folder
@Techcable
Techcable / LICENSE.txt
Created August 27, 2023 01:42
The Apache 2.0 License with LLVM Exception (SPDX ID: `Apache-2.0 WITH LLVM-exception`)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
@Techcable
Techcable / varint.py
Last active August 24, 2023 08:55
Command Line Varint Decoder/Encoder Tool
from typing import Iterable
from argparse import ArgumentParser
from sys import exit
parser = ArgumentParser(description="Parses and dencodes protobuf varints")
parser.add_argument("mode", help="Whether to encode or decode")
parser.add_argument("num", help="The number to decode/encode")
args = parser.parse_args()
@Techcable
Techcable / listfiles.sh
Created August 19, 2023 06:04
Simple shell script to list files
#!/bin/bash
if [[ "$#" -ne 2 ]]; then
echo "ERROR: Invalid number of arguments" >&2;
echo >&2;
echo "Usage: ./listfiles.sh <directory> <outfile>" >&2;
exit 1;
fi
TARGET_DIR="$1";
#!/bin/sh
confirm() {
local prompt="$1";
local default;
case "$2" in
true | True | yes)
default="True";
;;
false | False | no)
@Techcable
Techcable / byte_format.py
Created August 18, 2023 03:19
Minature python library which formats bytes for user display
from decimal import Decimal
from enum import IntEnum
from numbers import Real
class ByteUnit(IntEnum):
BYTE = 1
KILLIBYTE = 1024**1
MEGABYTE = 1024**2
GIGABYTE = 1024**3