initial commit
This commit is contained in:
commit
72eb4be6d1
8 changed files with 88 additions and 0 deletions
1
CONTRIBUTING
Normal file
1
CONTRIBUTING
Normal file
|
@ -0,0 +1 @@
|
||||||
|
please don't
|
13
LICENSE
Normal file
13
LICENSE
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
|
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.
|
33
README.md
Normal file
33
README.md
Normal file
|
@ -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 <mountpoint> <size>`
|
||||||
|
|
||||||
|
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 <mountpoint>`.
|
||||||
|
|
||||||
|
## `ramdl`
|
||||||
|
|
||||||
|
Usage: `# ramdl <user@host:path> <mountpoint>`
|
||||||
|
|
||||||
|
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)
|
BIN
media/eyes.gif
Normal file
BIN
media/eyes.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
BIN
media/now.png
Normal file
BIN
media/now.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
BIN
media/wtfpl.png
Normal file
BIN
media/wtfpl.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
21
ramdl
Executable file
21
ramdl
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# ramdl <user@host:path> <mountpoint>
|
||||||
|
|
||||||
|
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
|
20
ramdl_server
Executable file
20
ramdl_server
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# ramdl_server <mountpoint> <size>
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in a new issue