Saturday, February 26, 2011

Funny Linux Quotes

50. I develop for Linux for a living, I used to develop for DOS.
Going from DOS to Linux is like trading a glider for an F117.
-- Lawrence Foard, entropy@world.std.com

49. Avoid the Gates of Hell. Use Linux.
-- unknown source

48. I've run DOOM more in the last few days than I have the last few
months. I just love debugging ;-)
(Linus Torvalds)

47. By golly, I'm beginning to think Linux really *is* the best thing since
sliced bread.
-- Vance Petree, Virginia Power

46. Linux poses a real challenge for those with a taste for late-night
hacking (and/or conversations with God).
-- Matt Welsh

45. Linux is obsolete.
-- Andrew Tanenbaum

44. Your job is being a professor and researcher: That's one hell of a good excuse for some of the brain-damages of minix. (Linus Torvalds to Andrew Tanenbaum)

43. I still maintain the point that designing a monolithic kernel in 1991 is a fundamental error. Be thankful you are not my student. You would not get a high grade for such a design :-) (Andrew Tanenbaum to Linus Torvalds)

42. We all know Linux is great... it does infinite loops in 5 seconds.
- Linus Torvalds about the superiority of Linux on the Amterdam Linux Symposium

41. People disagree with me. I just ignore them.
(Linus Torvalds, regarding the use of C++ for the Linux kernel.)

40. Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen an angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had.
-- Linus Torvalds, announcing Linux v2.0

39. Other than the fact Linux has a cool name, could someone explain why should use Linux over BSD?

38. “How should I know if it works? That's what beta testers are for. I only coded it." (Attributed to Linus Torvalds, somewhere in a posting)

37. "Problem solving under linux has never been the circus that it is under AIX." (By Pete Ehlke in comp.unix.aix)

36. "Besides, I think Slackware sounds better than 'Microsoft,' don't you?" (By Patrick Volkerding)

35. "And the next time you consider complaining that running Lucid Emacs 19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to get the background colors right, you'll know who to thank." (By Matt Welsh)

34. "...Deep Hack Mode--that mysterious and frightening state of consciousness where Mortal Users fear to tread." (By Matt Welsh)

33. Sigh. I like to think it's just the Linux people who want to be on the "leading edge" so bad they walk right off the precipice. (Craig E. Groeschel)

32. Microsoft Corp., concerned by the growing popularity of the free 32-bit operating system for Intel systems, Linux, has employed a number of top programmers from the underground world of virus development. Bill Gates stated yesterday: "World domination, fast -- it's either us or Linus". Mr. Torvalds was unavailable for comment ... (rjm@swift.eng.ox.ac.uk (Robert Manners), in comp.os.linux.setup)

31. Who wants to remember that escape-x-alt-control-left shift-b puts you into super-edit-debug-compile mode? (Discussion in comp.os.linux.misc on the intuitiveness of commands, especially Emacs.)

30. It's a bird.. It's a plane.. No, it's KernelMan, faster than a speeding bullet, to your rescue. Doing new kernel versions in under 5 seconds flat.. (Linus, in the announcement for 1.3.27)

29. Those who don't understand Linux are doomed to reinvent it, poorly. (Unidentified source.)

28. "How do you power off this machine?" (Linus, when upgrading linux.cs.helsinki.fi, and after using the machine for several months.)

27. I've discovered that using VMS is a lot like driving a nail with your head: sure, you eventually get something practical done, but it usually results in a headache and some blood loss.
(submitted by Sean A. Simpson)

26. "... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed." - Unix for Dummies, 2nd Edition (Found in the .sig of Rob Riggs)

25. If Bill Gates is the Devil then Linus Torvalds must be the Messiah. (Unknown source)

24. LILO, you've got me on my knees!
(from David Black, dblack@pilot.njin.net, with apologies to Derek and the
Dominos, and Werner Almsberger)

23. Anyone can build a fast processor. The trick is to build a fast system. (Seymour Cray)

22. We can use symlinks of course... syslogd would be a symlink to syslogp and ftpd and ircd would be linked to ftpp and ircp... and of course the point-to-point protocal paenguin. (Kevin M. Bealer, commenting on the penguin Linux logo.)

21. A multithreaded file system is only a performance hack. (Andrew Tanenbaum to Linus Torvalds)

20. I did this 'cause Linux gives me a woody. It doesn't generate revenue. (Dave '-ddt->` Taylor, announcing DOOM for Linux)

19. This message was brought to you by Linux, the free unix. Windows without the X is like making love without a partner. Sex, Drugs & Linux Rules win-nt from the people who invented edlin apples have meant trouble since eden Linux, the way to get rid of boot viruses. (By mwikholm@at8.abo.fi, MaDsen Wikholm)

18. Be warned that typing killall name may not have the desired effect on non-Linux systems, especially when done by a privileged user.
-- From the killall manual page

17. Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it. "
--- Linus Torvalds

16. Linux is not user-friendly. It _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
---Source unknown

15. `When you say "I wrote a program that crashed Windows", people just stare at you blankly and say "Hey, I got those with the system, *for free*".' (By Linus Torvalds)

14. "If you want to travel around the world and be invited to speak at a lot of different places, just write a Unix operating system." (By Linus Torvalds)

13. "Are Linux users lemmings collectively jumping off of the cliff of reliable, well-engineered commercial software?" (By Matt Welsh)

12. "Linux: the operating system with a CLUE... Command Line User Environment". (seen in a posting in comp.software.testing)

11. “See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too.” (By Linus Torvalds)

10. "What happens when you read some doc and either it doesn't answer your question or is demonstrably wrong? In Linux, you say "Linux sucks" and go read the code. In Windows/Oracle/etc you say "Windows sucks" and start banging your head against the wall."
--- Denis Vlasenko on lkml

9. "...you might as well skip the Xmas celebration completely, and instead sit in front of your linux computer playing with the all-new-and-improved linux kernel version." (By Linus Torvalds)

8. Linux hackers are funny people: They count the time in patchlevels. (Seen in the .sig of Gerd Knorr.)

7. Linux: the choice of a GNU generation
-- ksh@cis.ufl.edu put this on Tshirts in '93\

6. "Not me, guys. I read the Bash man page each day like a Jehovah's Witness reads the Bible. No wait, the Bash man page IS the bible. Excuse me..."
(More on confusing aliases, taken from comp.os.linux.misc)

5. What's this script do?
unzip ; touch ; finger ; mount ; gasp ; yes ; umount ; sleep
Hint for the answer: not everything is computer-oriented. Sometimes you're
in a sleeping bag, camping out with your girlfriend.
(Contributed by Frans van der Zande.)

4. I'm an idiot.. At least this [bug] took about 5 minutes to find.. Surely, Linus is talking about the kind of idiocy that others aspire to :-)
(Bruce Perens in response to Linus Torvalds's mailing about a kernel bug.)

3. One OS to rule them all,
One OS to find them.
One OS to call them all,
And in salvation bind them.
In the bright land of Linux,
Where the hackers play.
(J. Scott Thayer, with apologies to J.R.R.T.)

2. ...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it. (by Linus)

1. We are using Linux daily to UP our productivity - so UP yours!
-- Adapted from Pat Paulsen by Joe Sloan


Source:http://www.junauza.com/2008/01/top-50-linux-quotes-of-all-time.html 

Funny quotes on technology


"If at first you don't succeed; call it version 1.0"

"The Internet: where men are men, women are men, and children are FBI agents."

"Some things Man was never meant to know. For everything else, there's Google."

"unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep" - my daily unix command list

"... one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." - Robert Firth

"If Python is executable pseudocode, then perl is executable line noise."

"The more I C, the less I see."


"To err is human... to really foul up requires the root password."

"After Perl everything else is just assembly language."

"If brute force doesn't solve your problems, then you aren't using enough."

"Life would be so much easier if we only had the source code."


"Unix is user-friendly. It's just very selective about who its friends are."

"COBOL programmers understand why women hate periods."

“Programming is like sex, one mistake and you have to support it for the rest of your life.” — Michael Sinz

"There are 10 types of people in the world: those who understand binary, and those who don't."

"640K ought to be enough for anybody." - This is not humorous by itself; but in the context it's a classic by Bill Gates in 1981

Microsoft: "You've got questions. We've got dancing paperclips."

"Microsoft is not the answer. Microsoft is the question. NO is the answer." - Erik Naggum

"Men are from Mars. Women are from Venus. Computers are from hell."

"SUPERCOMPUTER: what it sounded like before you bought it."

"Windows95: It's like upgrading from Reagan to Bush.

"People say Microsoft paid 14M$ for using the Rolling Stones song 'Start me up' in their commercials. This is wrong. Microsoft payed 14M$ only for a part of the song. For instance, they didn't use the line 'You'll make a grown man cry'."

"I'm not anti-social; I'm just not user friendly"

"A printer consists of three main parts: the case, the jammed paper tray and the blinking red light"

"The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2."

"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"

"1f u c4n r34d th1s u r34lly n33d t0 g37 l41d"

"To go forward, you must backup."

"I would love to change the world, but they won't give me the source code"

"A Windows user spends 1/3 of his life sleeping, 1/3 working, 1/3 waiting."

"My software never has bugs. It just develops random features."

"Better to be a geek than an idiot."

"Windows isn't a virus, viruses do something."

"Geek's favorite pickup line: Hey, does this rag smell like chloroform? "

"Be nice to geeks when you're in school, you might end-up working for one when you grow-up."

"Difference between a virus and windows ? Viruses rarely fail."

"Evolution is God's way of issuing upgrades."

"The only problem with troubleshooting is that sometimes trouble shoots back."

"It's a little-known fact that the Y1K problem caused the Dark Ages."

"The box said 'Required Windows 95 or better'. So, I installed LINUX."

"Computer are like air conditioners: they stop working when you open windows."

"once upon a midnight dreary, while i pron surfed, weak and weary,
over many a strange and spurious site of 'hot xxx galore'.
While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour,
" 'Tis not possible!", i muttered, "give me back my free hardcore!"
quoth the server, 404."

"Mac users swear by their Mac,
PC users swear at their PC."

"Like car accidents, most hardware problems are due to driver error."

"Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end."


"Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies." - Linus Torvalds

"There are 10 kinds of people in the world, those that understand trinary, those that don't, and those that confuse it with binary."

"If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime."

"It is easier to change the specification to fit the program than vice versa."

"I had a fortune cookie the other day and it said: 'Outlook not so good'. I said: 'Sure, but Microsoft ships it anyway'."

"The nice thing about standards is that there are so many to choose from."

"The term reboot comes from the middle age (before computers). Horses who stopped in mid-stride required a boot to the rear to start again. Thus the term to rear-boot, later abbreviated into reboot."

"Programmers are tools for converting caffeine into code."


"The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones."


"Hacking is like sex. You get in, you get out, and hope that you didn't leave something that can be traced back to you."



Source:http://linuxshellaccount.blogspot.com/2009/04/funny-unix-and-linux-quotes.html

Integrating PHP 5.x with IIS part 2



Introduction



This article explains how to use the Microsoft IIS FastCGI extension to set up and run PHP applications on Windows XP and Windows Server® 2003 operating systems.

What is FastCGI?

FastCGI is a standard protocol that allows the CGI executable files for application frameworks to interface with the Web server. It differs from the standard CGI protocol in that FastCGI reuses CGI processes for multiple requests, which provides a significant performance boost as compared to CGI. Support for IIS FastCGI enables IIS to host normal CGI programs like PHP or Ruby on Rails by using the FastCGI protocol, and to offer high performance and stability for production deployment of such application frameworks.
Using the IIS FastCGI support includes the following:
  • IIS Web server
  • IIS FastCGI extension
  • CGI program (such as php-cgi.exe)
The Web server dispatches HTTP requests to your application to the FastCGI component, which in turn launches the CGI program executable, and forwards the request for processing. Once the request is finished and the response is returned back to the server and sent to the client, the CGI process is reused for a subsequent request. This helps to avoid the high performance penalty of starting a new process for each request, which results in better performance and scalability in a production environment.
To learn more about the FastCGI protocol, see http://www.fastcgi.com/devkit/doc/fcgi-spec.html.

Install the FastCGI Extension for IIS 6.0 and IIS 5.1

You can download the FastCGI extension for 32-bit and 64-bit Windows XP and Windows Server 2003 here:
http://www.iis.net/extensions/fastcgi
When you run the FastCGI installer, it copies FastCGI-specific files to the "%windir%\system32\inetsrv" folder, and then registers and enables the FastCGI Web server extension. Of the files that the installer copies, note the following:
  • fcgiext.dll – This is the actual FastCGI handler that communicates with FastCGI-enabled processes for processing requests.
  • fcgiext.ini – This is the configuration file that contains the mapping of file extensions to FastCGI processes. It also contains the configuration of FastCGI process pools.
  • fcgiconfig.js – This configures the FastCGI extension. The script updates the fcgiext.ini file, modifies the IIS metabase and recycles the Web service application pools if necessary.

Download and Install PHP

The FastCGI extension is fully compatible with the current official PHP 4.4.x and PHP 5.x distribution for Windows, available from http://windows.php.net/download. Since the FastCGI extension hosts and executes php processes in a single threaded manner, it is recommended that you download and install the non-thread-safe PHP build that is available for Windows. The non-thread-safe PHP build provides a performance boost from a lack of thread safety that is acceptable for a single-concurrency environment like FastCGI.

Configure the FastCGI Extension to Work with PHP

Once PHP is installed on Windows, you have two options to configure FastCGI: use the configuration script that is provided with the installation of the FastCGI extension, or perform all the configuration tasks manually by modifying IIS configuration settings and the fcgiext.ini file.

Configure the FastCGI Extension to Work with PHP by Using the Configuration Script

The configuration script with the name fcgconfig.js is provided with the installation of the FastCGI extension. It is located in %windir%\system32\inetsrv.
To configure the FastCGI extension to work with PHP:
  1. Open a command prompt.
  2. Change the current directory to %windir%\system32\inetsrv.
  3. Register the PHP CGI program as the one that will be processing .php extensions by running the following configuration script:
cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe"
Replace C:\PHP\php-cgi.exe with the path to php-cgi.exe if you installed to a directory other than C:\PHP.
Note: If you do not want to register the PHP extension to be processed by the FastCGI component on your entire server, and only want to register it for a specific Web site, add a "–site:[siteId]" argument, for example:
cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe" –site:1
Note: For a complete list of configuration parameters that are supported by the FastCGI extension, see the FastCGI extension documentation.

Manually Configure the FastCGI Extension to Work with PHP

To manually configure the IIS and FastCGI extension, you must create script mappings for the PHP extension in the IIS metabase, and modify the fcgiext.ini file that is located in %windir%\system32\inetsrv.
To create script mapping:
  1. Launch inetmgr.exe.
  2. Double-click the machine icon for the local computer.
  3. Right-click Web Sites and click Properties.
  4. Click the Home Directory tab. 
  5. Click the Configuration… button.
  6. Click the Add… button.
  7. In the Add/Edit Application Extension Mapping dialog box, click Browse.... Navigate to the fcgiext.dll file that is located in %windir%\system32\inetsrv.  
Note: If you need to use FastCGI in 32-bit mode on a 64-bit machine, navigate to %windir%\SysWOW64\inetsrv.
    8.  In the Extension text box, enter .php.
    9.  Under Verbs, in the Limit to text box, enter GET,HEAD,POST.
  10.  Ensure that the Script engine and Verify that file exists check boxes are selected.









11.  Click OK.


To modify the fcigext.ini file:
Once the script mapping has been added, modify the fcgiext.ini file.
  1. Add an extension to application mapping (php=PHP) to the [Types] section.
  2. Add a [PHP] section with ExePath=c:\php\php-cgi.exe (assuming you installed PHP files to the C:\PHP folder).
[Types]

…

php=PHP

…

 

[PHP]

ExePath=c:\php\php-cgi.exe
3. After you save the changes to the fcgiext.ini file, restart the application pool that is associated with the Web site that hosts your PHP applications.
To configure a default document in IIS:
Most PHP applications use a file named index.php as the default application document. Configure IIS to treat this file as the default content page.
  1. Launch inetmgr.exe.
  2. Double-click the machine icon for the local computer.
  3. Right-click Web Sites and click Properties.
  4. Click the Documents tab.
  5. Click the Add… button.
  6. In the Add Content Page dialog box, in the Default content page text box, enter index.php
  7. Click OK







Set the FastCGI Configuration for Optimal Functionality, Security, and Performance with PHP

IIS focuses on full PHP functionality support and performance of PHP applications that are running on the FastCGI extension. In collaboration with Zend Technologies, IIS identified the set of configuration settings for the FastCGI extension and PHP that would provide optimal functionality and performance for PHP applications when running on Windows by using the FastCGI extension.
To obtain optimal functionality and performance, configure your server as follows:
    1.  Modify the php.ini file as follows:
  • Set fastcgi.impersonate = 1. FastCGI under IIS supports the ability to impersonate the security tokens of the calling client. This allows IIS to define the security context under which the request runs.
  • Set cgi.fix_pathinfo=1. cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. Previously, PHP behavior was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not define PATH_INFO. For more information about PATH_INFO, see the cgi specifications. Setting this value to 1 will cause PHP CGI to fix its paths to conform to the specification.
  • Set cgi.force_redirect = 0.
    2.  Set the FastCGI configuration settings for the PHP section by running fcgiconfig.js as follows:
  • Set the FastCGI process pool property InstanceMaxRequests to 10000. This setting specifies that the FastCGI extension will recycle php-cgi.exe after it has processed 10000 requests successfully.
> cscript fcgiconfig.js -set -section:"PHP" -InstanceMaxRequests:10000
    3.  Configure the FastCGI extension to set the PHP_FCGI_MAX_REQUESTS environment variables for the PHP process to 10000.This setting instructs php-cgi.exe to recycle itself after it has processed 10000 requests successfully.

> cscript fcgiconfig.js -set -section:"PHP" -EnvironmentVars:PHP_FCGI_MAX_REQUESTS:10000
Note: You can configure InstanceMaxRequests and PHP_FCGI_MAX_REQUESTS to use numbers other than 10000. As a general rule, ensure that the value of InstanceMaxRequests is less than or equal to the value of PHP_FCGI_MAX_REQUESTS.

Test PHP CGI

After installing the FastCGI extension and registering and configuring the PHP CGI, you can request your PHP application and use it normally.
To test the PHP application, create and request a phpinfo.php page in your site that contains the following:
php

 

phpinfo();

 

?>
You should see something like the following: 




Note that the Server API field indicates that PHP is hosted in FastCGI mode. Source:http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/

Integrating PHP 5.x with IIS part 1


How to Install PHP 5.x on Windows XP Pro

Once you download the PHP Windows Binaries Zip Package (For Windows XP Pro, I used the Win32-VC9-x86 non thread safe version of the zip file.), unzip it to c:\php. (If you had an older version of php installed rename that directory to c:\php-old then create a new c:\php to unzip the files to.

The newer versions of PHP do not include php5isapi.dll. They use the FastCGI php. I have only tried installing and testing this using IIS 5.1 on XP Pro.

1. First you will need to have the FastCGI for IIS extension installed. You can download it from http://www.iis.net/expand/FastCGI. I chose to download and install the x86 version for FastCGI 1.5 for IIS 6 even though my version of IIS is 5.1. Once you start the install it will say that it is also for 5.1.


2. I followed the instructions for "Manually Configuring FastCGI Extension to Work with PHP" in this document, http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/ to configure my system to use FastCGI.


3. Note: To launch inetmgr.exe, you can either


1. go to Start > Rung and type inetmgr.exe in the Open field and press OK or


2. go to Start -> Control Panel -> (Performance and Maintenance) ->Administrative Tools -> Internet Information Services


4. The newer version of php does not have an initial php.ini although it does have a development and production .ini that you can rename to a php.ini. I started with the php.ini-production, renamed it to php.ini and modified it as they suggested in the above doc.


5. Of course, it was not as easy as that. I kept getting all different kinds of problems when I tried running the Cinema Premiere Personal Server. For a while I was getting Page Not Found and then I made some other changes and then it started trying to download the .php files instead of running them. So I went back and made sure I installed php correctly and researched these problems with php on the internet. I previously had an older version of php installed that ran php5isapi.dll which caused additional issues. I tried so many different things until I finally got it working. This is what I did.


1. I went back into Internet Information Services (inetmgr.exe)
* Double click the machine icon for the local computer.
o Right click on "Web Sites" and pick "Properties."
o Click the "Home Directory" tab.
o Click the "Configuration…" button.
o I made sure that .php had the executable panth set to fcgiext.dll located in %WINDIR%\system32\inetsrv.
* Then I went back to the Internet Information Services main window under the local computer I double clicked or opened the Web Sites folder.
o Right click on "Default Web Site" and pick "Properties."
o Click the "Home Directory" tab.
o Click the "Configuration…" button.
o I made sure that .php had the executable panth set to fcgiext.dll located in %WINDIR%\system32\inetsrv. It was not. It was set to php5isapi.dll so I changed it.


  2. Since I still had problems I modified the php.ini some more. I tried so many different things in the php.ini that I don't remember which fields I ended up setting to what, but this is the php.ini that finally worked. Download php.ini It must be in your php directory.

3. I also tried many different settings in the fcgiext.ini located in %WINDIR%\system32\inetsrv until I finally got it to work. Download fcgiext.ini

4. Also, just to be sure I rebooted my PC after making these changes. You may be able to just stop and start the services, but I wanted to make sure everything was reset.









The infamous error "Cannot modify header information - headers already sent by *.php" in PHP

Warning: Cannot modify header information - headers already sent by somefile.php (output started at somefile.php:###) in somefile.php on line ###






This Warning is shown by PHP when you use the header function to output headers or use the setcookie function to set cookies after any echo or content which is not inside PHP tag.





echo "Hello World";

header("Location: /redirect.php");



Hello World !!!



Both should throw this warning.



You can disable this warning by turning the error_reporting to OFF using error_reporting(0);, which is pretty much the not way of doing things. In HTTP Headers are sent before the actual content so if you are going to use header function after outputting the contents, it is likely to not work.



How do I solve this Warning Cannont Modify Header Information ?

In order to solve this issue you have to make sure you dont echo or print any output before using header or setcookie function. Make sure the control passes through these functions and then to the output part.



I am sure I dont output anything before calling header or setcookie

Just see all your files for white spaces or empty new lines. For example if you include a file before using the header or setcookie functions, make sure the file does not have a closing php tag (?>) at the end of the file. This is recommended by PHP so that stray white space or new line characters at the end of this included file gets outputted.



I still want to output first and then use header function

In that case you can use output buffering functions to buffer your output automatically before senting any output and the output is sent as a chunk at the end. The following code snippet shows this :







ob_start(); ?>

Hello World !!!



setcookie("name","value",100);

?>

Again !!!



ob_end_flush();

?>

But my code is already done and I dont want to add ob_* functions to it !

You can turn on buffering in PHP on by default using php.ini.

Look for output_buffering , The following shows the mentioned part of the php.ini file.

Set the value as On and restart Apache server.





; Output buffering allows you to send header lines (including cookies) even

; after you send body content, at the price of slowing PHP's output layer a

; bit. You can enable output buffering during runtime by calling the output

; buffering functions. You can also enable output buffering for all files by

; setting this directive to On. If you wish to limit the size of the buffer

; to a certain size - you can use a maximum number of bytes instead of 'On', as

; a value for this directive (e.g., output_buffering=4096).

output_buffering = On
 
 
Source:http://digitalpbk.com/php/warning-cannot-modify-header-information-headers-already-sent

Wednesday, February 23, 2011

Install Komodo Edit in Ubuntu 10.10

Here is another useful tip for having a good development environment. Since there are many Integrated Development Environments on the market I have been going through each one to see what I like and don't like. I have tested many different IDEs available for PHP programming and I have come to like Komodo-Edit. This is the light (free) version of the Komodo IDE 5 program. Since this is not available via a repository let me show you how to install this into your Ubuntu system.

Download the latest release for Linux .

If you are using the gnome desktop you can right-click and select extract here or you can extract using the tar command.

tar zxvf Komodo-Edit-5.0.3-2767-linux-libcpp6-x86.tar.gz


Open up a terminal and move to that directory using cd. Mine is on my desktop so the command looks like this:


cd Desktop/Komodo-Edit-5.0.3-2767-linux-libcpp6-x86/

Now run:

sh install.sh

When you are asked where you would like to install it go ahead and type the directory to where it should be installed. Personally I put all custom installs into a folder called Software in my home directory:


/home/myuser/Software/Komodo-Edit-5

Once it finishes you still have one more step, inserting the executable into your PATH variable. This can be done with a simple command:


sudo ln -s "/home/myuser/Software/Komodo-Edit-5/bin/komodo" /usr/local/bin/komodo

Tuesday, February 8, 2011

5 Things I hate about Vista

Microsoft have recently announced its new OS, the highly we’ve-been-waiting-for Vista. While it looks splendid and very Web 2.0-ish, it is another money-sucking phenomenon from the Bill Gates empire. Through certain ‘behind the curtains’ deals with vendors and dealers Microsoft will soon make billions of bucks on selling the castrated Vista Home Basic. Below are five reasons I think Windows Vista should be hated for and I believe you’ll share ‘em!

Vista Hate Reason One – No Break-Through. While Microsoft pretends Vista is the absolutely new and next generation product, that’s bullshit. Nothing has changed on macro level. It is still Windows, and traditionally it takes loads of time to get used to all the ‘innovations’ the Gates-empire eggheads have implemented into their latest offspring.

Vista Hate Reason Two – ResourceZilla. When I first read about the true requirements for Vista working fine I could hardly keep my mouth shut. Ok-ok, those who’ll use the highly-limited Home Basic version will do with 800MHz or faster processor, more than 512MB of RAM, at least 15GB of available hard drive space, an 800 x 600 SVGA monitor, and a CD-ROM drive. But those who are lucky enough to purchase Home Premium, Business or Ultimate edition… guys, please keep your purse open, you’ll need a serious PC. The more powerful – the better.

Vista Hate Reason Three – Get Less. Most of the vendors will sell their PCs with Vista by installing the cheapest Home Basic edition. It’s understandable – they want to save money and charging another $40 for a better version will keep their customers away. People who buy PCs with the Home Basic Vista think they get the latest piece of art from Microsoft. But they get the version where hundreds of features are simply disabled. Upgrading BTW costs a lot and not recommended.

Vista Hate Reason Four – How Much?! The prices seem to be the absolute nonsence. This nonsence is tragic however, because millions of customers are bound to pay for Vista while purchasing a new PC. Many of them will be dissapointed to find out they can’t enjoy the whole potential of the new OS (not much enjoyable there, he-he) and will want to upgrade. Read above – Microsoft’s idiotic policy considering upgrades is already a legend.

Vista Hate Reason Five – It’s Microsoft. For many this one reason is enough to hate Vista. Microsoft is the undoubted leader of the software industry, but one can talk hours about all the bugs and glitches all Microsoft products have. Vista is no exception. Microsoft will publish service packs (what a great reason for advertising, PR and extra money for the upgraders), downloadable patches etc. That’s marketing and pire business.

I hate communism

I hate communism. I hate it for many reasons. First and foremost, I hate any form of government that involves huge emphasis on authority figures. Why should we all be treated like little children by the government? We should be able to make our own decisions and have freedom of speech amongst other civil rights.

Second, I hate the way that communism essentially penalizes the honest, moral hard-working people who work really hard, just to make the same pay as the slackers and end up picking up the slack for the majority of the group that are slackers. The equal pay and guaranteed social “benefits” encourages lazy people to not work as hard, or to not work at all. That is not fair to the people who work really hard.

I also hate communism because the government runs everything, which does not allow for competition. Thankfully my country of the USA is not communist, but some of the changes occurring as a result of the Bush administration reek of slight comminism and I hate that!

For example, the government telling small bar businesses that they are not allowed to let us smoke in their bars; or the state government of Massachusetts mandating that all people MUST obtain health insurance, essentially forcing the people who do not receive employee health benefits to dish out money for an individual plan. I hate any kind of strong authoritative government! Let us be! US free and democratic!