Skip to content

Instantly share code, notes, and snippets.


Danila Vershinin dvershinin

View GitHub Profile
dvershinin /
Last active Oct 29, 2019
Check for disappearing cache
# Run e.g.
# Or time ./
if [ $# -eq 0 ]
echo "Error: Please specify request URL as argument."
exit 1
dvershinin /
Last active Jan 11, 2019
Best practices setup for SSH client in OS X
# generates SSH key, if none
# TODO: suggests "good" key comment
# converts to encrypted key, in case existing key is not an encrypted one
# TODO: ensures that ~/.ssh/config defines that keys are added to agent upon (successfull) connection, and keychain is used for storing key password
# optionally, "fixes" Filezilla by auto-loading keys to SSH agent (otherwise only option is to run "ssh-add" manually or connecting to server in SSH first)
if [ ! -f ~/.ssh/config ]; then
cat << EOF > ~/.ssh/config
dvershinin /
Last active May 31, 2020
Basic web server sanity checks
# TODO: chkconfig cpuspeed off
# CSF: SYNFLOOD = "0" # value of "1" will slow down all new connections from any IP address to
# the server if triggered
# integrate SSD existence test
# STATUS: do not update here, moved to internal
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root or via sudo" 1>&2
dvershinin /
Created May 21, 2018 — forked from abn/
RPM build and hosting workflow using github, travis-ci and copr

RPM Build Flow

This document details a simple RPM build flow pattern used to build and host RPM artifacts for open source projects. The below is a visual summary of this flow.

In order to achieve this multiple tools and services are used. The services and their purpose in the flow is as listed below.

Service Purpose
GitHub As is the most common use for GitHub, it holds the build source code. In this case we hold only the spec files and related source files. All other sources, including project binaries/sources are retrieved at build time.
dvershinin / config.xml
Last active Mar 16, 2018
Magento 1 Best Redis Config
View config.xml
<redis_session> <!-- All options seen here are the defaults -->
<host>/var/run/redis/redis.sock</host> <!-- Specify an absolute path if using a unix socket -->
<password></password> <!-- Specify if your Redis server requires authentication -->
<timeout>2.5</timeout> <!-- This is the Redis connection timeout, not the locking timeout -->
<persistent></persistent> <!-- Specify unique string to enable persistent connections. E.g.: sess-db0; bugs with phpredis and php-fpm are known: -->
<db>1</db> <!-- Redis database number; protection from accidental loss is improved by using a unique DB number for sessions -->
<compression_threshold>2048</compression_threshold> <!-- Known bug with strings over 64k:
dvershinin / cache.xml
Last active Jan 16, 2021
Magento Redis Configuration
View cache.xml
<?xml version="1.0"?>
<server>/var/run/redis/redis.sock</server> <!-- or absolute path to unix socket -->
<persistent></persistent> <!-- Specify a unique string like "cache-db0" to enable persistent connections. -->
dvershinin / magento.vcl
Last active Oct 8, 2021
Magento 2 VCL file for Varnish 4.x: supports multiple stores better, allows purging arbitrary URLs
View magento.vcl
vcl 4.0;
import std;
# The minimal Varnish version is 4.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'
backend default {
.host = "localhost";
.port = "8080";
.first_byte_timeout = 600s;