Skip to content

Instantly share code, notes, and snippets.

@pessom
pessom / repo-full-copy.sh
Last active August 8, 2017 15:07 — forked from AgiosAndreas/repo-full-copy.sh
Полный перенос git репозитория на другой сервер
# Клонируем исходный репозиторий без рабочего каталога (--bare)
git clone --bare https://github.com/exampleuser/old-repository.git
cd old-repository.git
# Делаем mirror-push(будут скопированы все ветки и тэги) в новый репозиторий
git push --mirror https://github.com/exampleuser/new-repository.git
cd ..
# Удаляем папку с репозиторием
@pessom
pessom / teamspeak.service
Created August 8, 2017 15:04
Crack teamspeak.service for systemd
[Unit]
Description=Teamspeak 3
After=network.service mysql.service
[Service]
Type=simple
User=root
Group=root
UMask=0027
Restart=always
[Unit]
Description=Activate service for JetBrains
After=network.target
[Service]
User=root
Group=root
Type=simple
ExecStart=/opt/IntelliJIDEALicenseServer_linux_amd64 -p 27015 -u staff
@pessom
pessom / flask.service
Last active September 1, 2017 11:33
Start backend application write to python and flask in systemd
[Unit]
Description=Backend flask
After=network.target
#Wants=ase.service
[Service]
User=www-data
Group=www-data
#UMask=0027
Type=simple
@pessom
pessom / xl2tpd.service
Created August 8, 2017 15:10
Start xl2tpd with systemd
[Unit]
Description=IPsec connect
After=network.target racoon.service
[Service]
Type=simple
ExecStart=/usr/sbin/xl2tpd -D -p /var/run/xl2tpd.pid -c /etc/xl2tpd/xl2tpd.conf
Restart=on-abort
PIDFile=/var/run/xl2tpd.pid
@pessom
pessom / haproxy.cfg
Created August 24, 2017 12:45 — forked from ryzy/haproxy.cfg
HAProxy conf with SSL termination and HTTP/2 support
global
#debug
chroot /var/lib/haproxy
user haproxy
group haproxy
pidfile /var/run/haproxy.pid
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
@pessom
pessom / haproxy.cfg
Created August 25, 2017 18:49 — forked from fumin/haproxy.cfg
Haproxy config file for SSL and basic authentication
# Haproxy config file for SSL and basic authentication
#
# Since ssl is needed, we need to use
# `make TARGET=linux26 USE_OPENSSL=1 ADDLIB=-lz` to install haproxy.
# Also, haproxy version must be haproxy-1.5-dev19 or above.
#
# An example curl command that queryies pic-collage.com/api/collages/feed is
# `curl -k -v -u 'collages:password' 'https://ec2-ip.compute-1.amazonaws.com/api/collages/feed'`
userlist collages_dyno
@pessom
pessom / curl.md
Created September 26, 2017 10:01 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

pessom@web:/etc/systemd/system$ cat send_top.service
#Ansible managed
[Unit]
Description=Run send_top scripts initialise timer
After=network.target
[Service]
User=root
Group=root
@pessom
pessom / gist:babaad22107a96cae9271cbc0bca983f
Created December 3, 2017 17:52 — forked from declaresub/gist:2cf0e6f4a08129e2a4e4
Python logging.config.dictConfig example
#! /usr/bin/python
from logging import getLogger
from logging.config import dictConfig
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters':