Postingan

Menampilkan postingan dari Agustus, 2019

how to run script at boot using systemd

Example I have script to run at boot Create your own script, my example is start-myscript.sh Make that the script executable with: chmod u+x /usr/local/bin/start-myscript.sh And then create a file named end with .service, this file will be used to call the start-myscript.sh, example: myscript.service file should look like this: [Unit] Description=My Script [Service] ExecStart=/usr/local/bin/start-myscript.sh [Install] WantedBy=multi-user.target Now do a few more steps to enable and use the .service file: Place it in /lib/systemd/system folder with say a name of myscript.service Start it: sudo systemctl start myscript Enable it to run at boot: sudo systemctl enable myscript Stop it: sudo systemctl stop myscript

How to create postgresql user and database with peer authentication

Default peer authentication is configured on pg_hba.conf I tried on postgresql version 9 RootTerminal#adduser dev11 RootTerminal#passwd dev11 Login with default postgres user first RootTerminal#su - postgres Login to postgres terminal with the following command -bash-4.2$psql postgres=#create user dev11 with password '$3curE'; CREATE ROLE postgres=#create database dev11db; CREATE DATABASE postgres=#grant all privileges on database dev11db to dev11; GRANT Back to RootTerminal and try login with user dev11 to access its database. RootTerminal#su - dev11 [dev11@centos7-vm1 ~]$ psql -U dev11 -d dev11db psql (9.2.24) Type "help" for help. dev11db=>

How to Configure PostgreSQL to allow remote connection

Example: db-srv-10 with ip 192.168.1.1 user database: default postgres Configure: find / -name "postgresql.conf" /var/lib/pgsql/data/postgresql.conf vi /var/lib/pgsql/data/postgresql.conf listen_addresses = 'localhost' with listen_addresses = '*' find / -name "pg_hba.conf" vi /var/lib/pgsql/data/pg_hba.conf host    all             all              192.168.1.024                       md5 Test:   psql -h 192.168.1.10 -U postgres

How to convert VMDK to OVA

Gambar
Disini saya membuat VM dengan VMWARE Workstation 15 dengan output file VMX,VMDK dan file-file lainnya kemudian akan saya buat menjadi OVA berikut caranya: Download OVF Tool dari VMWARE  https://code.vmware.com/web/tool/4.3.0/ovf Jalankan perintah ovtool  lokasi vmname.vmx  vmname.ova Berikut contohnya: