Skip to content

Instantly share code, notes, and snippets.

View adzhurinskij's full-sized avatar

Alexandr Dzhurinskij adzhurinskij

View GitHub Profile
@adzhurinskij
adzhurinskij / rc.conf
Created October 10, 2016 09:30
IPFW example
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_logging="YES"
@adzhurinskij
adzhurinskij / sshrc
Last active December 7, 2023 05:01
/etc/ssh/sshrc example
#!/bin/bash
ip=`echo $SSH_CONNECTION | cut -d " " -f 1`
hostname=`hostname`
fqdn=`hostname -f`
logger -t ssh-wrapper $USER login from $ip
sendmail -t <<EOF
To: Alex <adzhurinskij@gmail.com>
@adzhurinskij
adzhurinskij / Documentation.md
Last active December 16, 2023 07:26
The fastest sync directory over ssh with tar

The fastest sync directory over ssh with tar

It's simple command for transfer a large number of small files over ssh.

You need to first go to directory, if you want to copy content of directory.

cd /var/www
tar cpf - ./ | ssh <user>@<dest_ip> "tar xpf - -C /var/www"

Preview speed copy with pv:

@adzhurinskij
adzhurinskij / sendmail.sh
Last active April 19, 2016 12:11
Swaks for Zabbix (use SMTP and TLS)
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOST=smtp.yandex.ru
USERNAME=username@yandex.ru
PASSWORD=password
PORT=465
TO=$1
SUBJECT=$2