Skip to content

Instantly share code, notes, and snippets.


Serghei Iakovlev sergeyklay

Block or report user

Report or block sergeyklay

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
sergeyklay /
Created Apr 25, 2018 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


sergeyklay /
Created Jan 20, 2018 — forked from chrisroos/
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
sergeyklay /
Created Dec 21, 2017 — forked from lelandbatey/
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!


This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"


sergeyklay / nginx.conf
Created Dec 2, 2017 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
sergeyklay /
Last active Jun 20, 2019
phpenv/php-build stuff

phpenv tips

Setting up environment variables

Create $HOME/.php_build_configure_opts file with the following contents:

--enable-debug --with-gettext --disable-fpm
sergeyklay / CMakeLists.txt
Last active Mar 25, 2019
CMakeLists.txt for PHP-extension
View CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(extname C)
message("Begin cmaking of PHP extension ...")
# -std=gnu99
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -Wall -std=gnu99 -fvisibility=hidden")

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example

Here's how to test whether a parameter is unset, or empty ("Null") or set with a value:

|                    |       parameter      |     parameter   |    parameter    |
|                    |   Set and Not Null   |   Set But Null  |      Unset      |
| ${parameter:-word} | substitute parameter | substitute word | substitute word |
| ${parameter-word}  | substitute parameter | substitute null | substitute word |
| ${parameter:=word} | substitute parameter | assign word     | assign word     |
| ${parameter=word}  | substitute parameter | substitute null | assign word     |
sergeyklay /
Last active Aug 10, 2018
Install Nginx with Nchan
#!/usr/bin/env bash
# Works fine on Ubuntu 14.0.4 LTS
sergeyklay /
Last active Jan 26, 2016 — forked from richieforeman/
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
You can’t perform that action at this time.