Skip to content

Instantly share code, notes, and snippets.

Making magic happen

Yaroslav Zhmayev salaros

Making magic happen
Block or report user

Report or block salaros

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
salaros /
Created May 30, 2019
Compress and combine raster PDF without making them blurry
gs -sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dAutoRotatePages=/None \
-dColorImageDownsampleType=/Bicubic -dColorImageResolution=150 \
-dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=150 \
-dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=150 \
-sOutputFile=output.pdf input1.pdf input2.pdf
View nginx.service
cd /usr/src
## Download DAV Ext NGINX module
## !! Remove this if you don't need dav ext module or replace with modules _you_ need
tar xzvf v3.0.0.tar.gz
apt-get install -qy tar wget dpkg-dev \
libssl-dev libgd-dev libgeoip-dev libhiredis-dev libluajit-5.1-dev \
libmhash-dev libpam0g-dev libperl-dev libxslt1-dev
salaros / libpng12-0
Created Feb 11, 2019
libpng 12.0 i386 and amd64
View libpng12-0
sudo ln -sfv /lib/i386-linux-gnu/ /lib/i386-linux-gnu/
sudo ln -sfv /lib/x86_64-linux-gnu/ /lib/x86_64-linux-gnu/
salaros /
Last active Nov 30, 2018
IServiceProvider in ASP.NET Core dependency injection explained

Either approach can be used to get access to the service. Additional service extensions for Startup.cs


AddInstance<IService>(new Service())

A single instance is given all the time. You are responsible for initial object creation.

salaros /
Last active Feb 12, 2019
Set wallpaper on Ubuntu as well as lock and login screens
#!/usr/bin/env bash
WALLPAPER=${1/ /%20}
gsettings set org.gnome.desktop.background picture-uri ${WALLPAPER_URL}
salaros / country-code-to-currency-code-mapping.csv
Created Nov 9, 2018 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from Contains 249 countries.
View country-code-to-currency-code-mapping.csv
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
salaros / etc__wsl.conf
Last active Jan 8, 2019
Make Docker work on Ubuntu WSL (Windows Subsystem for Linux)
View etc__wsl.conf
root = /
options = "metadata"
salaros / acf-backend-form.php
Last active Nov 3, 2018
WordPress - ACF custom forms
View acf-backend-form.php
require_once 'acf.php';
add_action('admin_head', function () {
add_action('admin_enqueue_scripts', function () {
View create_hyperv_boot_option.bat
;; Copy current boot option and call it "No Hyper-V"
bcdedit /copy {current} /d "No Hyper-V"
;; Copy guid from the command above
bcdedit /set {ff-23-113-824e-5c5144ea} hypervisorlaunchtype off
salaros /
Last active Jul 6, 2019
My tweaks for Ubuntu + Dell Inspiron 5567
#!/usr/bin/env bash
# Require root to run
if [ "$EUID" -ne 0 ]; then
echo "Please run as root"
exit 0
# [PlayOnLinux] - disables protection against the usage of Ptrace
You can’t perform that action at this time.