Skip to content

Instantly share code, notes, and snippets.

Ruslan Zaporojets Ruzzz

Block or report user

Report or block Ruzzz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Ruzzz
Ruzzz / postgres_11_hints.md
Last active Feb 24, 2020
postgres 11 hints
View postgres_11_hints.md

Pre-installation cleanup

dpkg -l | grep postgres
sudo apt-get purge postgresql*  # or
sudo apt-get --purge remove postgresql\*

sudo rm -rf /var/lib/postgresql/
sudo rm -rf /var/log/postgresql/
sudo rm -rf /etc/postgresql/
@Ruzzz
Ruzzz / make_python.sh
Created Dec 17, 2019
Make python from source and install
View make_python.sh
# prerequsitis
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
# download, see https://www.python.org/ftp/python/
cd /opt
sudo wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
sudo tar xzf Python-3.8.0.tgz
cd Python-3.8.0
View longest_streak_of_posts.sql
SELECT
uid,
max(date_sequence_count) as max_date_sequence_count
FROM (
SELECT
uid,
COUNT(date_sequence_id) + 1 AS date_sequence_count
FROM (
-- same rank for sequence
SELECT
View VC++ Versions.md
IDE Date IDE MSVC++ cl.exe _MSC_VER .NET
VS 97 1997-02 5.0 5.0 1100
VS 6.0 1998-06 6.0 6.0 12.00 1200
VS .NET 2002 2002-02-13 7.0 7.0 13.00 1300 1.0
VS .NET 2003 2003-04-24 7.1 7.1 13.10 1310 1.1
VS 2005 2005-11-07 8.0 8.0 14.00 1400 2.0
VS 2008 2007-11-19 9.0 9.0 15.00 1500 2.0 – 3.5
VS 2010 2010-04-12 10.0 10.0 16.00 1600 2.0 – 4.0
VS 2012 2012-08-15 11.0 11.0 17.00 1700 2.0 – 4.5
View ssh_vps_access.sh
# On remote host do:
# ------------------
# Add user
sudo adduser <USER> sudo
# Or:
sudo adduser <USER>
sudo usermod -a -G sudo <USER>
# Change ssh configuration
View openvpn_tips.sh
sudo apt install openvpn
# Download and apply configuration file
sudo cp ~/Download/NNN.ovpn /etc/openvpn/work.conf
rm ~/Download/NNN.ovpn
# Optional
sudo nano /etc/openvpn/work.pass
# Add password of private certificate
sudo chmod 600 /etc/openvpn/work.pass
@Ruzzz
Ruzzz / python_build.sh
Last active Aug 1, 2018
Build Python on Ubuntu
View python_build.sh
sudo apt update
sudo apt upgrade
sudo apt install -y build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev libffi-dev tcl-dev tk-dev tk openssl
# TODO: The necessary bits to build these optional modules were not found: _uuid
wget https://github.com/python/cpython/archive/v3.7.0.zip
unzip v3.7.0.zip
cd cpython-3.7.0
mkdir build1
cd build1
@Ruzzz
Ruzzz / wsl_ssh.sh
Created Jul 16, 2018
Enable SSH on Windows Subsystem for Linux (WSL)
View wsl_ssh.sh
sudo apt-get update
sudo apt-get upgrade
sudo nano /etc/ssh/sshd_config
# PasswordAuthentication yes
# UsePrivilegeSeparation no
sudo service ssh start
View python_virtualenv.cmd
pip3 install virtualenv
# mkdir project & cd project
virtualenv venv
virtualenv venv -p python3
source venv/bin/activate # linux
venv\Scripts\activate # windows
pip install Flask
pip install Flask==0.9
pip install --upgrade Flask
pip freeze > requirements.txt
View backup_mysql_to_dropbox.sh
# DEPS:
# https://github.com/dropbox/dbxcli
# sudo apt-get install p7zip-full
DB_USER=
DB_PASS=
DB_NAME=
DB_TABLES=
ARC_PASS=
You can’t perform that action at this time.