Skip to content

Instantly share code, notes, and snippets.

View rocknr011's full-sized avatar

Vladimir Podlednev rocknr011

View GitHub Profile
@rocknr011
rocknr011 / emacs-essential-keybindings.md
Created October 26, 2023 02:10 — forked from ulysses4ever/emacs-essential-keybindings.md
Emacs: основные сочетания клавиш

Обозначения:

  • C — клавиша Control, обычно настроена на Ctrl.
  • M — клавиша Meta, обычно настроена на Alt.

Emacs: Общее

  • M-x ввести команду
  • C-x C-c закрыть Emacs
  • C-g прекратить текущую операцию
@rocknr011
rocknr011 / cisco-anyconnect-profile.md
Created September 20, 2023 01:00 — forked from JosefJezek/cisco-anyconnect-profile.md
Cisco AnyConnect VPN Profile

Cisco AnyConnect VPN Profile

Router IOS

webvpn import svc profile profile-example usbflash0:example.xml
webvpn context ctx-example
policy group vpn-group-example
svc profile profile-example
@rocknr011
rocknr011 / mysql-docker.sh
Last active October 28, 2020 12:09 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# or
docker exec CONTAINER sh -c 'exec mysqldump --all-databases -uroot -p\$MYSQL_ROOT_PASSWORD' > alldatabase.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
# or
@rocknr011
rocknr011 / gist:5cbf0fd33ab6a21ec4443a70fe5c983f
Created February 19, 2020 05:48
remove ANSI escape sequences
sed 's/\x1b\[[0-9;]*m//g'
@rocknr011
rocknr011 / sed.sh
Last active October 21, 2019 11:34
sed: useful commands
#!/bin/sh
# To remove comment and blank lines use:
sed '/^\s*[;#].*$/d;/^$/d' file-name
#!/bin/bash
#iconv.sh
FROM_CP=${1:-"cp1251"}
TO_CP=${2:-"utf-8"}
while read line
do
echo "$line" | iconv -f $FROM_CP -t $TO_CP
done < "${1:-/dev/stdin}"
@rocknr011
rocknr011 / _geoblock_nginx.conf
Last active November 23, 2021 15:31
nginx geoip blocking with network exceptions (inspired by https://gist.github.com/mortn/9407041)
# /etc/nginx/nginx.conf
http {
...
geoip_country /etc/nginx/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
default no;
US yes;