Skip to content

Instantly share code, notes, and snippets.

View coder4web's full-sized avatar

Aleksey Deryagin coder4web

View GitHub Profile
@coder4web
coder4web / freebsd_software.sh
Last active October 21, 2015 17:50
FreeBSD ports and packages management
# FreeBSD ports (portmaster) and packages (pkgng) management
# ports
portsnap fetch extract
# portmaster
# You must upgrade the ports-mgmt/pkg port first.
make -C /usr/ports/ports-mgmt/pkg build deinstall install clean
pkg -v
# If you are upgrading from the old package format, first run:
@coder4web
coder4web / debian_locales.sh
Last active November 27, 2015 09:51
Locales in Debian
# @see https://people.debian.org/~schultmc/locales.html
# @see http://badyblog.com/ustanovka-utf-8-rusifikaciya-konsoli-v-debian/
# perl: warning: Please check that your locale settings:
# locale: Cannot set LC_ALL to default locale: No such file or directory
locale
sudo dpkg-reconfigure locales
#138. en_US.UTF-8 UTF-8
#349. ru_RU.UTF-8 UTF-8
@coder4web
coder4web / freebsd_bash.txt
Last active November 27, 2015 09:53
Setting bash as default shell in FreeBSD
1) Install binary package
# pkg search bash
bash-4.3.42
# pkg install bash
# which bash
/usr/local/bin/bash
@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
# ------------------------
# 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 / 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 / redis_install_centos.txt
Last active September 10, 2017 01:45
Redis install on CentOS 6.4
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
@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 / 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 / postgresql_roles.sql
Last active July 17, 2018 13:24
PostgreSQL roles
\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;