Skip to content

Instantly share code, notes, and snippets.

View marten-cz's full-sized avatar

Martin Malek marten-cz

View GitHub Profile
@marten-cz
marten-cz / docker-compose.application.example.yml
Created May 29, 2018 08:29
Docker infrastructure - Traefik
version: '3.2'
services:
python:
image: python:3.6.5-alpine3.7
expose:
- 80
networks:
- internal
- traefik
labels:
@marten-cz
marten-cz / gruntfile.example.js
Created February 22, 2018 11:31
Gruntfile example
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['node_modules/renderjson/renderjson.js'],
@marten-cz
marten-cz / jail.local
Created January 22, 2018 16:06 — forked from Nihisil/jail.local
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
@marten-cz
marten-cz / Dockerfile
Created December 15, 2017 10:39
OpenCV with Python
FROM python:3.6.2-jessie
LABEL maintainer "[email protected]"
# 3.6
ENV PYTHON_VERSION 3
# Install all dependencies for OpenCV 3.2
RUN apt-get -y update && apt-get -y install python$PYTHON_VERSION-dev wget unzip \
build-essential cmake git pkg-config libatlas-base-dev gfortran \
libjasper-dev libgtk2.0-dev libavcodec-dev libavformat-dev \
@marten-cz
marten-cz / python-snippets.md
Created June 12, 2017 23:16
Python snippets

Pythons snippets

PyPi

Upload package

Create ~/.pypirc configuration file

@marten-cz
marten-cz / docker-run-user.sh
Created April 8, 2017 15:57
Run docker with current user
# Run command with the same user ID as current user
# -v $(pwd):/tmp/mount - mount current directory to /tmp/mount/
# --env HOME="/tmp/" - some commands may need to be able to write to your home, se it to temporary folder
docker run -ti --rm -v $(pwd):/tmp/mount —user=$(id -u) --env HOME="/tmp/" debian:jessie
# Mount current users and group and be able to use them
# mount /etc/group and /etc/passwd read only
# set user from $USER
docker run -ti --rm -v $(pwd):/tmp/mount -w /tmp/hx -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro —user=$USER debian:jessie
@marten-cz
marten-cz / trigger_log.sql
Created May 29, 2015 16:17
Trigger MySQL row changes
DELIMITER ;;
CREATE TRIGGER `patient_bu` BEFORE UPDATE ON `patient` FOR EACH ROW
BEGIN
SET @json = "{";
SET @jsonold = "{";
SET @first = true;
IF (OLD.register_doctor_id!=NEW.register_doctor_id) THEN
SET @first = false;
SET @json = CONCAT(@json, "\"register_doctor_id\"", ":", "\"", REPLACE(NEW.register_doctor_id, '"', '\"'), "\"");
@marten-cz
marten-cz / ossec-kibana-dashboard1
Created January 3, 2015 18:36
Kibana dashboard for OSSEC instalation
{
"title": "OSSEC MONITORING DASHBOARD",
"services": {
"query": {
"idQueue": [
0,
1
],
"list": {
"10": {

Install Fluentd

Debian

There is no Debian repository for fluentd, only for Ubuntu. We will install the package from git using ruby.

apt-get install git ruby ruby-dev make
gem install bundler
git clone https://github.com/fluent/fluentd.git

cd fluentd/

@marten-cz
marten-cz / install_sentry.md
Created August 3, 2014 15:13
Installing Sentry

To install sentry from git, we can still use pip. Before installing, we will need some libraries

apt-get install libxml2-dev libxslt-dev

After that, we can install sentry from git

pip install --allow-unverified sentry sentry==dev