Jul 15, 2018

playing with socat

liat komunikasi header (request + response)
    sudo socat -v TCP-LISTEN:8001,fork  TCP:192.168.100.100:8069  

lihat komunikasi data  (request + response)
    socat -u tcp4-listen:1934,fork SYSTEM:'tee in.txt |socat - "TCP:192.168.100.100:8069" |tee out.txt'

check header request
    socat -u tcp4-listen:1934 -

forward to 2 destination, just first
    socat -u tcp4-listen:1934 - | tee >(socat - tcp4:127.0.0.1:1935) >(socat - tcp4:127.0.0.1:1936) > /dev/null

Read more ...

Jul 4, 2018

moving odoo 10 from site to other site


simple summary steps
0. turn off all websites traffic, and restart the postgres
1. backup source file
2. backup filestore
3. backup database via psql

let's rock the job!!!

1.
BACKUP SOURCE FILE
make zip file under Odoo folder

2. BACKUP filestore
the location usually here  ".local/share/Odoo/filestore"

3. BACKUP Database
DATABASE BACKUP
pg_dump esti > esti_o10_jul_4_18.out

DATABASE RESTORE
psql
create database esti owner odoo;

postgres@weskadung:/home/febru/backup_esti$ psql -f esti_o10_jul_4_18.out esti

postgres=# \l
                                   List of databases
    Name     |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges  
-------------+----------+----------+-------------+-------------+-----------------------
 esti    | odoo     | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
Read more ...

Jun 5, 2018

solved erpnext help doesn't exist

error is :

ProgrammingError: (1146, u"Table 'xxxxx .help' doesn't exist")
SOLUTION is  : 
bench setup-help
Read more ...

Jun 4, 2018

SOLVED erpnext can not find variables.less

the error :

19:06:15 watch.1          | Error compiling  erpnext.less
19:06:15 watch.1          | { [Error: 'variables.less' wasn't found. Tried - variables.less,/home/frappe/frappe-bench/apps/erpnext/erpnext/public/less/variables.less,/home/frappe/frappe-bench/sites/node_modules/variables.less,variables.less]
19:06:15 watch.1          |   message: '\'variables.less\' wasn\'t found. Tried - variables.less,/home/frappe/frappe-bench/apps/erpnext/erpnext/public/less/variables.less,/home/frappe/frappe-bench/sites/node_modules/variables.less,variables.less',
19:06:15 watch.1          |   stack: undefined,
19:06:15 watch.1          |   type: 'File',

19:06:15 watch.1          |   filename: 'erpnext.less',

solutions :

find . -iname variables.less

then copy the file to one of those location, example  :

frappe@ubuntu:~$ cp frappe-bench/apps/frappe/frappe/public/less/variables.less /home/frappe/frappe-bench/apps/erpnext/erpnext/public/less/variables.less


then bench start 
Read more ...

SOLVED Erpnext throw er Unhandled 'error' event ENOSPC

Error :

18:43:14 watch.1          | events.js:160
18:43:14 watch.1          |       throw er; // Unhandled 'error' event
18:43:14 watch.1          |       ^
18:43:14 watch.1          | 
18:43:14 watch.1          | Error: watch /home/frappe/frappe-bench/apps/erpnext/erpnext/education/doctype/academic_year ENOSPC
18:43:14 watch.1          |     at exports._errnoException (util.js:1020:11)
18:43:14 watch.1          |     at FSWatcher.start (fs.js:1451:19)
18:43:14 watch.1          |     at Object.fs.watch (fs.js:1478:11)
18:43:14 watch.1          |     at createFsWatchInstance (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:37:15)
18:43:14 watch.1          |     at setFsWatchListener (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:80:15)
18:43:14 watch.1          |     at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:229:14)
18:43:14 watch.1          |     at FSWatcher.NodeFsHandler._handleDir (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:408:19)
18:43:14 watch.1          |     at FSWatcher.<anonymous> (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:456:19)
18:43:14 watch.1          |     at FSWatcher.<anonymous> (/home/frappe/frappe-bench/node_modules/chokidar/lib/nodefs-handler.js:461:16)

18:43:14 watch.1          |     at FSReqWrap.oncomplete (fs.js:123:15)


solutions :

frappe@ubuntu:~/frappe-bench$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
fs.inotify.max_user_watches=524288
fs.inotify.max_user_watches = 524288
frappe@ubuntu:~/frappe-bench$ sudo sysctl --system
* Applying /etc/sysctl.d/10-console-messages.conf ...
kernel.printk = 4 4 1 7
* Applying /etc/sysctl.d/10-ipv6-privacy.conf ...
net.ipv6.conf.all.use_tempaddr = 2
net.ipv6.conf.default.use_tempaddr = 2
* Applying /etc/sysctl.d/10-kernel-hardening.conf ...
kernel.kptr_restrict = 1
* Applying /etc/sysctl.d/10-link-restrictions.conf ...
fs.protected_hardlinks = 1
fs.protected_symlinks = 1
* Applying /etc/sysctl.d/10-magic-sysrq.conf ...
kernel.sysrq = 176
* Applying /etc/sysctl.d/10-network-security.conf ...
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.tcp_syncookies = 1
* Applying /etc/sysctl.d/10-ptrace.conf ...
kernel.yama.ptrace_scope = 1
* Applying /etc/sysctl.d/10-zeropage.conf ...
vm.mmap_min_addr = 65536
* Applying /etc/sysctl.d/99-sysctl.conf ...
fs.inotify.max_user_watches = 524288
* Applying /etc/sysctl.conf ...

fs.inotify.max_user_watches = 524288


Read more ...