Category Archives: Computer Science

Mostly programming and coding work related to PHP, HTML, Java, C#, Python and any other that I come across. May also include consumer level articles.

Protect and secure WordPress admin

The plain HTML based websites are no longer popular on the net. This is because the PHP based Content Management Systems (CMS) offer wide range of flexible solutions. From development stand point CMS programs allow easy integration of different tools such as jQuery, JavaScipt, PHP scripts and many more. From end-user point of view, it is much easier to manage a CMS based site like a WordPress or a Drupal site than to carefully edit each HTML Continue reading Protect and secure WordPress admin

Installing web applications

There are two major platforms used commercially for web development; Microsoft Windows Server and Linux based OS versions such as Red Hat Enterprise. You could also get a fully operational free version of Linux Operating Systems for personal or small business use. Out of the two main platforms, the most popular one among large companies is Microsoft Windows Server. I will demonstrate how to install a Web Application using the Microsoft Web Platform Installer (version 4.6 to be exact).

Web Applications

Web Applications, Scripts or web modules are programs that can be installed on a server to manage web based media. It can be databases such as SQL, or server side languages such as PHP, or web Content Management Systems (CMS) such as WordPress and Drupal. Some of these programs depend on others. Drupal and WordPress depend on PHP database so a server must have the PHP module installed to support them.

Microsoft Web Platform Installer (Web PI)

Web PI is a free software package (yep… it is legally free) developed and distributed by Microsoft. You can download it here. In includes a large repository of free web applications for web development and deployment. To install it, you need a Windows based operating system. It could be a server type OS or a regular desktop OS like Windows XP, 7, 8, etc. Check their website for supported systems.

I will use the Web PI 4.6 installed on Windows Server 2012 Datacenter OS for my examples. But the process is the same/similar regardless of the Operating System. Please note that this article explains the Server Administer side installation process. The client side installation process, which you usually get through a web hosting company, has a completely different installation process (on shared hosting).

Installing WordPress Web App

WordPress is the most popular platform for blogging for awhile. Recently full-blown websites have been built on it. The WordPress platform became popular because it has an easy to use user interface and a streamline update system. Naturally, I will use the WordPress Web Application as an example. But you can install any other program or application using Web PI following the same steps.

1) After installing Web PI, select “Products” tab from the top. Install “ISS XX.XX Express” and “ISS Recommended Configuration”. You may have already installed these on your server during the initial setup of the system.

MS Web PI Products Tab. Make sure the key components are installed.
MS Web PI Products Tab. Make sure the key components are installed-Click to enlarge.

If the PHP module is not installed, you will be prompt to install during the install of applications that depends on it. Since we are going to install WordPress, you may also install the PHP module now.

2) Select “Applications” tab and “Add” all the Web Apps you would like to install. You may install more than one at a time. After adding, press “Install”.

MS Web PI Applications Tab. Add for installation.
MS Web PI Applications Tab. Add for installation-Click to enlarge.

In this particular example, I will be installing one application; WordPress for Windows. Other options include variety of CMS such as Drupal, Joomla, Orchard, .NET, etc and web programs such as Moodle, Gallery Server Pro, etc.

3) The PREREQUISITES Window will check for all dependencies. If a dependency such as SQL or PHP is not installed, this will add those to the installation process. Accept for installation. Depend on the speed of your computer components, it will be installed in few seconds to a few minus period.

Prerequisites for WordPress Web Application.
Prerequisites for WordPress Web Application-Click to enlarge.

Application installation process.
Application installation process-Click to enlarge.

4) Once installation is completed, you will be greeted with the CONFIGURE Window. Select the location of install in your system from “Web Site” drop-down. The “application name” will determine the folder in which the installation will be done. In this case I choose “wp” as my application name. Hence the final access will be at http://localhost:80/wp and you may change the root folder of the site later. Keep reading this article for more information on how to do that.

WordPress installation server location setup.
WordPress installation server location setup-Click to enlarge.

5) The next CONFIGURE Window has a form which user should edit. Do not panic! All those “Keys” can be confusing. Just enter either a random set of numbers and letter or something meaningful to you. It does not matter what you enter. I usually use the exact same set of characters for all of the options. Press “Continue”.

Web Application Configuration Window. Type several characters for each option (key).
Web Application Configuration Window. Type several characters for each option (key)-Click to enlarge.

6) Record all the “Password Settings” information under the FINISH Window. You may “Copy to clipboard” and paste it somewhere for saving as well. I usually save in a Text file.

Password Settings for WordPress app Install.
Password Settings for WordPress app Install-Click to enlarge.

Now you may visit the site by selecting “Launch WordPress” or you may simply type the location address in Step 4 on a Internet window. Close the windows by pressing “Finish”. The first thing you will see on the Internet window is a setup page. Each Web App has its’ own setup page. In this particular example, it will be a WordPress CMS setup page. This is the final step!

WordPress CMS setup page.
WordPress CMS setup page-Click to enlarge.

Additional options

We setup the Web App in a folder named “wp” in Step 4. But let’s say your client insists that their website should not have “wp” as prefix (http://example.com/wp). You do not have to reinstall everything. You do not have to relocate the folders on the server either. What you need to do is to go to the domain settings and make “wp” your root folder. Now the http://example.com/wp will be http://example.com/. Another way to do this is through domain registrar options. You can point the domain name to wp folder from there as a root.

As mention before, you may install any of the Web Applications on a single server. They very lightweight programs, that they will not effect the performance of the server (but the traffic flow will). I highly recommend using different folders for each Web Application. This will avoid conflicts between them.

By default, all web applications take Port 80 (HTTP port) over others. However, you may also change this to whatever the port you want. You may ask, why would you want to use non-standard port? One reason would be that you are a developer or a student. If your ISP blocked access to Port 80, then you can bypass this by using a different port and utilizing port forwarding.

How to fix overclocking failed error

This is a well documented boot failure issue on most Asus motherboard. When the issue arise, the message, “Overclocking Failed! Please enter setup to re-configure your system.” will be displayed on start up before the system goes into boot sequence. So, how can you fix this?

A typical Overclocking Failed! error.
A typical Overclocking Failed! error.

What causes the problem?

The K-type processors from Intel can be safely overclocked. The manufacture Asus has several built-in functions on their motherboard that takes advantage of this Intel K-type processors. The motherboard has a program in BIOS to change the processor and RAM memory speed. If you have not manually overclocked the RAM or the processor before this error was displayed, then it is most likely caused by memory frequency issue.

The Intel CPU and the memory frequency is often changed during an overclocking process. It also may change during a boot-up or shutdown process. When either boot-up or shutdown processes does not go to completion due to power failure or other issues, then it may result in the frequency for CPU/RAM stuck in a higher than normal value.

Here is how you fix it

As instructed on the error screen, go to your BIOS setup (F2 or DEL at the start-up). The first option is obvious; press F5 (or find other means) to set all parameters in BIOS to Default. Now reboot and if that fails, then try the following.

1) Change the profile under “System Performance” to “Power Saving” profile.

Asus Main BIOS page (EZ Mode)
Asus Main BIOS page (EZ Mode)-Click on enlarge.

2) Go to “Advanced Mode” (select or F7-check above image) then select “Ai Tweaker” tab from the top.

Ai Tweaker tab under Advanced Mode
Ai Tweaker tab under Advanced Mode-Click on enlarge.

3) Change the system Level Up to “Auto”. Note: if “Auto” does not fix your problem, change the setting to the lowest level.

Target DRAM Speed and System Level Up selector.
Target DRAM Speed and System Level Up selector-Click on enlarge.

4) The Target DRAM Speed should read around 1600MHz (or lowest RAM speed possible).

5) Select “Boot” tab from the top and make sure the “Boot Option #1” under “Boot Options Properties” reads “Windows Boot…”.

Boot Option Properties --> Boot Option #1 = Windows Bo...
Boot Option Properties –> Boot Option #1 = Windows Bo…-Click on enlarge.

6) Now press “Exit” at the top and select “Save Changes & Reset”. Your system should boot up normally.

If this also failed to resolve the problem, you are not in danger of losing your computer. Go back to “Advanced Mode” and select “Advanced” tab from the top. Now change the Intel CPU variables until you find a solution. This is under CPU Configuration section. Try different combinations. I recommend disabling “Limit CPUID Maximum” and “Intel Visualization Technology”. That is what worked for my computer.

Advanced Intel CPU BIOS option
Advanced Intel CPU BIOS option–Click on enlarge.

Advanced Intel CPU BIOS options-CPU Configurations
Advanced Intel CPU BIOS options-CPU Configurations–Click on enlarge.

Please note that the above instructions are not Scientific nor approved by the manufactures. They are based on my personal experience. I have fixed few Asus computers with this issue by following the steps. There is no way I can guarantee that these steps will also work for your system. Use the information with caution.

Cloud computing: a blessing and a curse

Right after the DOT-COM bubble began to shrink, a new concept of computing called cloud computing gave hope to a dying breed. It boosted the profits of entirely Internet based companies like Dropbox Inc. and opened the market for new Internet based companies. The next big step for this technology is the “smart home” which also referred to as “connected home”.

Continue reading Cloud computing: a blessing and a curse

Modification to extend wireless range

Consumer Electronics Design not always beneficial if it retards the primary functions of a device. The internal antennas are such a design concept that cause a lot of headaches for tech guys like me. The primary function of a antenna is to transmit a signal, capture a signal or both. Since most modern equipments are manufactured with plastic casings (as opposed to metal), a lot of manufactures have opted for internal antennas. The advantage; now nothing is sticking out, they can make the equipment more desirable to mainstream consumers by making “beautiful” equipments boxes. I am on the other hand one of those people who would buy a device for its’ practical functionality over looks.

The following modification was made on my VeraLite (Vera3 variant) to remove dead-zones in my Z-wave network. However, using the same principles and steps, you can also extend the range of your WiFi network. I will add bits of information specific to WiFi extension on this article.

Vera3 and VeraLite controllers

The door locks on Z-wave networks almost always accept only secure authenticated signals. In order to operate the locks you must send the signal either directly from your Z-wave controller (in this case VeraLite) to the locks or use repeaters (or modules with secure repeaters) that are capable of secure signal handling. I found it is extremely hard to find such repeaters in Canada.

So I went with the second option; direct communication between the locks and the controller. However, my controller is in a locked cabinet far away from the locks. This causes reliability issues because unlike Z-wave light switches, door locks cannot take unsecured signals repeated from nearby low security switches.

Modification to the controller

Warning: This modification will void your manufactures’ warranty. Beware of the static charges. Static electricity could burn out your circuit board. Either use a grounded anti-static wrist strap or use extreme caution. Remove all power supply units (batteries & DC power unit) before opening the case.

Parts, tools and technical information

  • Antenna must be able to handle frequency range of the device (for this mod, 908 MHz)
  • U.fl/IPEX to RP-SMA Pigtail with at least 5 cm; 10 cm is too much; find happy medium) of wire length between the connection points
  • GSM antenna extension cable (optional and longer the cable, more problems arises)
  • Small needle nose pliers
  • Small Phillips screwdriver and a large slotted screwdriver or a flat plastic or mental piece
  • Small electric drill or a utility knife

It is very easy to take apart VeraLite unit. Only two screws and few plastic clips that holds the plastic casing. One of my readers (“Jack”) pointed out that the screws will not come out from the casing. In that case do not try to pull it out. Once the screws are lose, you do not have to take them out of the holes in order to separate the green cover from the case. Use a flat head screw driver or a flat object to pull the cover apart. Be careful to not to break the clips that holding the two parts.

Inside you will find the internal antenna attached to side of the box with a connection wire going to the Printed Circuit Board (PCB). Click on the the image below for more detailed information.

VeraLite PCB: A = Internal antenna, B = Cutout made for ext. antenna. C = Antenna connector
Figure 1: VeraLite PCB: A = Internal antenna, B = Cutout made for ext. antenna. C = Antenna connector

Disconnect the internal antenna wire from point C (refer to above image) by gently twisting and pulling on the connector. Do not pull from the wire because it will break the wire from the connector. I recommend using a small needle nose pliers.

Make a hole through the casing, either on the back or on the side. Make sure it is large enough to pass the SMA (SubMiniature version A) male connector but not its’ neck. I used a box cutter to be safe, but you can also use an electric drill. If you are using a large construction grade drill, please be careful to not to break the box. I found the utility knife to be the best option.

Creating a circular cutout to pass the male SMA end
Figure 2: Creating a circular cutout to pass the male SMA end

Take the U.fl/IPEX to RP-SMA Pigtail (Figure 3) and connect the U.fl side to the board. Then pass the SMA side from inside to outside. Then connect the other end to the point C (Figure 1) on the board.

U.fl/IPEX to RP-SMA Pigtail
Figure 3: U.fl/IPEX to RP-SMA Pigtail

Internal and external view of the final product.
Figure 4: Internal and external view of the final product.

Put the box back together and your done! For the external antenna now you have the option of adding it directly to the device shown in Figure 3 or you can add a antenna cable before adding the antenna itself. This is what most people do when they want to secure their devices in a cabinet. You can keep the network controller inside while antenna outside for greater coverage.

It is quite possible to salvage antenna and U.fl/IPEX to RP-SMA Pigtail connection wire from old devices such as wireless routers and GSM devices. But unfortunately most WiFi routers are on 2.4 GHz band while Z-wave is in 900 MHz band. For example, this particular model is at 908 MHz frequency. If you cannot find a GSM device to get an antenna, please buy one (~ $8 – $12 CAD) to take the full advantage out of this modification. Connection wire from a WiFi router is suitable for Z-wave broadcast.

Antenna length difference due to wavelength difference between 2.4 GHz vs 900 MHz
Antenna length difference due to wavelength difference between 2.4 GHz vs 900 MHz

If you would like to know more about how antennas work, try this site.

Modify WiFi Routers

Yes, you can modify your b/g/n/ac WiFi routers with built-in antenna(s) by following the same instructions. The only difference is now you can use any old 2.4 GHz or 5 GHz (not very popular) antennas for your project.