Skip to content

Instantly share code, notes, and snippets.

@alexej-d
alexej-d / discourse-install-plugin.md
Last active April 3, 2019 12:38
Install a Discourse plugin in a bitnami dockerized discourse instance
docker exec -it PREFIX_discourse_1 /bin/bash
cd opt/bitnami/discourse
RAILS_ENV=production bundle exec rake plugin:install repo=PLUGIN_REPO_URL
RAILS_ENV=production bundle exec rake assets:precompile
git init
git remote add origin [email protected]:USER/PROJECT.git
git fetch
git reset origin/master
git branch --set-upstream-to=origin/master
git reset --hard HEAD
@alexej-d
alexej-d / sync-back-from-server.sh
Last active December 6, 2017 09:18
Sync changes on remote environment to local directory
ssh [email protected] "cd PROJECT_DIR; git status -s" | awk '{print $2}' | sed 's/\(.*\)/rsync -cav [email protected]:\/full\/path\/to\/PROJECT_DIR\/\1 .\/\1/' | sh
@alexej-d
alexej-d / bitbucket-ssh-deployment-key.sh
Last active November 28, 2017 10:09
Set up SSH deployment key for Bitbucket
ssh-keygen # generate key, follow instructions
cat ~/.ssh/id_rsa.pub # add output to bitbucket repository
# test if everything went fine
ssh -T [email protected]
@alexej-d
alexej-d / public-key-to-remote-server.sh
Last active November 28, 2017 10:10
Add public key to remote server's authorized_keys via SSH
cat ~/.ssh/id_rsa.pub | (ssh [email protected] "cat >> ~/.ssh/authorized_keys")
@alexej-d
alexej-d / .babelrc
Created September 22, 2017 08:58
Drupal 8 theme development with Webpack, SASS, ES6 and BrowserSync serving
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}