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 / 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 / setup_rbenv_per_user.sh
Last active January 24, 2020 14:34
Debian rbenv per-user install
#-------------------------------
# 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
@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 / essential_server_security.txt
Last active December 27, 2020 13:22
Essential web-server security
# ------------------------
# SSH:
# ------------------------
#http://wiki.centos.org/HowTos/Network/SecuringSSH
#https://www.linode.com/docs/security/securing-your-server/
sudo nano /etc/ssh/sshd_config
Port 20202
PermitRootLogin no
#PermitRootLogin without-password
@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