Skip to content

Instantly share code, notes, and snippets.

View dvershinin's full-sized avatar

Danila Vershinin dvershinin

View GitHub Profile
dvershinin /
Last active October 29, 2019 21:09
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 January 11, 2019 14:11
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 February 6, 2023 18:52
Basic web server sanity checks
echo 'We have updated the script. Please use "curl -L | bash" next time'
curl -L | bash
dvershinin /
Created May 21, 2018 23:46 — 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 March 16, 2018 21:28
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 January 16, 2021 23:07
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 August 24, 2022 08:50
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;