Skip to content

Instantly share code, notes, and snippets.

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

Maksim Tarasenko webmaks

🏠
Working from home
View GitHub Profile
@webmaks
webmaks / centos.sh
Last active January 2, 2016 20:58
Zabbix
#!/bin/bash
# centos.sh
$HOSTNAME=`hostname`
$SERVER='mon.sys-tools.net'
# Add required repository
sudo rpm --import http://repo.zabbixzone.com/centos/RPM-GPG-KEY-zabbixzone
sudo rpm -Uvh http://repo.zabbixzone.com/centos/zabbixzone-release-0.0-1.noarch.rpm
# Install last avaliable version of zabbix-agent
@webmaks
webmaks / .screenrc
Created October 5, 2014 18:39
Nice one more .screenrc
# look and feel
caption always "%{= bb}%{+b w}%h %=%{=b rw} %l %{= db} ${USER}@%H %{= dg}%c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
# skip the startup message
startup_message off
# go to home dir
chdir
@webmaks
webmaks / main.cf
Created October 5, 2014 23:57
postfix config file
myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
^\+?\d(\s|\d)(\s|\d|\()(\s|\-|\d)\d(\s|\d)(\)|\s|\d|\-)(\s|\d)\d(\s|\d)?(\s|\d)?(\-|\d)?(\s|\d)?(\s|\d)?(\-|\d)?\d?\d?$
upstream backend {
server localhost:8222;
}
server {
listen 80;
listen 443;
server_name subdomain.example.com;
return 301 $scheme://example.com$request_uri;
#!/bin/bash
# mys.bash
# Usage ./mys.bash some.deb
if [[ -z "$1" ]]; then
echo -e "\n\tUsage:\n\t ./mys.bash some.deb\n"
exit 1
fi
DEB=$1
@webmaks
webmaks / locale fix
Created December 27, 2016 04:32
Solution You can fix the issue by setting the locale to en_US.UTF-8 for example:
Solution
You can fix the issue by setting the locale to en_US.UTF-8 for example:
$ export LANGUAGE=en_US.UTF-8
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
$ locale-gen en_US.UTF-8
$ dpkg-reconfigure locales
@webmaks
webmaks / Nginx Proxy
Created April 25, 2017 16:50
Easy setup nginx proxy to another server
server {
listen 80;
server_name domain.io www.domain.io;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
@webmaks
webmaks / published.sh
Created June 2, 2017 17:42
Mercurrial
#!/bin/sh
# publisher.sh
# The script send email notification in case someone
# published changes in /project/html repository
export PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/dell/srvadmin/bin:/home/user/bin
REPO="/project/html"
TMPD="/project/tmp"
LASTFNAME="last_revision.txt"
@webmaks
webmaks / backup.bash
Created March 14, 2020 09:51
Creating backup of website and mysql and copy to AWS S3
#!/bin/bash
# backup.bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
TODAY="$(date +%Y)/$(date +%m)"
DAY=$(date +%d-%m-%Y)
TIME=$(date +%F_%H:%M:%S)
ALL="/home/BACKUPS"
SITES="${ALL}/sites/${TODAY}"