Increase maximum upload size with nginx and PHP

Increase maximum upload size with nginx and PHP

I recently reconfigured my servers and switched from Apache HTTP to nginx. My wife wanted to upload some photos to her blog but it kept giving her an error. I checked the error log on the server and found this weird error message:

2014/12/23 16:03:18 [error] 23573#0: *4374978 client intended to send too large body: 1070520 bytes, client: 24.243.18.61, server: www.awkwardsheturtle.com, request: “POST /wp-admin/async-upload.php HTTP/1.1”, host: “www.awkwardsheturtle.com”, referrer: “http://www.awkwardsheturtle.com/wp-admin/media-new.php”

nginx

First I needed to increase the client maximum body size in nginx. This is done by adding the following line to /etc/nginx/nginx.conf in the http block:

client_max_body_size 8M;

Reload the nginx config and you should be good to go:

service nginx reload

PHP

Next, edit your php.ini (for me this is located at /etc/php5/fpm/php.ini). Find the following lines and update their values:

upload_max_filesize = 8M
post_max_size = 8M

Restart PHP to load the new configuration:

service php5-fpm restart
Read More

OhLife is dead, long live MyLife!

OhLife is dead, long live MyLife!

I started using OhLife, a free journal-by-email service, in October of 2011. Every morning I received an email asking me about my day and showing a snippet of my past journal entries. I just had to reply to an email in order to add an entry. I was very sad to hear, 3 years later, that they were shutting down. Fortunately a pile of OhLife clones have popped up to take its place.

My favorite is MyLife. It is free and provides an experience similar to OhLife. It runs on Google App Engine so there is little risk of the service going down in the future. Setup takes a bit of effort, but the author has provided step-by-step instructions.

MyLife is written in Python and is open source. I’m not great at Python but the code is straightforward enough that I was able to submit a bug fix. It should be pretty easy to add additional features if you’ve always had the itch to customize OhLife to fit your exact needs.

Read More

Get Amex Offers automatically

Get Amex Offers automatically

American Express is constantly offering special deals to their card holders. For example, I’ve gotten extra cashback over the past few months for purchasing from Enterprise, Wal-Mart, Office Max, Staples, Macy’s, Panera, and Amazon. This is in addition to the cashback I normally get from using my Amex.

In order to take advantage of these deals, you have to add them to your card. This used to be a manual process, but thanks to OffersBot, it is now fully automatic. OffersBot will track new and existing promotions and make sure they are all added to your card. And best of all, the service is free!

offersbot

Read More

Seminary is awesome!

Seminary is awesome!

At the beginning of September, my wife and I were sitting around wondering “what now?” We have kids, a home, Becca is done with school, business is good… We reached most of our goals, so what should we be doing next?

As we discussed this, we decided we needed to focus on the religious side of things more: get better at daily scripture study, go to the temple more often, consistently have Family Home Evening on Monday nights… The basics that we had been letting slide a little bit.

That evening we watched Only a Stonecutter as a family. The movie was pretty bad but the story was interesting. It told the story of a man who worked as a stonecutter for the Salt Lake City temple. An accident caused him to lose his leg. Instead of quitting his calling, he literally made himself a new leg so he could continue walking to the temple so he could fulfill his calling. Pretty intense.

The next morning we were out as a family when I got a call from the bishop. He asked if Becca and I would be willing to be seminary teachers. We said yes, and then had a day to ponder the implications.

We’d have to cut back on our family travel time. We had been spending a lot of time on the road and out of town, which isn’t possible when you teach every morning. We’d also have to move to a regular schedule (go to bed on time, wake up on time) instead of going to bed when we felt like it and waking up whenever. We thought about the Only a Stonecutter video and realized these minor sacrifices were nothing compared to what others have been asked to sacrifice, so we put our doubts behind us and cheerfully moved forward with the calling.

Without realizing it, we had been turning our living room into a seminary room. We hung a chalkboard in the living room the day before the bishop called us. We had a bookshelf with plenty of room for the students’ scriptures. We had enough seating and hymnals. We were ready to go!

Anna in front of the chalkboard the day we hung it on the wall.

Anna in front of the chalkboard the day we hung it on the wall.

So now we’ve been teaching for about 4 months. It has been awesome! There is a new manual this year, which has made the whole experience much more enjoyable. We have 7 kids in our class, and they are all amazing. We try to have one of them give a short devotional before class each morning, and they always have a great insight into the gospel or a meaningful personal story to share.

seminary-art

Our seminary class according to Tanis.

Anna occasionally joins the class, and is always eager to blurt out the answers to the easy questions that our students aren’t always willing to answer. Sometimes she makes them look bad by memorizing scripture mastery scriptures that they haven’t put in the effort to learn yet.

Anyways, we are grateful for this calling, and so grateful for the group of kids we get to see nearly every morning!

Read More

Picking a second DNS server

Picking a second DNS server

A few months back Time Warner suffered a massive DNS failure. Customers across the country (myself included) were unable to browse the web because Time Warner was unable to tell them what IP addresses went with which domain names. It was incredibly frustrating.

Since then, I’ve always made sure my computer is configured to use two separate DNS servers from different companies: one from whatever internet service I’m connected to, and another from somebody else. But how to pick the second DNS server? Google Public DNS? OpenDNS? Or something else?

I found this neat software called DNS Benchmark (or Domain Name Speed Benchmark, or Domain Name Server Benchmark… they aren’t consistent with the naming…). It checks a pile of DNS servers to see which perform best for you, and which are likely the most reliable.

Once you’ve picked your second DNS server, you just need to update your computer to use it and one of the DNS servers provided by your router. This process varies based on your OS, so I’m not going to walk you through it (there are hundreds of articles on Google to help you with this).

Time Warner has suffered occasional DNS issues since then, but I’ve never noticed. If the first DNS servers fails, your computer is smart enough to try the second.

Read More