Install Node.js on CentOS Server

You can find latest version of Node.js at https://nodejs.org/en/ To install Node.js on CentOS 7/8 Add node.js repository NodeJS 12.x curl -sL https://rpm.nodesource.com/setup_12.x | bash – NodeJS 11.x curl -sL https://rpm.nodesource.com/setup_11.x | bash – NodeJS 10.x curl -sL https://rpm.nodesource.com/setup_10.x | bash – NodeJS 8.x curl -sL https://rpm.nodesource.com/setup_8.x | bash – NodeJS 6.x curl -sL https://rpm.nodesource.com/setup_6.x … Read more

lftp

Download files Download all files from FTP server using lftp Download all files from SFTP server using lftp Upload files Upload all files to FTP server using lftp lftp Errors lftp enable debug mode lftp Fatal error: Certificate verification: Not trusted lftp Fatal error: Host key verification failed Connect to a server lftp -u USER,PASSWORD … Read more

load

Load Testing with Siege Apache JMeter – Tool for load/performance testing. iostat sysdig Server Load Load Testing https://k6.io https://loader.io Here are some commands used to investigate server load/performance issue. uptime free -m top atop htop Checking logs dmesg | tail iostat vmstat 1 sar sar iostat iostat iostat -xz 1 pidstat/mpstat pidstat 1 mpstat -P … Read more

SSH

SSH Connection Errors SSH ProxyJump (Jump Host/bastion host) SSH Errors SSH Protect SSH Configuration Options Only allow a specific user to login. Deny SSH access to a Group. You can add multiple groups separated by space. Disconnect if the client is inactive for 120 seconds. Verify sshd configurations are correct

Force SSH client to use Password Authentication

Some times you may need to test if password authentication works for SSH and you have SSH key authentication already set. You can comment out your SSH key from ~/.ssh/authorized_keys to do this. Another solution is to use ssh -o PreferredAuthentications=password USER@SERVER_IP To disable Public key authentication, use -o PubkeyAuthentication=no ssh

Generate CSR using OpenSSL

Info needed for Certificate Signing Request (CSR) generation Generate CSR Here is oneliner For normal SSL, enter the domain without www. For wildcard use *.domain.com For multi-domain (SAN), enter domains separated by space. For Namecheap SAN SSL., enter the main domain only, secondary domains can be added in the Namecheap website. Example OpenSSL CSR Wizard … Read more

discourse

Discourse store data in folder /var/discourse/shared/standalone root@forum:/var/discourse/shared/standalone# ll total 48 drwxr-xr-x 12 root root 4096 Jan 24 05:04 ./ drwxr-xr-x 4 root root 4096 Jan 24 04:57 ../ drwxr-xr-x 3 1000 www-data 4096 Jan 24 06:39 backups/ drwxr-xr-x 6 root root 4096 Jan 25 00:07 letsencrypt/ drwxr-xr-x 4 root root 4096 Jan 24 04:58 log/ … Read more

Convert PPK file to PEM

To convert putty PPK format file to Linux OpenSSL format, run puttygen SSH_KEY.ppk -O private-openssh -o SSH_KEY.pem To install puttygen, On CentOS yum install putty -y On Debian/Ubuntu apt-get install putty-tools -y Related Posts puttygen: error loading x.ppk: PuTTY key format too new Remove SSH Private Key Passphrase SSH

MySQL Backup using mysqldump

Create file mkdir /usr/serverok/ vi /usr/serverok/mysqldump-backup.sh Add #!/bin/bash # Author: Yujin Boby # Email: admin@serverok.in # Web: https://serverok.in/mysqldump-backup DB_BACKUP=”/home/serverok-mysql-backup/`date +%Y-%m-%d`” mkdir -p $DB_BACKUP find /home/serverok-mysql-backup/ -maxdepth 1 -type d -mtime +10 -exec rm -rf {} \; for db in $(mysql -e ‘show databases’ -s –skip-column-names); do if [ $db == “performance_schema” ] || \ [ … Read more

speedtest

https://gtmetrix.com https://tools.pingdom.com https://developers.google.com/speed/pagespeed/insights/ Test network performance with iperf Install SpeedTest cli on Ubuntu

Scripts

User Authentication (SSO) https://www.keycloak.org Advertising https://www.revive-adserver.com Ecommerce Video Sharing Traffic Monitoring Employee Monitoring Social Media Misc Scripts