Sunday, August 30, 2015

Use the System File Checker tool to repair missing or corrupted system files in Window

System File Checker is a utility in Windows that allows users to scan for corruptions in Windows system files and restore corrupted files. This article describes how to run the System File Checker tool (SFC.exe) to scan your system files and to repair missing or corrupted system files. If a Windows Resource Protection (WRP) file is missing or is corrupted, Windows may not behave as expected. For example, some Windows functions may not work, or Windows may crash.  

Thursday, October 24, 2013

Resolve : mCrypt not present after Ubuntu upgrade to 13.10

I think I found the solution at https://bugs.launchpad.net/ubuntu/+source/php-mcrypt/+bug/1241286
So:
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt
sudo service apache2 restart
This worked for me. Hopefully it will be helpful for other people too

Thursday, October 17, 2013

WatchGuard System : Application Control Policy Examples (to allow IM by user and group)

Application Control Policy Examples

Address Link : http://www.watchguard.com/help/docs/wsm/XTM_11/en-US/index.html#en-US/services/app_control/app_control_example_c.html?Highlight=block%20youtube

You can use the Global Application Control action with other Application Control actions to allow or block different applications based on the time of day, or based on the user name or user group. To do this, you create Application Control actions that block or allow different sets of applications. Then you apply different Application Control actions to different policies as described in the examples below.
Each of the examples below enables Application Control actions for a single type of policy. If your configuration includes other policy types, such as TCP-UDP, or Outgoing, you can use the same steps to set up a two-tiered Application Control configuration for those policies. The policies you need to apply an Application Control action to depend on which policies exist in your configuration, and which applications you want to block. For example, if you want to block an application that you know uses FTP, you must enable the Application Control action for the FTP policy.
For recommendations on which types of policies to configure for Application Control, see Policy Guidelines for Application Control.

Monday, July 8, 2013

Get rid of “The file is corrupt and cannot be opened” in Excel 2010

Quick tip: learn how to access a corrupt xls. file in Excel 2010
Usually when upgrading you expect nothing but improvements. So it can be really disappointing when after moving to Excel 2010 you have no chance to access your .xls file created in the application version 2003 and earlier. You understand what I’m talking about if you ever encountered “The file is corrupt and cannot be opened” error in Excel 2010. Still think you can’t open it? Actually you can!
The file is corrupt and cannot be opened in Excel 2010

Monday, May 13, 2013

detecting visitor’s real IP address

I use this block of codes to detect my visitors real IP address. Sometimes users connect to my site via HTTP proxy. if we rely only on $_SERVER['REMOTE_ADDR'], our script would easily spoofed by users.
Here’s the code:
1
2
3
4
5
6
7
8
9
$ipaddress=""; //this variable will hold user's real IP address
if (($_SERVER['HTTP_X_FORWARDED_FOR']!='')&&(substr($_SERVER['HTTP_X_FORWARDED_FOR'], 0, 7)!='127.0.0')&&(substr($_SERVER['HTTP_X_FORWARDED_FOR'], 0, 7)!='192.168')&&(substr($_SERVER['HTTP_X_FORWARDED_FOR'], 0, 3)!='10.')) {
    $ipaddress=trim(end(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])));
    if (($ipaddress=='')||(substr($ipaddress, 0, 7)=='127.0.0')||(substr($ipaddress, 0, 7)=='192.168')||(substr($ipaddress, 0, 3)=='10.')||($ipaddress=='unknown')) {
        $ipaddress=$_SERVER["REMOTE_ADDR"];
    }
} else {
    $ipaddress=$_SERVER["REMOTE_ADDR"];
}
The codes rely on $_SERVER['HTTP_X_FORWARDED_FOR'] for proxy connection. Check for local IP block (private network) and fall back to $_SERVER['REMOTE_ADDR'] if fail. You may also check $_SERVER['HTTP_CLIENT_IP'] variable but in my case, it often return local IP address (private network). After getting this real IP address, you might do some geo IP related services.
Of course this script can’t detect visitor’s real IP address if he/she is using high anonymous proxy server, VPN or SOCKS5 proxy server. Check your browsing anonymity to make sure.

Easily integrate ezPDF (a.k.a pdf-php) into CodeIgniter Framework

Got another spare time, so, another simple tips for you. Last post I already show how to easily integrate PHPExcel in CodeIgniter so you’ll be able to create downloadable XLS report easily. We will complete our CodeIgniter reporting capability by adding PDF output feature. (Yeah, I know PHPExcel can also create a PDF output, but it sucks big, the table is badly formatted)
Why ezPDF (now pdf-php)?
Well, there’s already a guide for integrating TCPDF and DOMPDF into CodeIgniter so I present you another option by using ezPDF (pdf-php)

Creating Ms Word Document using CodeIgniter and PHPWord

One of my reader – Don Lafferty – told us that integrating PHPWord into CodeIgniter is also as easy as integrating PHPExcel into CodeIgniter. So, I decided to give it a try and it really does so simple.
What is PHPWord? From github:
PHPWord is a library written in PHP that create word documents. No Windows operating system is needed for usage because the result are docx files (Office Open XML) that can be opened by all major office software.