This file contains hidden or 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
# Reference | |
# https://www.linuxcloudvps.com/blog/how-to-install-odoo-10-on-ubuntu-16-04-with-nginx-as-a-reverse-proxy/ | |
# https://linuxize.com/post/configure-odoo-with-nginx-as-a-reverse-proxy/ | |
upstream odoo { | |
server 127.0.0.1:8069; | |
} | |
upstream odoo-chat { | |
server 127.0.0.1:8072; |
This file contains hidden or 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
import os | |
import datetime | |
import glob | |
def modification_date(filename): | |
t = os.path.getmtime(filename) | |
return datetime.datetime.fromtimestamp(t) | |
files = glob.glob('*') |
This file contains hidden or 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
sudo apt install apt-transport-https | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 | |
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org |
This file contains hidden or 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
#!/bin/bash | |
domain=example.com | |
token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | |
#get record_id from this command | |
#curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer $api" "https://api.digitalocean.com/v2/domains/$domain/records" | |
record_id=88888888 | |
current_ip="$(\ |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import sys | |
import csv | |
import xlsxwriter | |
""" | |
requirements: | |
pip install xlsxwriter | |
pip install progressbar2 | |
usage: |
This file contains hidden or 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
## OpenERP backend ## | |
upstream openerp { | |
server 127.0.0.1:8080; | |
} | |
server { | |
listen 443 default; | |
server_name e-system.afrims.org; | |
client_max_body_size 2G; |
This file contains hidden or 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
# set up locale for terminal prevent unknow locale | |
echo export LC_CTYPE=en_US.UTF-8 >> .profile | |
echo export LC_ALL=en_US.UTF-8 >> .profile | |
source ~/.profile | |
wget https://salsa.debian.org/postgresql/postgresql-common/raw/master/pgdg/apt.postgresql.org.sh | |
bash apt.postgresql.org.sh |
This file contains hidden or 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
MASTER_IP= | |
SLAVE_IP= | |
# service postgresql stop | |
su - postgres | |
psql -c "CREATE ROLE replica WITH PASSWORD 'myreplpassword' LOGIN REPLICATION;" | |
#Security for master allow standby access | |
echo "host replication replica $SLAVE_IP/32 md5" >> /etc/postgresql/9.6/main/pg_hba.conf |
This file contains hidden or 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
CREATE USER readonlyuser WITH ENCRYPTED PASSWORD 'secret'; | |
GRANT USAGE ON SCHEMA public to readonlyuser; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonlyuser; | |
-- repeat code below for each database: | |
GRANT CONNECT ON DATABASE mydbname to readonlyuser; | |
\c mydbname | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO readonlyuser; --- this grants privileges on new tables generated in new database "foo" |
This file contains hidden or 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://stackoverflow.com/questions/37771434/mac-pip-install-pymssql-error | |
# install freetds | |
brew unlink freetds; | |
brew install [email protected]; | |
brew link --force [email protected] | |
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile | |
pip install pymssql |