“If all of the Greek islands were merged with the mainland, it would be about the size of Alabama; there are 10 million Greeks – and perhaps another 4 million living throughout the world, who still think of themselves as Greek. They are, thanks to their history, magnificent patriots and nationalists – and abominable citizens, who deeply mistrust every government they’ve ever had. Essentially they are fierce individualists, who mistrust so much whatever government happens to be in power as the very idea of government. The have almost no sense of civic responsibility – Pericles complained about this at length – and History has never given them much of a chance to work out a stable system of government.”
By removing the ETag header, you disable caches and browsers from being able to validate files, so they are forced to rely on your Cache-Control and Expires header. Basically you can remove If-Modified-Since and If-None-Match requests and their 304 Not Modified Responses.
Entity tags (ETags) are a mechanism web servers and the browser use to determine whether a component in the browser’s cache matches one on the origin server. Since ETags are typically constructed using attributes that make them unique to a specific server hosting a site, the tags will not match when a browser gets the original component from one server and later tries to validate that component on a different server.
Doing this is simple. First step make sure the Headers mod is enabled:
Code:
a2enmod headers
Then, within your apache2.conf file, add the following:
You would think a function to remove new lines from a string would exist, but surprisingly it doesn’t. My first thought was to use the nl2br function. nl2br “inserts HTML line breaks before all newlines in a string” and to then strip the br’s out. So something like this:
Code:
$string = strip_tags(nl2br($string));
The key word above is “before” though. The function preserves the new lines and just adds a br after it. So I decided to write a function to do it for me:
Here with at this happy time of year, a few confessions from my beating heart: I have no freaking clue who Nick and Jessica are. I see them on the cover of People and Us constantly when I am buying my dog biscuits and kitty litter. I often ask the checkers at the grocery stores. They never know who Nick and Jessica are either. Who are they? Will it change my life if I know who they are and why they have broken up? Why are they so important? I don’t know who Lindsay Lohan is, either, and I do not care at all about Tom Cruise’s wife.
Am I going to be called before a Senate committee and asked if I am a subversive? Maybe, but I just have no clue who Nick and Jessica are. Is this what it means to be no longer young. It’s not so bad.
Next confession: I am a Jew, and every single one of my ancestors was Jewish. And it does not bother me even a little bit when people call those beautiful lit up, bejeweled trees Christmas trees. I don’t feel threatened. I don’t feel discriminated against. That’s what they are: Christmas trees. It doesn’t bother me a bit when people say, “Merry Christmas” to me. I don’t think they are slighting me or getting ready to put me in a ghetto. In fact, I kind of like it. It shows that we are all brothers and sisters celebrating this happy time of year. It doesn’t bother me at all that there is a manger scene on display at a key intersection near my beach house in Malibu. If people want a
creche, it’s just as fine with me as is the Menorah a few hundred yards away. I don’t like getting pushed around for being a Jew and I don’t think Christians like getting pushed around for being Christians. I think people who believe in God are sick and tired of getting pushed around, period. I have no idea where the concept came from that America is an explicitly atheist country. I can’t find it in the Constitution and I don’t like it being shoved down my throat.
Or maybe I can put it another way: where did the idea come from that we should worship Nick and Jessica and we aren’t allowed to worship God as we understand Him?
I guess that’s a sign that I’m getting old, too. But there are a lot of us who are wondering where Nick and Jessica came from and where the America we knew went to.
10. Tipping off the Sonics
9. Michelle Carter (his mother)
8. No More Dunking
7. All-Star Controversy
6. Injuries
5. Peterson Ejection
4. Graduation / Game 7
3. “Come on, MVP?”
2. The Trade
1. Didn’t Always Give 100% – “Do you think Vince Carter has pushed himself, as hard as he should have pushed himself?” VC: “In years past, no”.
This is something I do often for development, but never actually knew if I was doing it correctly. I think I’ve finally gotten this right. What I want is: To be able to setup VirtualHosts in XAMPP and also define a PHP include path within that. I’m assuming you generally have an idea how to setup a VirtualHost in Apache.
The first step is to modify your Hosts file to point traffic to your local computer. My hosts file is here C:\WINDOWS\system32\drivers\etc\hosts, you’ll have to search for yours.
Code:
127.0.0.1 www.sun.com
127.0.0.1 sun.com
The next step is to define the VirtualHost within the httpd-vhosts.conf file in the conf directory of your XAMPP setup.
I wrote a post a few years ago about a quick way to backup a MySQL database using email. Since then I’ve updated that script to upload the file to Amazon S3 instead of emailing it. I use an Amazon S3 PHP Class you can find here to make it happen. Your also going to need cURL enabled on your server. On Ubuntu/Debian that’s as easy as:
For reasons I won’t go into, I wanted to force Apache to strip the www from the URLs. So if someone typed in http://www.abc.com, Apache would automatically send them to http://abc.com. First thing to do is make sure ModRewrite is enabled, once that’s done simply put the following in your VirtualHost configuration or in the associated .htaccess file:
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
I was always curious how to set different PHP include paths per Virtual Host in Apache. I didn’t want to use an .htaccess file hack or the PHP function set_include_path. After some digging, I came across a post on a mailing list showing how it’s done using a Directory directive:
Update (May 6/09): I used 12 megs of data while in the States. Without the US Roaming package at the rate of $30/meg my total would have been $360!! With US Roaming plan $10/month + $1/meg = $22.
I’m heading to the States this weekend (I live in Toronto) and got a bit paranoid about what my roaming data (3G) charges would amount to. A quick look on the Rogers website confirmed my fears: $0.03/kb or $30/mb! That’s madness! I heard from a few people that Rogers had a US Roaming Package of some sort. I tried looking for it on the Rogers website, but couldn’t find it anywhere. I then somehow thought to search (on the Rogers website) for ‘Roaming’ and this appeared:
US Data Roaming Add-On – $10.00
Buy the $10/month U.S Data Roaming Add-On and then pay only $1/MB ($0.001 per KB) while roaming in the U.S
I called Rogers and had them add the package to my plan. You can remove it at anytime and only be charged for the month you used. Keep in mind this plan only covers data. Regardless if you have a text-messaging plan in Canada, in the States it’s $0.60 per text message. I don’t even want to know what voice + roaming would hit.
What a way to spend Good Friday. I just sent this email to a few people at Big Blue explaining what happened…
_______________
Hey guys,
You may have noticed I was offline for most of the afternoon. My timing belt broke on the highway (401) while I was driving. I heard a (really) strange noise — the car lost all power and I quickly moved to the shoulder. I called some people and eventually got it towed off the highway. What a way to spend Good Friday (I’m Greek Orthodox). All that said, is it too early to ask for a raise? Ha, just joking. Have a good weekend guys.
"Today, the Cold War has disappeared but thousands of those weapons have not. In a strange turn of history, the threat of global nuclear war has gone down, but the risk of a nuclear attack has gone up. More nations have acquired these weapons. Testing has continued. Black market trade in nuclear secrets and nuclear materials abound. The technology to build a bomb has spread. Terrorists are determined to buy, build or steal one…. Some argue that the spread of these weapons cannot be stopped, cannot be checked — that we are destined to live in a world where more nations and more people possess the ultimate tools of destruction. Such fatalism is a deadly adversary, for if we believe that the spread of nuclear weapons is inevitable, then in some way we are admitting to ourselves that the use of nuclear weapons is inevitable…. So today, I state clearly and with conviction America's commitment to seek the peace and security of a world without nuclear weapons. I'm not naive. This goal will not be reached quickly — perhaps not in my lifetime. It will take patience and persistence. But now we, too, must ignore the voices who tell us that the world cannot change." – Obama, Prague, 2009 [April 11-17 Economist]