Skip to content

Instantly share code, notes, and snippets.

sshymko /
Last active Sep 7, 2022
Install latest ImageMagick 7.x and imagick PHP extension from PECL on Amazon Linux 2
# Uninstall ImageMagic library and imagick PHP extension using it (installed previously)
yum remove -y php-pecl-imagick ImageMagick
# Install libraries for JPG, PNG, GIF, WebP, and TIFF image formats
yum install -y libpng-devel libjpeg-devel openjpeg2-devel libtiff-devel libwebp-devel giflib-devel
# Install latest ImageMagick library compiled from downloaded sources
yum install -y gcc
sshymko /
Last active Aug 29, 2022
Install MySQL 5.7 client on Amazon Linux 2
sudo yum install -y
sudo yum install -y mysql-community-client
sshymko / aws_codepipeline_lambda_invalidate_cloudfront.js
Last active Jul 12, 2022
Invalidate CloudFront distribution from CodePipeline via Lambda function
View aws_codepipeline_lambda_invalidate_cloudfront.js
const aws = require('aws-sdk');
const codepipeline = new aws.CodePipeline();
const cloudfront = new aws.CloudFront();
exports.handler = async (event, context) => {
let job = event['CodePipeline.job'];
let config =;
try {
let params = JSON.parse(config);
if (!params || !params.distributionId) {
sshymko /
Last active Jun 21, 2022
Install Nginx and PHP-FPM on Amazon Linux 2 from REMI repository
sudo yum update -y
sudo yum install -y
sudo yum install -y
sudo yum-config-manager --setopt="remi-php72.priority=5" --enable remi-php72
sudo yum install -y nginx
sudo systemctl enable nginx
sshymko / Dockerfile
Created Aug 17, 2019
Docker image of PHP 7.4 with Foreign Function Interface (FFI) support
View Dockerfile
FROM phpdaily/php:7.4.0-dev
RUN apk add --no-cache --virtual .persistent-deps libffi-dev \
&& docker-php-ext-configure ffi --with-ffi \
&& docker-php-ext-install ffi
sshymko / .zshrc
Last active Jan 4, 2022
Zsh configuration of cursor navigation and colors
View .zshrc
autoload -U select-word-style
select-word-style bash
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export PROMPT='%F{cyan}%n%f@%F{green}%m:%f%B%F{yellow}%0~%f%b%(!.#.$) '
sshymko / DefaultKeyBinding.dict
Last active Dec 1, 2021
macOS key mapping for PC keyboard navigation
View DefaultKeyBinding.dict
// Home/End Keys
"\UF729" = "moveToBeginningOfLine:"; // Home
"\UF72B" = "moveToEndOfLine:"; // End
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; // Shift + Home
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; // Shift + End
sshymko / sysctl.conf
Created Dec 1, 2021
macOS TCP connection keep alive
View sysctl.conf
sshymko / redis.service
Last active Oct 15, 2021
Redis service for systemd on Linux
View redis.service
Description=Redis persistent key-value storage
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd --daemonize no
ExecStop=/usr/bin/redis-cli -p 6379 shutdown
ExecReload=/bin/kill -USR2 $MAINPID
sshymko /
Last active Oct 27, 2020
Google Chrome auto-update block for Mac OS
sudo tee -a /etc/hosts << EOF
# Block Google Chrome auto-update