Skip to content

Instantly share code, notes, and snippets.

🤠

Danila Vershinin dvershinin

🤠
Block or report user

Report or block dvershinin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dvershinin
dvershinin / check-cache.sh
Last active Oct 29, 2019
Check for disappearing cache
View check-cache.sh
#!/bin/bash
# Run e.g. check-cache.sh https://www.manzara.si/jakne
# Or time ./check-cache.sh https://www.manzara.si/jakne
if [ $# -eq 0 ]
then
echo "Error: Please specify request URL as argument."
exit 1
fi
@dvershinin
dvershinin / osx-ssh-kickstart.sh
Last active Jan 11, 2019
Best practices setup for SSH client in OS X
View osx-ssh-kickstart.sh
#!/bin/bash
# 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
dvershinin / servcheck.sh
Last active Dec 5, 2019
Basic web server sanity checks
View servcheck.sh
#!/bin/bash
# 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
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root or via sudo" 1>&2
exit 1
@dvershinin
dvershinin / rpm-build-workflow.md
Created May 21, 2018 — forked from abn/rpm-build-workflow.md
RPM build and hosting workflow using github, travis-ci and copr
View rpm-build-workflow.md

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
dvershinin / config.xml
Last active Mar 16, 2018
Magento 1 Best Redis Config
View config.xml
<session_save>db</session_save>
<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 -->
<port>6379</port>
<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: https://github.com/nicolasff/phpredis/issues/70 -->
<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: https://github.com/colinmollenhou
@dvershinin
dvershinin / cache.xml
Last active Aug 11, 2018
Magento Redis Configuration
View cache.xml
<?xml version="1.0"?>
<config>
<global>
<cache>
<backend>Mage_Cache_Backend_Redis</backend>
<backend_options>
<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. -->
<database>2</database>
<password></password>
@dvershinin
dvershinin / magento.vcl
Last active Apr 20, 2020
Magento 2 VCL file for Varnish: 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";
}
You can’t perform that action at this time.