This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------- | |
# Debian 10 | |
# https://linux4one.com/how-to-install-ruby-on-debian-10/ | |
#------------------------------- | |
sudo apt update | |
sudo apt install git libreadline-dev zlib1g-dev libreadline-dev libncurses5-dev autoconf bison libssl-dev build-essential libyaml-dev libffi-dev libssl-dev libreadline-dev zlib1g-dev libgdbm-dev | |
cd | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @see https://postgrespro.ru/docs/postgrespro/11/binary-installation-on-linux.html | |
#------------------------------- | |
# Debian 8/9/10: | |
#------------------------------- | |
sudo apt-get install lsb-release | |
sudo sh -c 'echo "deb http://repo.postgrespro.ru/pgpro-11/debian $(lsb_release -cs) main" > /etc/apt/sources.list.d/postgrespro.list' | |
wget --quiet -O - http://repo.postgrespro.ru/pgpro-11/keys/GPG-KEY-POSTGRESPRO | sudo apt-key add - | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- all databases sizes | |
SELECT table_schema AS "Database", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; | |
-- sizes of all of the tables in a specific database | |
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------ | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------- | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boot - How can I reinstall GRUB to the EFI partition? - Ask Ubuntu | |
# https://askubuntu.com/a/831241/19938 | |
# Note : sdX = disk | sdXX = efi partition | sdXXX = system partition | |
sudo mount /dev/sdXXX /mnt | |
sudo mount /dev/sdXX /mnt/boot/efi | |
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done | |
sudo chroot /mnt | |
grub-install /dev/sdX | |
update-grub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\z | |
-- Full access | |
GRANT ALL privileges ON DATABASE db TO admin_user; | |
GRANT ALL ON schema public TO admin_user; | |
GRANT ALL ON ALL TABLES IN SCHEMA public TO admin_user; | |
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO admin_user; | |
-- Read-only access | |
CREATE ROLE readonly; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- List of schemas | |
\dn | |
-- list all tables | |
\dt | |
-- list only tables with "public" schema | |
\dt public.* | |
-- database size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BTW yum has last Redis too, remi repository at least. | |
$ sudo -i | |
$ yum list redis | |
$ redis.x86_64 2.6.13-1.el6.remi remi | |
But today we want compile redis from source (see http://redis.io/download) | |
$ yum install make gcc tcl | |
$ cd /usr/local/src |