Skip to content

Instantly share code, notes, and snippets.

@DosMike
DosMike / vfs_dir.sh
Created January 4, 2024 22:55
Virtual FileSytem Directory mounting from Image
#!/bin/bash
# This file creates a virtual filesystem image in ext4, written for ubuntu22.04-WSL2.
# The directory name and image name are based on the name of this bash script.
# If you dont like renaming this script, you can edit it below.
# The image size created is 100GB, as defined with vfssizegb below.
#
# This script is neccessary because srcds, as 32-bit application will overflow free
# space if there's too much, and die with the message:
# Out of memory or address space. Texture quality setting may be too high.
@DosMike
DosMike / SpongeDownload.java
Last active December 14, 2019 10:46
Sponge will require hardcoded SHA256 (or better) checks for download to the server in the future. This is an example method implemeting this.
package <your package here>;
import org.spongepowered.api.Platform;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.plugin.PluginContainer;
import javax.net.ssl.HttpsURLConnection;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;