Skip to content

Instantly share code, notes, and snippets.

View coder4web's full-sized avatar

Aleksey Deryagin coder4web

View GitHub Profile
@coder4web
coder4web / zabbix_setup.sh
Last active March 23, 2019 17:04
Zabbix setup (CentOS. RHEL)
# ------------------------
# agent
# ------------------------
sudo rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
sudo yum list zabbix-agent
sudo yum install zabbix-agent
sudo firewall-cmd --zone=public --add-port=10050/tcp
sudo firewall-cmd --zone=public --add-port=10050/tcp --permanent
sudo semanage permissive -a zabbix_agent_t
sudo systemctl enable zabbix-agent.service
@coder4web
coder4web / vertica_monit.sql
Last active April 3, 2018 14:43
Vertica management and monitoring
-- List of schemas
\dn
-- list all tables
\dt
-- list only tables with "public" schema
\dt public.*
-- database size
@coder4web
coder4web / centos_kernel_upgrade.sh
Last active March 10, 2020 08:22
How to Install or Upgrade to Kernel 5.x in CentOS 7
# @see https://www.tecmint.com/install-upgrade-kernel-version-in-centos-7/
uname -sr
# Linux 3.10.0-1062.12.1.el7.x86_64
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
yum --enablerepo=elrepo-kernel install kernel-ml
@coder4web
coder4web / postgresql_monit.sql
Last active September 8, 2021 14:56
PostgreSQL 11/12 monitoring
-- logs
SET log_statement = 'all';
-- list database(s)
\l+ [database]
-- list schema(s)
\dn
-- list tables in all schemas
# ------------------------
# debian
# ------------------------
apt-cache policy proftpd-basic
apt-get install proftpd
proftpd --version
proftpd -vv
nano /etc/proftpd/proftpd.conf
Include /etc/proftpd/conf.d/
@coder4web
coder4web / aws_mercurial_install.sh
Last active February 27, 2018 10:05
How To Install Mercurial SCM on Amazon AMI
# https://www.mercurial-scm.org/
# https://www.mercurial-scm.org/wiki/UnixInstall#System-wide_installation
# rooted version :)
sudo -i
yum list mercurial
#Loaded plugins: priorities, update-motd, upgrade-helper
#Error: No matching Packages to list
yum groupinstall "Development Tools"
@coder4web
coder4web / lets_encrypt_nginx.sh
Last active February 27, 2016 13:31
How To Secure Nginx with Let's Encrypt
# ------------------------
# CentOS
# @see https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-7
# ------------------------
sudo yum install git bc
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
sudo systemctl stop nginx
netstat -na | grep ':80.*LISTEN'
firewall-cmd --add-port=443/tcp
cd /opt/letsencrypt
@coder4web
coder4web / php7_memcached_src.sh
Last active December 18, 2018 09:31
PHP 7 with Memcached from source
# -------------------------------------------------------
# STEP 1: install requirements
# -------------------------------------------------------
# CentOS / RHEL / Amazon EC2 AMI:
# @see https://webtatic.com/packages/php70/
sudo yum install php70w php70w-devel
sudo yum groupinstall "Development Tools"
sudo yum install libmemcached libmemcached-devel zlib zlib-devel
# -------------------------------------------------------
# Debian
@coder4web
coder4web / sphinxsearch_src.sh
Created December 16, 2015 08:28
Sphinx (sphinxsearch) install from source
# @see http://sphinxsearch.com/downloads/release/
# redhats: yum remove sphinx
# debians: apt-get remove sphinxsearch
cd /usr/local/src
wget -c http://sphinxsearch.com/files/sphinx-2.2.10-release.tar.gz
tar xzvf sphinx-2.2.10-release.tar.gz
cd sphinx-2.2.10-release
./configure
make install
@coder4web
coder4web / filesystem_monitoring.sh
Last active March 7, 2020 14:01
Linux filesystem monitoring
# df - report file system disk space usage
df -h
df -i
df -hl
df -hl | sort -n
# du - disk used - estimate file space usage
alias du1='du . -hs'
alias du10='du . -k | sort -n -r | head -n 10'