[SOLVED] Flush(), ob_flush() not working in PHP (Disabling gzip through htaccess)

Flushing the output buffer doesn’t works in PHP sometimes no matter what you do. I had this code which would never work on my server but would perfectly fine on localhost. This was the code.

<?php
include('common.php');
ini_set('output_buffering','on');
ini_set('zlib.output_compression', 0);
//ini_set('implicit_flush',1);
ob_implicit_flush();
for($i=0;$i<10;$i++) {
      echo $i;
      echo str_repeat(" ", 500);
      ob_flush();
      flush();
      sleep(1);
}
?>


I knew this had to do with Server configuration as the php code was fine. Then after searching a lot I stumbled across a page where it said that my host had recently enabled gzip for all pages, I instantly knew this was the problem.

So I made a .htaccess file in the folder where this script was and entered the following:

SetEnv no-gzip dont-vary

Saved the file. And it started buffering.

Cheers!

[HOW-TO] Restore recovery partition on Asus 1005HA

A friend of mine who has Asus 1005HA deleted his recovery partition to free up disk-space. He didn’t knew what the consequences could be. He felt the need of recovery just few days after it and he realised that he couldn’t use the recovery mode anymore. He gave me his netbook. It took me a while to figure out how to restore the partition.

What you require:

Another computer with DVD drive
USB flash drive (minimum 1GB) and another USB flash/hard drive(minimum 4.5GB)
PEtoUSB
ISO extraction software (winrar/7zip)
Any linux distro

Once you are setup with the requirements, follow these steps to restore:

    • Extract WINPE.iso to any folder on harddrive on second computer. Suppose this folder is D:\WINPE
    • Edit D:\WINPE\I386\SYSTEM32\WINPESHL.INI:

Change:
AppPath=x:\EPCRecover.exe
To:
AppPath=x:\GHOST32.EXE

    • Insert pendrive in the computer, and use PEtoUSB to make pendrive bootable. In Vista and Win7 please use admin mode.

Check ‘USB Removable’, and select the pen-drive.
Check ‘Enable Disk Format’.
Source Path To Built BartPE/WinPE Files: D:\WINPE
Check ‘Enable File Copy’ and select ‘Overwrite Always

    • Copy \Recovery\envir.GHO and \RECOVERY\envir.cmd from DVD to the root of your pen drive.
    • Convert your Pen-drive filesystem from FAT32 to NTFS by executing the following command in command-line:

convert x: /fs:ntfs
//change x to your pen-drive letter.

    • Disable the boot-booster on your 1005HA by pressing F2 two times as soon as you switch it on and disable it in BIOS.
    • Insert the pen-drive on 1005HA and press Esc repeatedly on bootup and select the flash drive to boot from. You’ll get into WINPE environment and Norton Ghost will start. Select to disk, from image and select envir.gho. This will repartition your complete hard-drive as it was when you purchased. Please note that this will destroy any data on your hard-drive. Make sure you back-up your data before doing this.
    • Download a linux distribution which recognises NTFS partitions. Use unetbootin to make the distribution USB bootable. Boot into live mode. I recommend Uubntu NBR for the purpose. Mount the partition labeled ‘PE’, this is your recovery partition.
    • On second computer copy \Recovery from the DVD to a larger pen-drive/hard-drive. Connect this drive to 1005HA and copy all the contents in \Recovery from your pen-drive to root of PE.
    • You can also edit the WINPESHL.INI to look like this:

AppPath = x:\minint\system32\recover.exe

This is it. Restart your computer.

Cheers!!

Guitar Pro alternative in Ubuntu

I am a big guitar freak. I play guitar all the time. A good friend for guitar learners is Guitar Pro on windows. Guitar pro is basically a tool which shows musical notations, plays them, show the notation on guitar tabs, change tempo etc. It helps beginners a lot.

Today, I felt the need to use it again, but I didn’t want to logon to windows for doing that. I knew there had to be an alternative in Ubuntu (Geeks play guitar too :D). Fortunately, I found two packages in repos which could work similar and better than guitar pro. Best of all, they are free.

To install them, type the following in terminal:

For tuxguitar:

$ sudo apt-get install tuxguitar

For kguitar (It is for Kubuntu/KDE users):

$ sudo apt-get install kguitar

I found tuxguitar to be more feature-rich and bug free. Try ’em both to see what suits you.

Cheers!