[Guide] Increase max characters posting count limit for self-hosted Mastodon server

- Posted in Guides by

If you search for the max_characters keyword in the Mastodon Github repository, you will see that it all points to the value within the StatusLengthValidator and a variable called MAX_CHARS.

MAX_CHARACTERS_LOCAL  = 255

To modify it, first, ssh into your Mastodon server, and switch to the root shell:

sudo -s

Then, switch to the Mastodon user

su - mastodon

Now, modify the validator file:

nano -w live/app/validators/status_length_validator.rb

At the very top of the file, you will see the MAX_CHARS variable, which was by default 500, you can modify it to another integer, for example 3000 to allow a maximum of 3000 characters within each post.

class StatusLengthValidator < ActiveModel::Validator
  MAX_CHARS = 3000
  URL_PLACEHOLDER_CHARS = 23
  URL_PLACEHOLDER = 'x' * 23

Exit to root shell and restart the Mastodon processes, or simply reboot.

exit
systemctl restart mastodon*

[Guide] PuTTY Backup & Restore [Windows]

- Posted in Guides by

Export

cmd.exe, requires elevated prompt due to reg-edit:

Only sessions (produces file putty-sessions.reg on the Desktop):

regedit /e "%USERPROFILE%\Desktop\putty-sessions.reg" HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

All settings except ssh keys (produces file putty.reg on the Desktop):

regedit /e "%USERPROFILE%\Desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham

Powershell

Only sessions (produces file putty-sessions.reg on the Desktop):

reg export HKCU\Software\SimonTatham\PuTTY\Sessions ([Environment]::GetFolderPath("Desktop") + "\putty-sessions.reg")

All settings except ssh keys (produces file putty.reg on the Desktop):

reg export HKCU\Software\SimonTatham ([Environment]::GetFolderPath("Desktop") + "\putty.reg")


Import

Double-click on the *.reg file and accept the import.

Alternative ways:

cmd.exe, requires elevated command prompt:

regedit /i putty-sessions.reg
regedit /i putty.reg

PowerShell

reg import putty-sessions.reg
reg import putty.reg

Note: do not replace SimonTatham with your username.

Note: These commands will not export the related SSH keys.


Via Registry Editor

Export

  • Launch Run, then type regedit in the open drop down window
  • Navigate to HKEY_CURRENT_USER\Software\SimonTatham
  • Right click on SimonTatham key (directory icon), select Export. Give the file a name (say) putty.reg and save it to your location for later use.
  • Close Registry Editor.

Note: The export (full) will also export the related SSH Host Keys.

Import

  • Check previous method(s)

PuTTY Portable Restore

[path_to_Your_portable_apps]PuTTYPortable\Data\settings\putty.reg