Skip to content

Instantly share code, notes, and snippets.

@akhdaniel
akhdaniel / run-multiple-redis-instances.md
Last active June 22, 2024 12:27 — forked from jarvys/run-multiple-redis-instances.md
run multiple redis instances on the same server for centos

Run Multiple Instances of Redis on Centos 7

create a new redis .conf file

$ cp /etc/redis.conf /etc/redis-xxx.conf
$ sudo chown redis:redis /etc/redis-xxx.conf

edit /etc/redis-xxx.conf, illustrated as below

@akhdaniel
akhdaniel / Installation Checklist: Odoo v10 + Ubuntu 16.04 +Nginx + Certbot SSL.md
Last active April 17, 2024 07:46
Installation Checklist: Odoo v10 + Ubuntu 16.04 + Nginx + Certbot SSL

Step 1 - Add the Odoo repository

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -
echo "deb http://nightly.odoo.com/10.0/nightly/deb/ ./" >> /etc/apt/sources.list
apt-get update

Step 2 - Configure a Linux user for Odoo

# Enable request logging in Odoo using one of the following:
# * pass --log-level=debug_rpc
# * or pass --log-handler=odoo.http.rpc.request:DEBUG (to only debug request times)
# * or set the equivalent config option in the Odoo config file
# Then save the following as a munin plugin to monitor the last 5 minutes of your Odoo config file
# Be sure to set the correct path for the Odoo log file, and adjust the variables as needed
#!/bin/bash
# Setup an appropriate nginx log_format in the `http` section of your nginx config:
log_format main '$remote_addr $time_iso8601 "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_host" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time ';
# Then save the following as a munin plugin to monitor the last 5 minutes of your nginx access.log file
@akhdaniel
akhdaniel / Python3 Virtualenv Setup.md
Created November 21, 2018 05:20 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@akhdaniel
akhdaniel / gist:32fbeaa3ea723ddff00b8a7baf9a533a
Created December 13, 2018 01:01 — forked from shadowmint/gist:7004832
Kivy example using sqlalchemy to build a layout.
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import sessionmaker
from sqlalchemy import ForeignKey
from sqlalchemy.orm import relationship, backref
from kivy.graphics import Rectangle
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.label import Label
from kivy.uix.widget import Widget
@akhdaniel
akhdaniel / pos.diff
Created December 14, 2018 03:51 — forked from nim-odoo/pos.diff
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 9b222f1..4492457 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -1889,7 +1889,8 @@ exports.Order = Backbone.Model.extend({
}
return zero_pad(this.pos.pos_session.id,5) +'-'+
zero_pad(this.pos.pos_session.login_number,3) +'-'+
- zero_pad(this.sequence_number,4);
+ zero_pad(this.sequence_number, 4) +'-'+
[options]
addons_path = /Users/daniel/odoo10/odooc/odoo/addons,/Users/daniel/odoo10/addons10
admin_passwd = admin
csv_internal_sep = ,
data_dir = /Users/odoo/Odoo
db_host = localhost
db_maxconn = 64
db_password = openerp
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
#!/bin/bash
# sesuaikan dengan lokasi folder PG masing-masing
PGDATA=/var/lib/postgresql/9.5/main
pid=`head -1 $PGDATA/postmaster.pid`
echo "Pid: $pid"
peak=`grep ^VmPeak /proc/$pid/status | awk '{ print $2 }'`
echo "VmPeak: $peak kB"
hps=`grep ^Hugepagesize /proc/meminfo | awk '{ print $2 }'`
echo "Hugepagesize: $hps kB"
hp=$((peak/hps))