The service record for ldap and kerberos are used to identify LDAP and Kerberos server for a domain in Active Directory. When you configure some authentication method, it might ask you to specify the LDAP or Kerberos Server.  The simplest way to achieve this is using nslookup command. nslookup -type=srv _ldap._tcp.dc._msdcs.<domain> <dns server ip> nslookup -type=srv _kerberos._tcp.dc._msdcs.<domain> <dns server ip>Read More →

I built a customize alert, and there are some required fields on the form. User must provide data for these fields. When we build the alert with Addon Builder, the code generated by the builder only validate the required fields when the alert is triggered.  This will cause some problems because the user is not aware of this. We can’t use javascript in the html form, fortunately there is a solution, we can use the restmap.conf. This is the sample restmap.conf , you should put it in local\restmap.conf   The code below assume that your action name is “youractionname” and the required field is “title”Read More →

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:  @reboot ( sleep 30 ; sh /location to your script/script.sh )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. sudo apt-get -y install gcc make autoconf libc-dev pkg-config sudo apt-get -y install libgeoip-dev pecl install –nodeps mcrypt-snapshot when you are shown the prompt: libmcrypt prefix? [autodetect] : hit Enter once installed , you need to create a configuration file for it sudo bash -c “echo extension=mcrypt.so > /etc/php/7.2/conf.d/mcrypt.ini”Read More →