Postingan

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:

Konfigurasi Remote VPN L2TP/IPSec di Cisco Router IOS

Pada kesempatan kali ini akan mencoba melakukan Konfigurasi Remote VPN L2TP/IPSec di Cisco Router IOS, L2TP/IPsec merupakan salah satu teknologi VPN selain PPTP, IKEV dan SSL VPN. L2TP tidak mempunyai enkripsi oleh karena itu perlu di amakan dengan IPSec. L2TP/IPsec bisa juga di konfigurasi di Linux menggunakan paket software Strongswan, di Windows Server bisa menggunakan fitur RRAS. Ringkasan konfigurasi, show run Building configuration... Current configuration : 2192 bytes ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname EDGE ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 no ip icmp rate-limit unreachable ip cef ! ! ! ! no ip domain lookup ip auth-proxy max-nodata-conns 3 ip admission max-nodata-conns 3 vpdn enable ! vpdn-group l2tp-group ! Default L2TP VPDN group  accept-dialin   protocol l2tp   virtual-template 1 ...

Basic IPTables rules for SSH and Webserver

set the default policy to DROP #iptables -P INPUT DROP #iptables -P OUTPUT ACCEPT #iptables -P FORWARD DROP  accept anything on localhost #iptables -A INPUT -i lo -j ACCEPT #iptables -A OUTPUT -o lo -j ACCEPT  allow traffic once a connection has been made #iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT  accept anything on ssh port #iptables -A INPUT -p tcp --dport 22 -j ACCEPT  accept anything on http and https port #iptables -A INPUT -p tcp --dport 80 -j ACCEPT #iptables -A INPUT -p tcp --dport 443 -j ACCEPT  to save #apt-get install iptables-persistent

Configure Reverse Proxy With Apache2 on Debian 9

Load modules #a2enmod proxy #a2enmod proxy_http Virtualhost Configuration #cd /etc/apache2/sites-available/ #vi myproxyweb <VirtualHost *:80>         ServerName mywebsite.id         ProxyPass       /       http://192.168.1.1:8080/         ProxyPassReverse   /    http://192.168.1.1:8080/ </VirtualHost> Disable Default #a2dissite default Enable new Virtualhost #a2ensite myproxyweb Restart Apache #systemctl restart apache2 OK!