Hiren : BootCD iso image from http server

Hiren : BootCD iso image from http server

 hiren boot cd iso

Now we will take GPXE to boot an iso disc image through http protocol.

This time I tried with an Hiren BootCD iso image – a very famous and popular All-in-One BootCD. It takes about less than 30 seconds to load and boot the image using 100Mbps LAN network. If move to Gigabit network, the time will be much better.

To boot the iso file, grub4dos does use (0xff) mapping instead of (hd0). Detail entry menu which used this time :
Server# cat /var/ftpd/pxelinux.cfg/default
LABEL cdrom
APPEND --config-file="map (rd)+1 (0xff); map --hook; chainloader (0xff)"
And it works perfectly.
Some screenshots :
Requiring IP address by DHCP
 hiren boot cd iso
Loading the image.
 hiren boot iso
Booted to the Hiren Disc.
 hiren boot cd iso image
Hiren Boot Menu.
 hiren boot cd iso
Hiren BootCD.
 hiren boot cd iso
Hints :
  • You can gzip the iso image to smaller size to get much better speed.
How to Run Windows XP in Ram Memory

How to Run Windows XP in Ram Memory

Windows XP Ram Memory
Objective :
As you know, PC memory (RAM) works at super fast speed. Maybe it is the second fasted factor in PC architecture (slower than CPU cache memory). This post will show you how to load and run Windows XP in RAM to see how fast it does run.
Requirement :
Suppose that you have already known how to :
  • Make a vhd disk image which includes winxp.
  • Make winxp to minimal size.
  • Boot a vhd image by grub4dos.

Take these articles for detail guidance :

Primary steps :
  1. Make a mini WinXP VHD disk image.
  2. Directly load the image from file.
  3. Map and load the image to RAM.

Steps in detail :

1. Make a vhd disk image include a mini winxp installation.
This step suppose that you have already known how to make an winxplite-iso disc. Read here for more detail : http://www.alychidesigns.com/nlite-for-windows-xp/
After you got the winxplite-iso disc, we need a temporarily space to hold the winxp installation before copying its content to a minimal size disk image. Create a new virtual machine and mount the winxplite-iso disc and install as usual. After finishing installation, you need to :
  • Remove page-file.
  • Update some devices to use standard driver.
  • Install winVblock driver.
Run Windows XP in Ram Memory
Windows XP Ram Memory Windows XP Ram Memory
And we have a minimal winxp (about 400MB before compress), but the whole disk is still too big for putting in ram. 2GB for this case.
Next, we need to make the disk smaller by copying the whole winxp content to a new minimal disk image. To take this task you need a another machine which already have a running winxp (you can clone the first machine), this machine will act as the temporarily environment used for copying the winxplite to a new minimal vhd disk.
Create a new vhd with small size (about 350MB – fixed size vhd of course) and attach it to the temporarily machine.
Windows XP Ram Memory Windows XP Ram Memory
Boot the machine, it will regconize the new 350MB disk. Format it with NTFS, check to enable NTFS compression, mark it active.
Windows XP Ram Memory Windows XP Ram Memory
Suppose that the new disk 350MB has been mounted as drive E. Copy all the files (maybe ignore the Recycler and System Volume Information) from disk WinXPLite\ to drive E:\. Notice that drive E has been enable NTFS compression for saving space. NTLDR can not work on a compression disk, so you need to uncompress the file ntldr.
Windows XP Ram Memory Windows XP Ram Memory
Now, we have a mini-winxp in a minisize disk image (240MB content after compression in a 350MB disk image). Next we need to make it bootable by using bootsect.exe /nt52. Then have a disk defragment on it.
Windows XP Ram Memory Windows XP Ram Memory
Locate the file and copy it to a bootable USB disk (which installed grub4dos).
Windows XP Ram Memory Windows XP Ram Memory
2. Directly load the image from file.
Boot the usb disk and directly load the vhd image (boot to file). Notice to see the memory after booting. In this case we used a 2GB RAM machine. Because we booted to file, so there was no changes with the memory size. In device manager, there will be a new winVblock disk appears.
Grub4dos# Map …
See Grub4dos Manual for option boot detail.

Windows XP Ram Memory Windows XP Ram Memory Windows XP Ram Memory
3. Map and load the image to RAM.
Now we use grub4dos with option –mem to load the image into RAM. Notice the memory will be decrease an amount equal to the size of the disk image. In this case it would be about 350MB.

Windows XP Ram MemoryWindows XP Ram MemoryWindows XP Ram Memory

So, we’ve done for booting and running winxp in ram memory.
Hints and Tricks :
  • Using NTFS compression for saving more space.
  • If your PC has a lot amount of RAM, you can boot the full winxp in to RAM without using nlite to slimdown the winxp source.

Screencast video :

-End of post-
Using NLite for Windows XP Minimal Size

Using NLite for Windows XP Minimal Size

nlite for windows xp

Objective :
In normal circumstance, after installing, a full version of windows xp takes around 1GB (after turn off paging file) hard disk space. Windows XP has been shipped with alot of components which maybe you don’t need and maybe never use them like : support for netware network, transmeta cpu, netmeeting, help and supports, driver and dll caches, …

While alot of people want to run winxp in minimal space environment like usb disk or ram disk, it’s a good idea to remove those un-needed components and just leave the most needed components stay.

This post will show you how to reduce winxp size with the nLite tool – a very popular tool to slimdown winxp.

Requirement :

  • Windows XP installation disc or iso image file.
  • Harddisk free space about 500MB to store temporily file copied from the installation disc.
  • nLite tool

Steps in detail :

Download and install nLite to your PC and follow the wizard to finish. Some notice and screenshot :Select task and fill the information for unattend installation mode.

using nlite nlite windows xp
You can select which components should be removed. If you dont know some what component is used for, just leave it.
The hint is removing all but leave for the red color 🙂
nlite windows xp
Processing all task and at last we need to create a bootable iso image.

minimal windows xp
minimal windows xp
You can burn the iso image to a cdrom disc and install winxp as usual.
You can also use the iso image without burning it by using a Virtual Machine Management like VirtualBox.
After installing and turn off the page-file, the nlite-winxp just takes about 400MB. Very suitable to run on USB disk or in RAM ! Awesome.
windows xp minimal

How to Protect your Mac from Viruses

The Mac OS was said to be the safest in the world when they first hit the market. There were no harmful applications or scripts coded for them, not to mention about the advanced technologies used by Apple. For quite a lot of time, they maintained their safety status at high standards. Today, things have not changed too much, except for one thing – the apparition of malicious scripts.
Protect your Mac from Viruses

The rise of the problem

The whole madness began in the autumn of 2008, when Apple made a very important announcement. It seems the Apple products did require an antivirus protection, since new scripts that could be potentially harmful have been found floating around the Internet. The announcement was quite subtle, so a lot of people have no clue what they need. Assuming that most Mac users are usually brighter and more advanced than the average Windows users, thinking about some protection measures is definitely a must.
Today, after about four years since that announcement, it seems there are not less than three hundred harmful applications that can affect Mac OS. The number is insignificant compared to the viruses for Windows – more than a million. With all these, they can be just as harmful. Many of them are designed by experts under legal circumstances, as concepts or to develop protective applications. With all these, there are problematic scripts too.
Some of them may intercept e-banking transactions, while others may give a hacker full control over your computer. The risks to encounter such an application are definitely smaller compared to what the Windows users have to go through, but this is not a very encouraging aspect.
You still have a few risks you expose yourself to without protective software and since preventing a problem is definitely better than solving it, it is mandatory to get something for the protection of your unit too.

How viruses get to your system

There are a series of facts that support the implementation of protective measures for the Mac users. First of all, it is no longer an assumption, but a fact that new malware scripts are written and spread around on a regular basis. Some names are more popular than others. OSX Jahlav is a trojan hidden in website source codes. Once a user visits that website, it is downloaded and installed immediately, without actually harming the Windows users. Other than that, Troj RKOSX creates backdoors for hackers to take control over your device. Whether they check out your e-mail, personal files or e-banking sessions, any of these issues can cause a lot of trouble.
New such threats are found on a regular basis and although Apple makes high efforts to prevent them through the regular updates, it is almost impossible to do it. Since the trends change, the same goes for the hacking world. Such concepts can and will infect your computer, no matter how safe you think it is.

How safe are Macs?

Mac systems are clearly safer compared to other operating systems, but they are still very vulnerable. They are not invincible. You may not care too much when it comes to your personal computer. If you visit trusted websites only and you don’t accept any files from unknown addresses or individual, you probably think that you are safe. But doing a simple web search and checking out the results can easily harm your computer.
Things are even more complicated when it comes to businesses or companies, regardless of their size. An employee checking his e-mail may infect his computer and spread the script through your entire network, causing severe damage. Such risks can only be avoided through decent antivirus software.

Take these steps to have a safer Mac

Keep up on latest updates:

As you know, everyday new threats are discovered on the web, new security issues are found, and lots of new security fixes and updates are issued for different softwares and applications. So the best advice is to use available online (and even offline) sources to keep up on updates for any software you have on your system, and install updates/fixes immediately.

Use good passwords:

Depending on the services you use on the internet, use appropriate passwords so that they’re not guessable by others. Password Assistant in Keychain Access could help you in this matter.

Never open unknown attachments or links in your email messages:

That’s because most of the times, the links are to phishing websites which seek your confidential information, and attachments lead to malicious softwares being installed on your system without your knowledge.

Install firewall and antivirus software as well as a Mac Cleaner Software:

Don’t rely only on the built-in firewall included in OS X by Apple, as there are many better ones in the market. And think of an antivirus as an insurance policy that you may never need to use it, but if someday something happens you don’t regret having it.

Another good idea it to  make regular use of the best Mac Cleaner Software you can find on the market. This does not have to be the most expensive software, but one that is highly rated and reviewed should suit you well. On the other side of things, you will also be able to keep your Mac running smoothly and efficiently while are the same time protecting your data.

How to Create Windows XP Install to USB

How to Create Windows XP Install to USB

Create Windows XP Install USB
Objective :
Winxp is really a good member of windows family. It is maybe the most common version of windows has ever used until now.
This post will show you how to put a full winxp on usb disk to use it anywhere.
Requirement :
  • Ability to use some VirtualMachine Management like VirtualBox, VMware, …
  • Good knowledge at using Winxp.
Terminology :
  • Vhd file : It looks like an image of a disk (and partitions) inside.
  • WinVBlock : Virtual scsi driver for Winxp to mount vhd disk image.
  • NTloader  : Boot loader of Windows works with ntldr file.
  • Grub4Dos  : Boot loader used to map vhd disk image file.
Primary steps :
  1. Create .vhd disk image includes a running Winxp (with WinVblock driver installed).
  2. Make USB disk bootable with NTloader and Grub4Dos.
  3. Boot the image by Grub4Dos.

Steps in detail :

1. Create .vhd disk image includes Winxp (with WinVblock driver installed)

1.1 Create New Machine :
In this post we will use VirtualBox to make an Winxp virtual machine with vhd disk image (fixed-size harddisk) (2GB for example) in vhd format. Notice to use fixed-size hard disk, otherwise Grub4Dos won’t work !
Create Windows XP Install USB
Create Windows XP Install USBCreate Windows XP Install USB

Point the CDROM drive to an Winxp installation disc (.iso), and install it as usual till it finishes

install windows xp to usb drive
1.2 Disable Page File :
By default Winxp uses a page-file (double RAM size) on the C: drive, it takes alot of disk space. We don’t need it, so we will remove it, and a full Winxp will takes about 900MB in size.
install windows xp to usb drive
install windows xp to usb drive
1.3 Config the Winxp driver to make it works on all machine :
Because our Winxp will run on USB disk, we need to make it able to run on all of different machine without depend on the driver (independent with driver) by making some devices using Standard Driver.
Open the Device Manger and update : IDE ATA/ATAPI Controllers and System Devices to use Standard driver. In this case, they should use :
  • IDE ATA/ATAPI Controller :
    • Standard Dual Channel PCI IDE Controller.
  • System Devices :
    • PCI bus.
    • PCI standard host CPU bridge.
    • PCI standard ISA bridge.
install windows xp onto usbinstall windows xp onto usbinstall windows xp on usb
Reboot the virtual machine if necessary, and you should have a status like this after all :
install windows xp on usb
1.4 Install WinVblock driver :
Google and download the WinVblock driver, unzip it. Open Control Panel / Add Hardware. Follow the Wizard and point it to the WinVblock driver folder.
After reboot the Winxp vitual machine, It should have 2 more scsi devices like this.

install windows xp on usbinstall windows xp to usb
1.5 Defragment the C: drive :
In order to boot with Grub4Dos (map to file), the image file need to be in contiguous disk area.
Just have a check if the C: drive has been fragmented ? If does, open the My Computer, right click on C: drive / Properties / Tools / Defragment Now …
install windows xp to usb
1.6 Locate the vhd file :
Until now, you should have a running Winxp virtual machine includes :
  • WinVBlock driver.
  • Some devices with Standard driver (IDE controller and system devices)
  • C: drive not fragmented.
Shutdown the virtual machine and locate for the .vhd file (check the Preferences of VirtualBox to find out the default location).

install windows xp to usb

2. Make USB disk bootable with NTloader and Grub4Dos

2.1 Format the USB :
You need an USB disk larger than the disk image (4GB in this post). Format it with NTFS filesystem or FAT32 (make sure to backup it first !!!)
install windows xp to usb
2.2 Make the USB disk bootable :
After format, suppose it has been mounted as D: drive. We will make it bootable by :
  • Make it as active partition (open Disk Management and right click / Set Active).
  • Copy from C: drive these files (maybe you need to set Folder Options to show all hidden file) : ntldrntdetect.comboot.ini.
  • Search and download the Grub4Dos tool. Unzip it. Copy these files to the USB (D: drive) : grldrgrldr.mbr
install windows xp to usbinstall windows xp to usb
Now you need to place the ntloader bootcode onto the MBR of the USB disk. You will need the bootsect.exe tool (search for it in the WinVista or Win7 installation disc, or google for download it … ), copy it to the C: drive. Then execute the command :
c:\bootsect.exe /nt52 d: /force
Now the USB disk can bootable, next we need to point NTLoader to load Grub4Dos. Edit the boot.ini file :
[boot loader]
[operating systems]

Save the boot.ini file.

Let’s restart the PC and boot from USB disk. The NTloader will load Grub4Dos according to the boot.ini file.install xp to usbinstall xp to usb
So, we now have the USB disk bootable according to :
  • Primary Active partition.
  • NTloader in the MBR : ntldr, ntdetect.com, boot.ini
  • Grub4Dos at second stage : grldr, grldr.mbr

3. Boot the image by Grub4Dos.

3.1 Copy the vhd disk image to USB disk :
Restart the PC and copy the vhd image file (has been located at 1.6 step) to the USB disk. You should rename it from “winxp full.vhd” to “winxpfull.vhd” to kill the blank space.
install windows xp to flash drive
3.2 Boot the disk image :
Reboot the PC and boot from USB disk, when Grub4Dos has been loaded, choose the command line menu. Enter these commands to load the WinXP image :
map (hd0,0)/winxpfull.vhd (hd0)
map --hook
chainloader (hd0,0)/ntldr
install windows xp to flash drive
and the WinXP image will be loaded as usual … When done, you will see the disk image has been mounted as C: drive and the USB disk as D: drive. In Device Manager there also have a WinVblock disk appears under the Disk drive entry.
install windows xp on flash driveinstall windows xp on flash drive
so we’ve almost done.
3.3 Create Grub4Dos menu entry : 
Now we will create a menu entry for auto loading the image instead of manually typing the commands. On the USB disk (D: drive), create a text file named D:\menu.lst with the content :
timeout 5
default 0
title Boot to Winxp.vhd
map (hd0,0)/winxpfull.vhd (hd0)
map --hook
chainloader (hd0,0)/ntldr

Reboot the PC and boot from USB to see the result :

install windows xp on usb driveinstall windows xp on usb drive
So, we have done for a full Winxp running in USB disk. You can try it on different PC to see the result.

Video :

Known issue :

  • Not contiguous image file : You need to defragement the image file before load it.
  • Boot hang on new machine with SATA/AHCI controllers : Enter BIOS and switch the SATA/AHCI controller to use Compatible/Legacy mode.

Easy Troubleshooting 500 Internal Server Error Linux [Fix]

I am here again with a new topic and most common error while transferring from one server to another server or after uploading new files. The 500 Internal Server Error Linux is mainly due to conflict of user permissions as well as user ownership. Mostly after moving files from one linux server to another server, first thing which we encounter is internal server error. For new comers, making transfer for the first time, it is like a huge issue and often take hours to take back site live.

In my start of Linux, I moved a server and then browsed internet for hours to find the cause of apache internal server error, after hours of Googling, I finally found a solution and now I want to share this with you. If you have moved to a new server or even if you have just uploaded new files or testing a new project 500 Internal Server Error is nothing more or less than ownership conflict or permissions error.

For most of the projects like wordpress, MyBB or other CMS, required permissions for files are 644 and folder permissions are 755. If you have just moved or want to clear refresh permission messed up, below 2 command will do all your task in just couple of seconds.

  1. 1- Change Directory Permission Recursively

# find \path-to-root-directory\ -type d -exec chmod 755 {} \ ;

This above command will change all directories after that path permissions to 755 which is most required for all sort of CMS unless otherwise specifically stated.

2- Change Files Permission Recursively

# find \path-to-root-directory\ -type f -exec chmod 664 {} \ ;

This command will change all files permission in the root directory and in sub directories to 664 which is required for all projects.

Now you have to check ownership of the files and folders. Normally when we configure server without any control panel, we need to have file ownership of all files and folders required to be served via web server to apache & group apache. Don’t worry about the number of files and folders, I am going to provide you a simple command which will change ownership of all files and folders in just few seconds. You don’t need to run command for ownership change on all files individually.

1- Change of Ownership of Files

# chown -R user:group /foldername

In above code you will replace user with apache and group with apache if you have configured Apache web server. If you are using cPanel or anyother control panel than you have to set your cPanel username as user and group. This command will change all ownership of files and folder including sub folders and files.

Now test your website and it will not be having 500 Internal server error anymore. If you want to verify whether all permissions & ownership of files & folder are changed. Just run the command given below in any folder and it will give you list of all files and in that folder along with their permissions and ownership plus group.

If you are still facing any issue or having problem in executing above commands, use comment section or contact me for further information & help.

How to Upgrade MySQL 5.1. to 5.5 Latest Version on CentOS

Today, I came up with a simple solution to update MySQL from version 5.1 to latest version 5.5. If you are importing database MySQL and getting error about # 1273 Unknown Collation or having other issues while moving from one server to another and need to upgrade MySQL than go through solution provided below. Some simple SSH commands will do all for you.

First of all confirm that you are using older version of MySQL by command given below.

# mysqladmin -u root -p version

Enter the password on prompt and you will get current MySQL version.

Remove Old MySQL:

First of all we will remove old mysql installed in order to install new and latest version. There is no option like upgrade database version, you can have to remove old version and then install latest version. Please take backup of all your database with you which could be recovered if anything went wrong.

# yum remove mysql mysql-*

Add Remi Dependency on CentOS 6.x:

Add following dependencies required to installation of MySQL 5.5 . Commands are as below.

# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Install MySQL 5.5:

Now its time to install MySQL 5.5. Use the commands provided below.

# yum –enablerepo=remi,remi-test install -y mysql mysql-server
Now MySQL 5.5 is installed on your server. Now start MySQL with command.

# service mysql restart

Upgrade MySQL Database Final Step:

Final step for upgrading database is as below.

# mysql_upgrade -u root -p

Enter password on prompt and you are done with it.

Note: Some of the users face issue with PHP so we recommend installing php-mysql.

# yum -y install php-mysql

1 of 140