Friday, April 7, 2017

Centos 6/7: using needs-restarting after yum update

Install yum utility
# yum install yum-utils

Some update require system to restart or some services to restart. To determine system needs to restart or some services need to restart, run needs-restarting:

# needs-restarting
1512 : /usr/sbin/sshd
609 : /usr/sbin/NetworkManager --no-daemon
615 : /usr/lib/polkit-1/polkitd --no-debug

Tested on Centos 6.9 and Centos 7.3

References:

Thursday, April 6, 2017

Bignox App Player: upgrade without losing application and data

Nox App Player/NoxPlayer 3.8.1.1  has been release on March 31, 2017. It is based on Android 4.4.2. The upgrade will overwrite any installation on your PC. To prevent any lost your application and data, you need to backup your current Nox.
  1. Use Nox Multi-Drive to backup your application and data. For detail see How to backup and restore your data in Nox App Player. Wait until backup perform successful. It may takes some minutes.
  2. Download latest Nox App Player from bignox.com
  3. Exit any Nox App Player programs, and start installation. 
  4. Installation ask you to overwrite existing installation and choose continue.
  5. At the end of installation, there is a text "restore" (can be click), click it. 
  6. Choose your backup file to restore it into new Nox App Player. 
  7. Wait until finish, it may takes some minutes.
References:

cli: Difference between >> and > operators

Just to refresh and for personal note.
This is apply to all L/Unix.
  • Operator >> will append text to a file.
  • Operator > will overwrite the data in file.

References:

Tuesday, April 4, 2017

Tunning: Odoo 9 and PostgreSQL 9.4

This configuration may not suit for every needs

Default Odoo 9 installation folder:


  • /usr/lib/python2.7/dist-packages/openerp/
  • /usr/lib/python2.7/dist-packages/openerp/addons/

Edit /etc/odoo/openerp-server.conf

...
max_cron_threads = 1
...

Edit /etc/postgresql/9.4/main/postgresql.conf

...
# - Memory -
shared_buffers = 8192MB                 # min 128kB
                                        # (change requires restart)
...
# - Checkpoints -
#checkpoint_segments = 3                # in logfile segments, min 1, 16MB each
checkpoint_segments = 32                # 512MB https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server
...
# - Planner Cost Constants -
#effective_cache_size = 4GB
effective_cache_size = 8GB
...
Note:
  • shared_bufferes = 1/4 physical memory
  • effective_cache_size = 1/2 physical memory

References:

Debian Jessie: configure timezone using cli

Using timedatectl


To list timezone:

# timedatectl list-timezones | grep Jakarta
Asia/Jakarta

To set timezone:

# timedatectl set-timezone Asia/Jakarta

To show (or # timedatectl status):

# timedatectl
      Local time: Tue 2017-04-04 07:33:53 WIB
  Universal time: Tue 2017-04-04 00:33:53 UTC
        RTC time: Tue 2017-04-04 00:33:53
       Time zone: Asia/Jakarta (WIB, +0700)
     NTP enabled: no
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

tzconfig deprecated

# tzconfig --help
WARNING: the tzconfig command is deprecated, please use:
 dpkg-reconfigure tzdata

References:

Monday, April 3, 2017

Debian Jessie: apt-cache-ng

Install apt-cacher-ng on server

# apt-get install apt-cacher-ng

Limiting access using iptables, rules:

-A INPUT -p tcp --dport 3142 --source 127.0.0.0/8 -j ACCEPT
-A INPUT -p tcp --dport 3142 --source [your network] -j ACCEPT
-A INPUT -p tcp --dport 3142 -j DROP
COMMIT

On server and client:

# vi /etc/apt/apt.conf.d/02proxy
Acquire::http { Proxy "http://[your ip server]:3142"; };
For server [your ip server] can be replaced with 127.0.0.1

Log apt-cacher-ng:

# tail /var/log/apt-cacher-ng/apt-cacher.log
1491201231|I|260|127.0.0.1|debrep/dists/jessie-backports/main/i18n/Translation-en.diff/Index
1491201231|O|28126|127.0.0.1|debrep/dists/jessie-backports/main/i18n/Translation-en.diff/Index
1491201231|O|237|127.0.0.1|security.debian.org/dists/jessie/updates/main/i18n/Translation-en.bz2
1491201231|O|233|127.0.0.1|debrep/dists/jessie/main/i18n/Translation-en.bz2

References: