Skip to content

Instantly share code, notes, and snippets.

View dzhurinskij's full-sized avatar

Alexandr Dzhurinskij dzhurinskij

View GitHub Profile
@dzhurinskij
dzhurinskij / rc.conf
Created October 10, 2016 09:30
IPFW example
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_logging="YES"
@dzhurinskij
dzhurinskij / sshrc
Last active September 13, 2025 04:34
/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 <[email protected]>
@dzhurinskij
dzhurinskij / 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:

@dzhurinskij
dzhurinskij / 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
[email protected]
PASSWORD=password
PORT=465
TO=$1
SUBJECT=$2