commit 72eb4be6d1db176f38fb93c172bde61d914a16c1 Author: TriMill Date: Wed Apr 5 13:59:22 2023 -0400 initial commit diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..d961924 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1 @@ +please don't diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..49876cd --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7ee9b6c --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# ramdl: download moar RAM (100% reel no scamz no hackz) + +Is your computer constantly low on memory? Need more dedotated wam for your minecraft server? Want to run [modern](https://code.visualstudio.com/), [21st century](https://hyper.is/) [software](https://github.com/aleksey-hoffman/sigma-file-manager)? + +With `ramdl`, downloading more RAM has never been so easy. Gone are the days of [slow, inefficient](https://downloadmoreram.com/) RAM downloading methods. Downloading more RAM is as simple as following these three easy steps: + +1. Obtain access to a server with plenty of RAM +2. Run the `ramdl_server` script as root on the server +3. Run the `ramdl` script as root on your PC + +## `ramdl_server` + +Usage: `# ramdl_server ` + +For example, to create a 1G ramdisk at `/mnt/ramdl`, run `# ramdl_server /mnt/ramdl 1G`. The script will create the directory if it does not already exist. + +To unmount the ramdisk, simply `# umount `. + +## `ramdl` + +Usage: `# ramdl ` + +For example, if the previous command was run from `example.com`, we could mount it to `/mnt/downloaded-ram` with `# ramdl user@example.com:/mnt/ramdl /mnt/downloaded-ram`. + +## Disclaimer + +PLEASE DO NOT run `ramdl` on a real machine. as the downloaded ram is very slow, it is quite likely that corruption will occur. + +`ramdl_server` *should* be safe to run on a real machine (i have done so to great success), but i take no responsibility for what happens if you do. + +![WTFPL Icon](./media/wtfpl.png) +![Download RAM](./media/now.png) +![Best viewed with eyes](./media/eyes.gif) diff --git a/media/eyes.gif b/media/eyes.gif new file mode 100644 index 0000000..6dfeb64 Binary files /dev/null and b/media/eyes.gif differ diff --git a/media/now.png b/media/now.png new file mode 100644 index 0000000..254c3a7 Binary files /dev/null and b/media/now.png differ diff --git a/media/wtfpl.png b/media/wtfpl.png new file mode 100644 index 0000000..d039d0b Binary files /dev/null and b/media/wtfpl.png differ diff --git a/ramdl b/ramdl new file mode 100755 index 0000000..319e3a7 --- /dev/null +++ b/ramdl @@ -0,0 +1,21 @@ +#!/bin/sh + +# ramdl + +ramdl_script() { + printf "Mounting sshfs at '%s' to '%s'\n" "$1" "$2" + sshfs "$1" "$2" || exit 1 + printf "Making swap\n" + mkswap "$2"/ramdl || exit 1 + printf "Making loopback device\n" + losetup -f "$2"/ramdl || exit 1 + loopdev="$(losetup -j "$2"/ramdl | cut -d":" -f1)" + printf "Swapping\n" + swapon "$loopdev" || exit 1 +} + +if [ "$#" -eq 2 ]; then + ramdl_script "$1" "$2" || (printf "Failure\n"; exit 1) && printf "Success\n" +else + printf "Wrong argument count\n"; exit 1 +fi diff --git a/ramdl_server b/ramdl_server new file mode 100755 index 0000000..87a5aeb --- /dev/null +++ b/ramdl_server @@ -0,0 +1,20 @@ +#!/bin/sh + +# ramdl_server + +ramdl_script() { + printf "Creating ramdisk at %s of size %s\n" "$1" "$2" + mkdir -p "$1" || exit 1 + chown root:root "$1" || exit 1 + mount -t ramfs -o size="$2" "ramdl_disk" "$1" || exit 1 + printf "Creating swapfile\n" + dd if=/dev/zero of="$1/ramdl" bs="$2" count=1 || exit 1 + printf "Setting permissions\n" + chmod -R 777 "$1" || exit 1 +} + +if [ "$#" -eq 2 ]; then + ramdl_script "$1" "$2" || (printf "Failure\n"; exit 1) && printf "Success\n" +else + printf "Wrong argument count\n"; exit 1 +fi