List all php packages installed: dpkg -l | grep php| awk ‘{print $2}’ |tr “\n” ” ” Remove all php package: sudo aptitude purge `dpkg -l | grep php| awk ‘{print $2}’ |tr “\n” ” “` Add PPA sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install php5.6 You can install php5.6 modules too for example sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml Verify your version sudo php -vRead More →

Edit file: /etc/rc.local This file will auto run at startup.   This file is a bash file, it might be run when all the services is not ready yet, such as the internet is not ready. If you run immediately, there might be some problems such as the database connection is not ready yet, you wont be able to connect to database server. It’s better to let this script to sleep for a while, then start the job. This is my file: #!/bin/bash sleep 100 # wait for 100 seconds php /www/jobs/update_records.php    Read More →

Our servers recently were crashed due to a large number connections to web (apache) services, we didn’t see anything abnormal on the web. The server will crash when there are over 150 connections, these connections could just come from one IP. After a long investigation, we realize that the attacker attack us by sending a lot of connections, but somehow they put all the TCP status in CLOSE_WAIT status, apache can’t release this. The solution is , we write this script to kill all httpd process having CLOSE_WAIT status. This seems fixing our problems. <? //Some apache process are in close_wait $cmd=”netstat -ntp | grepRead More →

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # server info and status RewriteRule ^(server-info|server-status) – [L] # RewriteCond %{REQUEST_URI} !=/server-status # /server info and status RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_FILENAME} -d RewriteRule . index.php [L] </IfModule> # END WordPressRead More →

Problem: Jabber doesn’t show Outlook calendar even though we have selected Microsoft Outlook for Calendar Intergation FIX: Add a new entry in this registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Messaging Subsystem MAPIXVER = “1.0.0.1”Read More →

Run this script to see your SSL Version <?php $ch = curl_init(‘https://www.howsmyssl.com/a/check’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json = json_decode($data); echo $json->tls_version; ?>   If you want to check your open SSL version? <?php $curl_info = curl_version(); echo $curl_info[‘ssl_version’]; ?> OpenSSL 1.0.1 and later support  TLS v1.1 and TLS v1.2 If you see your OpenSSL version from 1.0.1, then it will support TLS V1.1 and TLS V1.2Read More →

Ubuntu 10.04 is quite old, you can’t just upgrade it right away using do-release-upgrade, you should try the following steps: sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install update-manager-core sudo do-release-upgrade If that’s still doesn’t work, replace /etc/apt/sources.list with this file # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution. deb http://ubuntu.datahop.net/ubuntu/ precise main restricted deb-src http://ubuntu.datahop.net/ubuntu/ precise main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://ubuntu.datahop.net/ubuntu/ precise-updates main restricted deb-src http://ubuntu.datahop.net/ubuntu/ precise-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, pleaseRead More →

Do you still love working with Delphi 7? I do. Delphi 7 is quite old and there are many features on the new Windows 7 that it’s not able to do. Today i faced a problem with UAC, my application needs to run under administrator account, when UAC is enabled, i can’t detect if the user is running with admin account or not. With the new application, the application can force the user to run in administrator mode when UAC is enable easily. Luckily, there is a solution on now. 1. Remove XPMan: Remove any reference to XPMan component in your project. XPMan adds aRead More →