PHP Notice: Undefined variable: _SERVER in ..

I upgraded Linux on this server a while back and in the course of that upgrade PHP was upgraded too, to version 5.5.9.

Since I had a modified php.ini it asked me to check over any new options. There were a few but I fixed anything that looked like it might break things. I saved the php.ini and let the upgrade go on.

Clearing up bugs

Some time later I saw odd notices in the PHP error log. Usually it referred to wp-comments-post.php but files outside of WordPress raised the warning too:

PHP Notice: Undefined variable: _SERVER in ..

It turns out the fix is rather easy. Jacques Marneweck on his blog posted a solution. Simply switch off “auto_globals_jit” in your php.ini and restart Apache (if required).

From the PHP manual entry for auto_globals_jit:

When enabled, the SERVER and ENV variables are created when they’re first used (Just In Time) instead of when the script starts. If these variables are not used within a script, having this directive on will result in a performance gain.

The PHP directives register_globals, register_long_arrays, and register_argc_argv must be disabled for this directive to have any affect. Since PHP 5.1.3 it is not necessary to have register_argc_argv disabled.

A bug

It looks like the bug is ancient although I’m not using APC, and the JIT compiler can be fooled if you access the super globals like _SERVER through variable variables. Sneaky!

The default for auto_globals_jit is “On” so next time you upgrade PHP keep an eye on the error log.

B/W HDR Look in Lightroom

Anthony Morganti uses an interesting technique to create photos with a black and white HDR look in Lightroom. It can transform a photo so it looks something like this. (I added a vignette as well.)

B/W HDR Look 1

B/W HDR Look 2

It doesn’t suit all photos of course, it’s also only a starting point as you should develop your photos in whatever way you desire. To avoid repeating all those steps every time I created a Lightroom preset.
Grab that file and install it in the same way you’d install any Lightroom preset. What d’you think?

Restoring From Physical Media

dancing in the street

Remember DVDs? Last night while looking for the original photo of this dancing in the street photo I was horrified to find an empty directory!

Empty Directories

I had no idea when they were deleted. I searched my backups but of course the directories had been synced a long time ago and they were gone. I checked Backblaze and there was no sign of them. I even checked Google Plus for their backups but still no sign of them. I must have deleted them more than two years ago.

I hate that. I have multiple copies of every photo just because this might happen and yet it wasn’t enough! My backups sync every night so any deletes were synced within twenty four hours.

Almost. Later, I remembered that I had backed up photos to DVDs before I started using multiple drives and Backblaze. They were up in the attic!

DVDs

It didn’t take long to get them, the first DVD worked and my photos from The St. Patrick’s Festival in 2006 were restored, but the photos from April 20th were on the second DVD. The second DVD didn’t work. Nooooo!

The rest of the photos did survive their stay in my cold, damp attic and were restored. I’m thinking now about monthly offline backups to a drive I’ll plug in occasionally.

Do I have any photos from April 20th, 2006? I remember the day well because I was in St. Finbarr’s Hospital with my wife helping a family member. While the others waited I went outside to take photos of a derelict building at the back of the hospital grounds. People passed me going to work while I was take pictures of the daisies, flowers and old architecture. Soon enough a security guard showed up but he just asked me to stop taking photos. I do have a few photos. We called to a friend later in the day and I got some shots of her cat so that’s here too. :)

What’s the take home message from all this?

  • You can never have too many backups.
  • You need versioned backups (of a few days at least) in case you notice a mistake a few days later after your backups have been synced.
  • You need an offline backup that’s synced periodically.
  • You need cloud backup that will keep your files safe for a length of time after they’re deleted. Backblaze holds on to your files for thirty days after they’re deleted!
  • When you export files from Lightroom, Photoshop or whatever graphics app you use, always make sure you export a full size original version, not just a web version.

I’m sad that those files are gone, but glad I have a few reminders of an eventful day.

Raw DNG Samples from the Nexus 5

Android L, the next major release of Android will allow apps to get raw data from the camera. This lets photographers extract more information and develop photos a lot more than they could with simple Jpeg files. They’ll be able to “push” the image further to recover blown out highlights and recover detail from shadows.

At least that’s the theory. You’re still working with the relatively small lenses and sensors in camera phones so they’re not going to compare to a DSLR or dedicated camera but images will get closer in quality.

This thread on r/Android has some samples of DNG files you can work on in Lightroom or whatever your RAW processor of choice is. The photos were taken with lcamera as the official Google camera app only records to Jpeg images. I took a stab at the “auto exposure” image here and came up with this:

2014-10-19-182340-gp

That’s pretty good for a photo taken by a Nexus 5 at ISO 1635. Lightroom settings were as follows:

Settings:

  • Temp: -1.65
  • Tint: +59
  • Exposure: -1.65
  • Highlights: -100
  • Shadows: 100
  • Whites: +2
  • Blacks: -29
  • Clarity: +22

Detail

  • Sharpening
    • Amount: 67
    • Radius: 1.0
    • Detail: 10
    • Masking: 70
  • Noise Reduction
    • Luminance: 20
    • Detail: 50
    • Contrast: 0

I’m really excited to see what Android L will bring to camera apps once it’s officially out in the wild and more phones have it installed!

Photos from Helios XM Anomaly in Dublin

Last weekend I took the train to Dublin to take part in my first Ingress event, the Helio XM Anomaly. All I knew was that both Resistance and Enlightened would be there fighting over portals but not much more than that.

Fights for portals were intense 15 minute battles. It must have made a strange sight watching two groups of adults bent over their phones on a street or park tapping at their phones. The only thing heard were the frequent shouts calling “DEPLOY”, “MOD” or “CUBE” as we shouted what we were doing. Who won? The Resistance of course!

The next (closest) Helios event is in Manchester but if there’s another one in Ireland I’d like to go if I can. Good fun, lots of walking.

Almost 23,000 steps around Dublin

Retro Gaming at jQuery UK 2013

Just a few photos that have been sitting in my “upload folder” for the last year or so after attending jQuery UK. Look at all those old 90s consoles! Snes and Megadrive machines? There’s another machine there too but I don’t recognise it. I wasn’t a fan of console gaming back then, but if they’d thrown in a C64 I’d have had fun!

It was an amazing conference and best of all, the talks are online. I remember being blown away by Wait, Chrome DevTools can do THAT? by Ilya Grigorick.

Scenic photos of Oxford will eventually make their way to my photoblog at In Photos dot Org.

The loss of a dog

Spring

Some of you, particularly those who think they have recently lost a dog to “death”, don’t really understand this. I’ve had no desire to explain, but won’t be around forever and must.
Dogs never die. They don’t know how to. They get tired, and very old, and their bones hurt. Of course they don’t die. If they did they would not want to always go for a walk, even long after their old bones say:” No, no, not a good idea. Let’s not go for a walk.” Nope, dogs always want to go for a walk. They might get one step before their aging tendons collapse them into a heap on the floor, but that’s what dogs are. They walk.
It’s not that they dislike your company. On the contrary, a walk with you is all there is. Their boss, and the cacaphonic symphony of odor that the world is. Cat poop, another dog’s mark, a rotting chicken bone ( exultation), and you. That’s what makes their world perfect, and in a perfect world death has no place.
However, dogs get very very sleepy. That’s the thing, you see. They don’t teach you that at the fancy university where they explain about quarks, gluons, and Keynesian economics. They know so much they forget that dogs never die. It’s a shame, really. Dogs have so much to offer and people just talk a lot.
When you think your dog has died, it has just fallen asleep in your heart. And by the way, it is wagging it’s tail madly, you see, and that’s why your chest hurts so much and you cry all the time. Who would not cry with a happy dog wagging its tail in their chest. Ouch! Wap wap wap wap wap, that hurts. But they only wag when they wake up. That’s when they say: “Thanks Boss! Thanks for a warm place to sleep and always next to your heart, the best place.”
When they first fall asleep, they wake up all the time, and that’s why, of course, you cry all the time. Wap, wap, wap. After a while they sleep more. (remember, a dog while is not a human while. You take your dog for walk, it’s a day full of adventure in an hour. Then you come home and it’s a week, well one of your days, but a week, really, before the dog gets another walk. No WONDER they love walks.)
Anyway, like I was saying, they fall asleep in your heart, and when they wake up, they wag their tail. After a few dog years, they sleep for longer naps, and you would too. They were a GOOD DOG all their life, and you both know it. It gets tiring being a good dog all the time, particularly when you get old and your bones hurt and you fall on your face and don’t want to go outside to pee when it is raining but do anyway, because you are a good dog. So understand, after they have been sleeping in your heart, they will sleep longer and longer.
But don’t get fooled. They are not “dead.” There’s no such thing, really. They are sleeping in your heart, and they will wake up, usually when you’re not expecting it. It’s just who they are.
I feel sorry for people who don’t have dogs sleeping in their heart. You’ve missed so much. Excuse me, I have to go cry now.

I realise the entirety of this post is copied from elsewhere but I have nothing else to add. From this Reddit comment but I think this post is the original source.

The source is a friend of mine, whom I asked if I could share it after he posted it on facebook. I share it because I think it is beautiful and helps those who have lost a pet.

Edit: Spring, the dog pictured above, was our family dog growing up but she died 11 years ago leaving a huge gap in our daily lives. As with any death, time is a healer but it never fully mends.

Photos of Bruce Springsteen in Cork

Yesterday evening Bruce Springsteen played in Páirc Uí Chaoimh in Cork City. It was a glorious summer evening and with gates due to open at 5pm I headed down there early with my wife. We had to queue along the Marina for more than an hour but we had the shade of the trees and brought along a fold up chair too. Unfortunately when we eventually got to security they told us the chair couldn’t be brought in and we hid it in the bushes hoping it would be there later. Bags were searched too so I’m glad I didn’t bring my DSLR!

2013-07-18-190840-m

While we waited we heard Bruce singing for a sound check. I’m not that familiar with all his music but they were some beautiful melodic songs I need to try and find and listen to again. We were probably among the first few hundred in so we got to within about 3m of the pit barrier. Beyond that were the early birds who had camped the previous night and VIPS (I presume) who were right up next to the stage. Pretty close eh?

Watch the Hat

2013-07-18-1070827-m

2013-07-18-1070828-m

We were really close but right in front of us were 3 tall gentlemen who blocked my view almost entirely. I had to lift the camera in the air or squint in between heads to see the stage at all unfortunately.

2013-07-18-1070819-m

2013-07-18-1070820-m

Bruce Springsteen puts so much energy into his performance it’s amazing. He collected placards from the audience, got 2 kids up on stage to sing, went shaking hands with the front row, encouraging everyone to sing along. He knows how to work a crowd!

It was of course really crowded so after 40 minutes we decided to retreat. Apologies to those in our way but thank you for being so kind as to move out of our way. I don’t think I’ve ever said “Excuse me, sorry, excuse me, sorry” so many times. The crowd just went on for ever and ever!

2013-07-18-203356-m

Near the other end of the pitch there was a lot more room and we met up with some friends there.

2013-07-18-214126-m

2013-07-18-213835-m

We left early to avoid the crowds and found quite a crowd outside. Local residents and others had gathered on the Marina, in boats and across the river to hear Bruce play! We looked for that fold up chair we left outside earlier but someone had taken it.

2013-07-18-213854-m

2013-07-18-213906-m

We walked around the Atlantic Pond and up that narrow path/road at the other end. It was so nice to see people sitting or lying on the ground just listening to the sound coming from the stadium. Perfect evening for it.
Shortly after, we got into a taxi in Ballintemple, headed into town where we relaxed for a bit before heading home.

A great night, if he plays in Cork again I’ll go but I’ll want to be more familiar with his back catalogue next time!

Photos are from my Samsung Galaxy S4 and a now ancient Panasonic Lumix FZ5 that was small enough to fit in my pocket, even with a 12x zoom! Please leave a comment if you’d like to use these photos.

Edit: I recorded a 24 second clip of the band playing “Wild Thing” but here’s a longer clip!