Skip to content

Instantly share code, notes, and snippets.

View glavk's full-sized avatar
🏠
Working from home

Eugene Selivanov glavk

🏠
Working from home
  • Flowwow
  • 08:40 (UTC +06:00)
View GitHub Profile
@glavk
glavk / curl.md
Created October 10, 2020 18:07 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@glavk
glavk / tmux.md
Created October 30, 2020 15:36 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@glavk
glavk / VSCodeShortcats.md
Last active October 30, 2020 16:13
VS Code shortcuts

Move Code Up/Down
Alt+Down/Up Arrow keys - the line of code selected moves down/up.

Create Collapsible Region
The key sequence Ctrl+M+H turn the region into a collapsible/expandable region.
The key sequence Ctrl+M+U remove the collapsible region.

Comment Code Block
Ctrl+K+C/Ctrl+K+U comment out the selected code block.
Ctrl+K+U uncomment the code block. \

@glavk
glavk / make_deb.md
Last active December 3, 2020 20:49
Build deb packets for nginx from src

Install custom nginx from sources

sudo apt-get install dpkg-dev
mkdir nginx && cd nginx
sudo apt-get source nginx

make some editing, e.g. ./configure ...
change version number and comments to changelog via running:

dch -n
@glavk
glavk / README.md
Created December 19, 2020 15:56 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@glavk
glavk / imagick-webp-centos.sh
Created December 20, 2020 16:24
Rebuild ImageMagick with WebP (CentOS 7)
#!/bin/sh
# update package name from http://vault.centos.org/centos/7/updates/Source/SPackages/
PKG="ImageMagick-XXX.el7.src.rpm"
# install dev packages
yum -y install rpm-build perl-devel lcms2-devel openjpeg2-devel bzip2-devel libtiff-devel giflib-devel ghostscript-devel libwmf-devel jasper-devel libtool-ltdl-devel libXext-devel libXt-devel librsvg2-devel OpenEXR-devel libwebp-devel
yum -y group install "Development Tools"
# get ImageMagick src packet
rpm -ivh http://vault.centos.org/centos/7/updates/Source/SPackages/${PKG}
@glavk
glavk / git.md
Last active January 30, 2021 19:00
Git: show saved credentials

Show cached credentials:

echo -ne 'username=git\nprotocol=https\nhost=github.com\n' | git credential-cache get

Also look at: .git/config file

log_format postdata '$time_local $request $request_body';
location = /path {
access_log /var/log/nginx/postdata.log postdata;
proxy_pass http://localhost:8080; # <= set your port
}
@glavk
glavk / config.inc.php.md
Last active January 30, 2021 19:00
PHPMyAdmin multiple servers
$i++;
$cfg['Servers'][$i]['verbose'] = 'Database Server 2';
$cfg['Servers'][$i]['host'] = '192.168.1.102';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['AllowNoPassword'] = false;