Discourse Sysadmin Tips & Tricks #1

Automatically cd /var/discourse on login to the server

I have been typing cd /var/discourse every time I SSH’d into a server for 5 years! I only just today realised I could make it automatically do this for me! Should have done it years ago!

echo "cd /var/discourse" >> ~/.bashrc

or if we are speaking Ansible (useful if you sysadmin many Discourses)

ansible -i <YOUR INVENTORY> all -m lineinfile -a "path=~/.bashrc line="cd /var/discourse" will append that line to the end of each ~.bashrc in the inventory.