There are some situation  when we run a time-consuming process, we need to see the output of that command to see its progress. Normally, we would have to wait until the process ends , then we can see the output. The reason for this is because web or standard output normally buffer some contents, it will wait for enough data to print out to the client. To fix this issue, we tell our server/script not buffering anything, print out immediately when it can. Here are some steps that i did in Python. Step1: Tell the server not buffering anything, don’t use gzip ( if weRead More →

Restrict User to FTP Only: A Guide for Enhanced Security and Access Control In any organization or server setup, securing user access is a critical component of maintaining data privacy, integrity, and overall system security. One common security measure is restricting users to only a specific service or protocol, such as FTP (File Transfer Protocol), to prevent unauthorized access to other parts of the system. If you are running an FTP server and need to ensure that a user has access to only FTP services, rather than providing full shell access to the system, this article will walk you through how to restrict a userRead More →

NOTE: this is only if you can’t use apt to clean up due to a 100% full /boot Get the list of kernel images Get the list of kernel images and determine what you can do without. This command will show installed kernels except the currently running one $ sudo dpkg –list ‘linux-image*’|awk ‘{ if ($1==”ii”) print $2}’|grep -v uname -r You will get the list of images somethign like below: linux-image-3.19.0-25-generic linux-image-3.19.0-56-generic linux-image-3.19.0-58-generic linux-image-3.19.0-59-generic linux-image-3.19.0-61-generic linux-image-3.19.0-65-generic linux-image-extra-3.19.0-25-generic linux-image-extra-3.19.0-56-generic linux-image-extra-3.19.0-58-generic linux-image-extra-3.19.0-59-generic linux-image-extra-3.19.0-61-generic Prepare Delete Craft a command to delete all files in /boot for kernels that don’t matter to you using brace expansion to keepRead More →

First of all, we need to order a certificate , this certificate is the same with normal web server certificate. The certificate will have 3 files: cert, key, cabundle. We use CentOS for example in below tutorial, please adjust the file to correct one on your server according to above description. Postfix (SMTP server) We can use postconf command to update SSL related settings directly: postconf -e smtpd_tls_cert_file=’/etc/pki/tls/certs/cert.pem’ postconf -e smtpd_tls_key_file=’/etc/pki/tls/private/privkey.pem’ postconf -e smtpd_tls_CAfile=’/etc/pki/tls/certs/fullchain.pem’ Restarting Postfix service is required. Dovecot (POP3/IMAP server) SSL certificate settings are defined in Dovecot main config file, /etc/dovecot/dovecot.conf (Linux/OpenBSD) or /usr/local/etc/dovecot/dovecot.conf (FreeBSD): ssl = required ssl_cert =Read More →

In some situations,  our web server receive too many connections. The number is much higher than normal, that could be an issue with our code, or we are being attack. While waiting to find a solution, we need a solution to keep the service running. The easiest solution is to restart our web server when it’s go over our limit. We’ll keep the log what the server is running, then restart the server. Later on we can see our log and do the fine tuning. cnt=ps -Af | grep apache2 | grep -v rotatelogs | grep -v grep | wc -l now=date +%Y-%m-%d_%H-%M # changeRead More →

Below are the steps to fix this issue: Shut down your old slave server and make a copy of the data directory to your new slave. Make sure you get the old slave’s master.info and relay-log.info files. Once you have a copy of the data directory, you can restart the old slave if desired. The rest of these steps are performed on the new slave. Rename the master.info to master.info.oldslave and relay-log.info to relay-log.info.oldslave. Edit /etc/my.cnf and add the line “skip-slave-start” (without the quotes) to the [mysqld] section. Start the new slave. This will create new master.info and relay-log.info files. Because you used “skip-slave-start”, theRead More →