- Download docker-compose.yml to dir named
sentry
- Change
SENTRY_SECRET_KEY
to random 32 char string - Run
docker-compose up -d
- Run
docker-compose exec sentry sentry upgrade
to setup database and create admin user - (Optional) Run
docker-compose exec sentry pip install sentry-slack
if you want slack plugin, it can be done later - Run
docker-compose restart sentry
- Sentry is now running on public port
9000
This file contains 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 | |
if [ $UID -ne 0 ]; then | |
echo Please run as root. | |
exit 1 | |
fi | |
GW=$(ip route | grep default | awk '{print $3}') | |
IF=$(ip route | grep default | awk '{print $5}') | |
TUN=192.18.0.1 | |
echo Detected Network: $GW $IF |
This file contains 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
""" | |
Simple preforking echo server in Python. | |
Python port of http://tomayko.com/writings/unicorn-is-unix. | |
""" | |
import os | |
import sys | |
import socket |
This file contains 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 | |
# Source https://stackoverflow.com/questions/36651091/how-to-install-packages-in-linux-centos-without-root-user-with-automatic-depen | |
pkgname=$1 | |
if [ -z $pkgname ]; then | |
echo "Usage: ./non-root-yum-install.sh pkgname-here" | |
exit 1 | |
fi | |
rand=$(openssl rand -base64 6) |
This file contains 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
# make tarball from sentry_pgdb volume | |
docker run --rm -v sentry_pgdb:/var/lib/postgresql/data -v (pwd):/backup busybox tar cvf /backup/backup.tar /var/lib/postgresql/data | |
# create a sentry-postgres volum | |
docker volume create sentry-postgres | |
# restore to sentry-postgres volume | |
# NOTE: tarball will keep absolute path folder structure, so we don't need specify the target extract path | |
docker run --rm -v sentry-postgres:/var/lib/postgresql/data -v (pwd):/backup busybox tar xvf /backup/backup.tar |
This file contains 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
#!/usr/bin/python | |
bpf_text = """ | |
#include <linux/ptrace.h> | |
#include <linux/sched.h> /* For TASK_COMM_LEN */ | |
#include <linux/icmp.h> | |
#include <linux/netdevice.h> | |
struct probe_icmp_data_t | |
{ | |
u64 timestamp_ns; | |
u32 tgid; |
This file contains 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
[program:myapp] | |
autostart = true | |
autorestart = true | |
command = python /home/pi/myapp.py | |
environment=SECRET_ID="secret_id",SECRET_KEY="secret_key_avoiding_%_chars" | |
stdout_logfile = /home/pi/stdout.log | |
stderr_logfile = /home/pi/stderr.log | |
startretries = 3 | |
user = pi |
This file contains 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
def eventlet_patcher(): | |
# Ref: https://github.com/eventlet/eventlet/pull/467 | |
# Ref: https://github.com/eventlet/eventlet/issues/468 | |
from eventlet.wsgi import HttpProtocol | |
def new_get_environ(self): | |
env = self.server.get_environ() | |
env['REQUEST_METHOD'] = self.command | |
env['SCRIPT_NAME'] = '' |
This file contains 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
# For Python-EngineIO 2.0.2 | |
def engine_io_patcher(): | |
from engineio.payload import Payload as eio_Payload | |
from engineio.server import Server as eio_Server | |
original_handle_request = eio_Server.handle_request | |
def new_eioserv__ok(self, packets=None, headers=None, b64=False, jsonp_seq=None): | |
"""response generator.""" | |
if packets is not None: | |
if headers is None: |
NewerOlder