Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
.flex {
display: flex
}
.flex > .full-height {
flex: 1 1 auto
}
# TODO use a dedicated backup user, protect gzip file with password etc
echo "/var/backups/all-databases.sql.gz {
daily
rotate 8
nocompress
create 640 root adm
postrotate
mysqldump -uroot --all-databases > /var/backups/all-databases.sql --single-transaction
gzip -9f /var/backups/all-databases.sql.sql
endscript
#!/bin/bash
PROGNAME=${0##*/}
INPUT=''
QUIET='0'
NOSTATS='0'
max_input_size=0
max_output_size=0
usage()
https://sir-sherwin.blogspot.com.by/2012/04/how-to-access-router.html
@salaros
salaros / Makefile
Last active November 13, 2017 00:27
Add Sphinx -> HTML document generation to a PHP project
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build
ROOT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
@salaros
salaros / README-Template.md
Created November 20, 2017 00:07 — forked from PurpleBooth/README-Template.md
A template to make good README.md

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.

Prerequisites

@salaros
salaros / remove-cache-folders.sh
Last active January 1, 2018 20:18
Remove cache folders in a given path
find /home/salaros -regextype posix-egrep -iregex "(packages-|shaders_|Shader|repository-|_ca|GPU|v3-|.)+?cache" -type d -exec rm -rfv "{}" \;
@salaros
salaros / split_combine_pdf.sh
Created January 2, 2018 23:54
Splits PDF into images (one image per page), then re-combines pages into new PDF
## sudo apt install -qy ghostscript imagemagick
mkdir -pv pages
## gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -r96 -sOutputFile='pages/page-%02d.jpg' 'input.pdf'
gs -dNOPAUSE -dBATCH -sDEVICE=pngalpha -r96 -sOutputFile='pages/page-%02d.png' 'input.pdf'
## convert -adjoin pages/*.png 'output.pdf'
convert -adjoin pages/*.png 'output.pdf'
@salaros
salaros / 01-touchpad.rules
Last active January 23, 2018 18:02
Disable touchpad via udev when mouse is plugged
# Disable touchpad when mouse is plugged
# file: /etc/udev/rules.d/01-touchpad.rules
ACTION=="add", ENV{ID_CLASS}="mouse",ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/salaros/.Xauthority", RUN+="/bin/sh -c 'xinput disable DELL0767:00\ 06CB:7E92\ Touchpad'"
ACTION=="remove", ENV{ID_CLASS}="mouse", ENV{DISPLAY}=":0.0", ENV{XAUTHORITY}="/home/salaros/.Xauthority", RUN+="/bin/sh -c 'xinput enable DELL0767:00\ 06CB:7E92\ Touchpad'"
@salaros
salaros / etc_default_locale
Created January 24, 2018 05:36
Etc configs
#
LANG=en_US.UTF-8
LC_NUMERIC="be_BY.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_MONETARY="be_BY.UTF-8"
LC_PAPER="be_BY.UTF-8"
LC_NAME="be_BY.UTF-8"
LC_ADDRESS="be_BY.UTF-8"
LC_TELEPHONE="be_BY.UTF-8"
LC_MEASUREMENT="be_BY.UTF-8"