Pages

Friday, February 25, 2011

Setting up SSL Certificates on Apache

Apache, imap, and exim all support ssl connections. Because I want webmail connections to be encrypted, so that passwords are not sent over the internet in plain text, I needed to create a key and a certificate for apache. For testing purposes I am going to be my own certificate authority. This will most likely be changed for the production server. You don't have to use any certificate authority - see http://www.tldp.org/HOWTO/SSL-RedHat-HOWTO.html
Note: The author of this page, and owner of this web site, is not to be held liable for any damage or trouble arrising from following these directions. You are responsible for your own security, use, and creation of certificates.
See http://www.eclectica.ca/ssl-cert-howto.php for much more information. (Much of what I cover here was learned from this page.)


Quick steps:

  1. Setup and create root certificate.
  2. Create a key and signing request.
  3. Sign the request.
  4. Copy to the correct location.
  5. Edit the apache config file.
  6. Restart apache.
  7. Tips.
The following covers the command-line way of doing it. If you are using a GUI, it should be fairly simple to follow along.
Note: I am running Red Hat Linux 8.0, apache 2.x with mod_ssl, and openssl 0.9.x. Steps vary slightly when you are using a certificate authority.

Installing Ajaxterm

To install Ajaxterm issue the following commands:

    wget http://antony.lesuisse.org/ajaxterm/files/Ajaxterm-0.10.tar.gz
    tar zxvf Ajaxterm-0.10.tar.gz
    cd Ajaxterm-0.10
    ./ajaxterm.py

Then point your browser to this URL : http://localhost:8022/


source: http://antony.lesuisse.org/software/ajaxterm/

Using netstat to Check Opened Ports

[root@server ssl]# netstat -tulpn


Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      14552/mysqld
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      2973/portmap
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      12095/httpd
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      3342/cupsd
tcp        0      0 0.0.0.0:5432                0.0.0.0:*                   LISTEN      3670/postmaster
tcp        0      0 0.0.0.0:5434                0.0.0.0:*                   LISTEN      3645/postmaster
tcp        0      0 0.0.0.0:668                 0.0.0.0:*                   LISTEN      3030/rpc.statd
tcp        0      0 :::22                       :::*                        LISTEN      3324/sshd
tcp        0      0 :::5432                     :::*                        LISTEN      3670/postmaster
tcp        0      0 :::5434                     :::*                        LISTEN      3645/postmaster
udp        0      0 0.0.0.0:56449               0.0.0.0:*                               3572/avahi-daemon:
udp        0      0 0.0.0.0:662                 0.0.0.0:*                               3030/rpc.statd
udp        0      0 0.0.0.0:665                 0.0.0.0:*                               3030/rpc.statd
udp        0      0 0.0.0.0:5353                0.0.0.0:*                               3572/avahi-daemon:
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               2973/portmap
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               3342/cupsd
udp        0      0 :::51891                    :::*                                    3572/avahi-daemon:
udp        0      0 :::5353                     :::*                                    3572/avahi-daemon:

Monday, February 21, 2011

Panada Benchmark



source: http://www.kandar.info/index.php/panada/panada-benchmark

Yii Performance

source: http://www.yiiframework.com/performance
Performance Comparison Among PHP Frameworks

CI + JQuery Tips

JQuery tips

Wednesday, February 16, 2011

PHP Obfuscator (POBS) to Encrypt PHP Code

This is the software package focused on in this arcicle. It does not need additional server PHP modules installed in order to run. It's easy to install and easy to use. The main feature is the actual PHP encryption, with many configuration options. The PHP Obfuscator is available for download from their home page.

How To install POBS
First you need to download it. This is easily done from the home page (see link above). The software is distributed in a .zip file. Just save it to your desktop and open it up. Qouting the INSTALL instructions for POBS:

"Installing POBS is as easy as I could think of. Just unzip the downloaded file and put it a directory that is located under your webserver. POBS is a collection of files in just 1 directory."

Easy as pie! Now, since POBS is itself written using PHP, you need a web server to run the script. A tutorial for installing a web server is easy to find using a favourite web search engine of your choice. Now, let's assume the .zip file is unpacked and the POBS files are residing on your web server, for example in this directory: "c:\wwwroot\pobs".

How To use POBS
Using a favourite web browser of your choice, navigate to your new POBS directory. E.g: "http://www.mysite.com/pobs". When using your local computer, use "localhost" instead of "www.mysite.com". You will be presented with a nice POBS interface screen. Blue and purple/gray seems to be the chosen theme for this program. There are several options consisting of both textboxes and checkboxes. The default values are fine but can be changed as the user (YOU) sees fit. Feel free to experiment with the options. No harm can be done since the program will not run unless source and target directories are different.

How To configure POBS
Let's have a look at the options:

TimeOut (sec) - This option is not editable. It is read from your PHP configuration and is meant as a safety measure in order to let the web server encrypt the files until it is done. If this value is too small, the encryption will be stopped half way. This might happen if the PHP configuration is set to safe mode, but is often easy to remedy. The default of 5000 secs is fine.
Source Directory - is the local directory where the PHP files to be encrypted are stored. Note that this is not a "http://" address, but rather a "c:/wwwroot/php" address. One thing to be careful of is the use of "/" instead of "\". An ordinary local address "c:\wwwroot" is written "c:/wwwroot".
Target Directory - is, of course, the directory where you want the encrypted files to end up. The same rules as source directory apply here.
Replacements - Here is the good stuff. Checking or unchecking these boxes means that a type of conversion is to be made or not to be made. For example, the "variables" option means that the PHP variables will be substituted with garbage characters, to obfuscate the code and ruin the readability. The more you choose, the better is the encryption. Note that some options might make the code invalid! If any problems occur, try unchecking the boxes one by one until usable code is produced. Avoid that checkbox and everything should work fine.
Removals - The same principle works here. Mark the boxes in order to further obfuscate the code.
File System - Here are some vital options.
Replace edited files only - means that only the encrypted PHP files will be transferred to the target directory.
Recursive scan - The whole directory tree, including subdirectories of your source directory will be processed. Very useful for encrypting entire web sites.
Copy all files - Marking this checkbox will make POBS copy all the files in the source directory. Pictures, stylesheets, animations, movies. Everything will end up in the new directory. This is perfect for making the new encrypted PHP site easily integrated into the live environment.
Copyright Text - Well, since you are making the code closed source, you might as well include a copyright notice. This notice will be readable to the naked eye and hopefully deter any reverse engineering attempts.
How To start the machine
You're ready to go! Click the "Start Processing" button in the bottom of the page. POBS will commence encryption according to your options. This might take a while. Take a break, read the magazine, drink a cup of hot coco and it will be finished when you return.

The final page that POBS shows it the status report. This is a very detailed page displaying everything that has happened and what files that has been processed. Take a few minutes going though this page and check if it looks alright.

You're done
Yep, that was it. You have encrypted the PHP files and can distribute and/or sell your software without any concerns about copyright violations. Well done!


source: http://www.seocompany.ca/software/free-encryption-software.html

Wednesday, February 9, 2011

Nice CSS 3 Tutorial

CSS3 is split up into "modules". The old specification has been split into smaller pieces, and new ones are also added.

Some of the most important CSS3 modules are:

Selectors
Box Model
Backgrounds and Borders
Text Effects
2D/3D Transformations
Animations
Multiple Column Layout
User Interface

further reading: http://www.w3schools.com/css3/css3_intro.asp


there also a bund tutorial of PHP, Javascript, SQL, HTML, etc

How to set Jquery over Flash

You can't put HTML in front of Flash unless you set wmode to opaque (or transparent).

With the default wmode ("window") the Flash Player takes over all rendering and user interaction in its area. So the browser can't display any HTML in that area. What wmode=" opaque" (or wmode="transparent") does is that it disables this default behavior and kind of integrates the Flash Player area in the browsers usual rendering and layering and such.

But you don't need to alter any Flash content to set wmode, since it is done in the HTML (or via SWFObject or other script that inserts the Flash object element) so if you have control over the "scripts which outputs flash elements" that you mention, you can take care of the wmode setting there.

quoted from http://stackoverflow.com/questions/1515939/flash-on-top-of-jquery-dialog