Skip to content

Instantly share code, notes, and snippets.

View kapb14's full-sized avatar
😤

Aleksandr Karushin kapb14

😤
View GitHub Profile
@kapb14
kapb14 / nginx-bitrix.conf
Created April 26, 2017 09:53 — forked from dragolabs/nginx-bitrix.conf
nginx configuration for bitrix cms
server {
listen 80;
server_name bitrix.example.com;
client_max_body_size 200m;
root /var/www/bitrix;
index index.html index.php;
@kapb14
kapb14 / .multitailrc
Created April 26, 2017 11:29 — forked from shawing/.multitailrc
Multitail color-code each line based on it's http status code "family"
check_mail:0
# color-code each line based on it's http status code "family"
colorscheme:nginx
cs_re:green:^.* 20.? .*$
cs_re:cyan:^.* 30.? .*$
cs_re:yellow:^.* 40.? .*$
cs_re:red:^.* 50.? .*$
@kapb14
kapb14 / bx-change-dbhost.sh
Created April 28, 2017 16:40
Поменять адрес MySQL сервера в конфигах Битрикс. С поиском, проверками, бэкапами, откатом изменений (если что-то пошло не так)...
#!/bin/bash
if [[ -z $1 ]]; then
NEW_DB="127.0.0.1"
else
NEW_DB="$1"
fi
DIR=$(pwd)
@kapb14
kapb14 / simpleUploadServer.py
Created June 23, 2017 09:41
simple Upload WebServer in pure python2
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
simpleUploadServer.py
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@kapb14
kapb14 / cors-nginx.conf
Created June 27, 2017 11:51 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@kapb14
kapb14 / nginx.conf
Created June 27, 2017 16:16 — forked from phpdude/nginx.conf
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
@kapb14
kapb14 / python_json_pretty_print.sh
Last active June 29, 2017 12:13 — forked from phyous/install_simple_pretty_print.sh
An useful alias to enable simple pretty printing of json data with builtin python module.
# Add alias to bash shell
echo "alias json='python -mjson.tool'" >> ~/.bashrc
# Add alias for zsh shell
echo "alias json='python -mjson.tool'" >> ~/.zshrc
@kapb14
kapb14 / README.md
Last active July 12, 2017 12:31
My ZSH Theme — Clean Mod

My modified fork of clean.zsh-theme

  • simple and clean!
  • fast
  • works on default zsh settings

Setup

Just add to your ~/.zshrc following lines:

@kapb14
kapb14 / selenium.service
Created June 15, 2018 17:17
Selenium Standalone Server as a systemd Service
# /etc/systemd/system/selenium.service
[Unit]
Description=Selenium Standalone Server
Requires=xvfb.service
After=xvfb.service
[Service]
Type=simple
@kapb14
kapb14 / nginx-purge-cache
Created June 15, 2018 19:14
Purge nginx proxy_cache and restart it
#!/bin/bash
set -e
nginx -t
echo " remove all subdirectories of nginx proxy_cache_path"
for dir in $(nginx -T 2>&1 | grep proxy_cache_path | awk $'{print $2}'); do
rm -rf ${dir}/*
done
echo " restart nginx daemon"
service nginx restart