- Download docker-compose.yml to dir named
sentry - Change SENTRY_SECRET_KEY to random 32 char string
- Run
docker-compose up -d - Run
docker exec -it sentry_sentry_1 sentry upgradeto setup database and create admin user - Run
docker exec -it pip install sentry-slackif you want slack plugin, it can be done later - Run
docker restart sentry_sentry_1 - Sentry is now running on public port 9000
In order to run this image do:
docker-compose up -d to get all up.
On first run DB initialization and initial user setup is done like so:
First start a bash in the container: docker-compose exec sentry /bin/bash.
Then, inside bash, do sentry upgrade wait until it asks you for an inital user.
When finished exit the bash.
When in doubt check with docker-compose ps if all went fine.
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
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |
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
| # see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
| # core | |
| brew install coreutils | |
| # key commands | |
| brew install binutils | |
| brew install diffutils | |
| brew install ed --default-names | |
| brew install findutils --with-default-names |
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
| from .models import Post, Category | |
| from .decorators import action_form | |
| class PostCategoryForm(forms.Form): | |
| title = 'Update category for the selected posts' | |
| myfile = forms.FileField() | |
| category = forms.ModelChoiceField(queryset=Category.objects.all()) |
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
| #!/bin/bash | |
| # remove exited containers: | |
| docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
| # remove unused images: | |
| docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
| # remove unused volumes: | |
| find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
| import jwt | |
| from django.conf import settings | |
| from django.contrib.auth.models import User | |
| from rest_framework import exceptions | |
| from rest_framework.authentication import TokenAuthentication | |
| class JSONWebTokenAuthentication(TokenAuthentication): |
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
| from django.contrib import admin | |
| from polls.models import Poll, Choice | |
| from django.contrib.auth.models import User | |
| from django.contrib.admin import AdminSite | |
| from polls.views import index | |
| class MyAdminSite(AdminSite): |