This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### If you set up your Mastodon instance before 9th of June 2018, you probably | |
### might not have jemalloc active on your Ruby setup. Jemalloc changes the way Ruby | |
### allocates memory and saves up RAM. On my 140 users instance RAM usage dropped by 300 MB just by using jemalloc. | |
### This is how to set it up on Debian 9 Stretch: | |
### As root, install libjemalloc-dev: | |
apt install libjemalloc-dev | |
### Change to mastodon user: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
You can use this to convert a DOM element or a HTML string to markdown. | |
Usage examples: | |
var markdown = toMarkdown(document.getElementById("content")); | |
// With jQuery you can easily convert HTML strings | |
var markdown = toMarkdown($("<ul><li>Hi!</li></ul>")[0]); |