There will come a time when you need to start some scripts at startup, but you don’t want to to create it as a service. This is to help you to accomplish that. There are 2 methods: Using /etc/rc.local , this seems only working on Ubuntu 18.04 and older , from version 19, it seems not working. It’s like a bat file in windows, you create that file if it does not exist: nano /etc/rc.local sh /location to your script/script.sh chmod +x /etc/rc.local Using crontab -e , add this line: Read More →

session_set_save_handler(“open”, “close”, “read”, “write”, “destroy”, “gc”); function read($id) { //if we can’t find the data for this session, we must return ” (empty string) , can’t return false return ”; }Read More →

This is mostly because the script is hang at some point , the server still keeps the connection, this will end up where server can’t accept new connection. This is a dirty approach – it will kill all process having waiting time > 30s #/bin/bash #Delete all apache having process with waiting time >30s GetAllWorkers() { AllWorkers=$(apache2ctl fullstatus | grep ” W ” | awk ‘$6>30 {print $2}’) for PID in $AllWorkers; do echo stopping $PID with SIGTERM kill -9 $PID done } GetAllWorkersRead More →

mcrypt extension is an interface to the mcrypt cryptography library. mcrypt is included in php5 to  php7.1 , but it’s removed from php7.2 . The instructions below help you install mcrypt for php7.2 on  Ubuntu. when you are shown the prompt: hit Enter once installed , you need to create a configuration file for itRead More →