Archive

Author Archive

Microsize me

July 30th, 2010 mike No comments

The world is getting smaller.

  • AT&T's got a Femtocell called a "MicroCell"
  • PayPal is an example of a "micropayment" service
  • Microformats are becoming increasingly popular to add more metadata into websites, mainly for richer machine processing
  • MicroATX is one of many small form factors. However, not as small as Nano-ITX, Mini-ITX
  • Twitter is the world's most popular "Microblogging" service
  • Need to clean something fragile? Microfiber cloths are typically used to clean luxury cars, computer parts, screens, etc.

In this world of larger cars, larger boats, larger cruise ships, larger meals, just remember this - a lot of things are getting smaller. Typically technology... but I threw in another couple terms I seem to say often.

Categories: Uncategorized Tags:

Little-known URI shorthand - the "network-path" reference

July 21st, 2010 mike No comments

I've seen this before, and it was mentioned earlier today at OSCON, but I never knew if it was a browser behavior or a standard. Looks like I got it with some help from IRC.

Say you have a foreign host and you don't want to have to figure out if you're on http:// or https:// and call their assets appropriately so you don't get a mixed-mode warning. You can actually use a syntax that is defined in RFC 3986, specifically section 4.2:

A relative reference that begins with two slash characters is termed a network-path reference; such references are rarely used. A relative reference that begins with a single slash character is termed an absolute-path reference. A relative reference that does not begin with a slash character is termed a relative-path reference.

Which means you can do this:

<img src="//foo.com/bar.jpg" />

and your browser will request http://foo.com/bar.jpg or https://foo.com/bar.jpg, depending on what scheme your browser is currently on.

I was hesitant at first to consider it "okay" but as it is published in the RFC and Chromium's fixed bugs relating to it, it does appear to be a properly supported method that could save you a few keystrokes. Let me know if it doesn't work for you! Be sure to give browser/OS information and conditions to reproduce.

Oh yeah, and the other host needs to be on https as well, of course. I shouldn't really have to say that, though :)

Categories: Development Tags:

nginx and Go Daddy SSL certificates

July 15th, 2010 mike No comments
  1. Generate the CSR:
    openssl genrsa 2048 > yourhost.com.key
    openssl req -new -key yourhost.com.key > yourhost.com.csr
    
  2. Enter in whatever you want - you NEED the "Common Name" everything else is not really required for it to work.
    Country Name (2 letter code) [AU]:US
    State or Province Name (full name) [Some-State]:.
    Locality Name (eg, city) []:.
    Organization Name (eg, company) [Internet Widgits Pty Ltd]:Something Here
    Organizational Unit Name (eg, section) []:.
    Common Name (eg, YOUR name) []:yourhost.com
    Email Address []:.
    
    Please enter the following 'extra' attributes
    to be sent with your certificate request
    A challenge password []:
    An optional company name []:
    
  3. Paste the CSR into Go Daddy, get back the .crt file
  4. Combine the cert + Go Daddy chain:
    cat yourhost.com.crt gd_bundle.crt > yourhost.com.pem
  5. Lastly, in nginx.conf:
    ssl_certificate /etc/nginx/certs/yourhost.com.pem;
    ssl_certificate_key /etc/nginx/certs/yourhost.com.key;
    

Additionally I have these SSL tweaks which seems to maintain a better SSL experience, passes McAfee Secure's SSL checks, etc.:

ssl on;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP;
ssl_session_cache shared:SSL:10m;
Categories: nginx Tags:

A simple Upstart recipe for KVM

July 1st, 2010 mike No comments

Might not be the most advanced, but hey, it works. You just need to alter the mac address and the display for each machine. I'm running this on Ubuntu 10.04 (Lucid) and it seems to work great.

/etc/init/my-kvm.conf:

description     "my-kvm"

start on (net-device-up
   and local-filesystems)
stop on runlevel [016]

respawn
exec /usr/bin/kvm -hda /root/virtual-machines/my-kvm.bin -no-acpi -m 128 -net nic,macaddr=DE:AD:BE:EF:18:12 -net tap -vnc :0

Enjoy.

Categories: Software Tags:

Happy day! PHP-FPM included with PHP 5.3.3RC1, and WordPress 3.0

June 17th, 2010 mike No comments

Officially in the 5.3.3RC1 distribution. Sweet! From the NEWS file:

17 Jun 2010, PHP 5.3.3 RC1
...
- Added FastCGI Process Manager (FPM) SAPI. (Tony)
...

and on an unrelated note:

- Added support for JSON_NUMERIC_CHECK option in json_encode() that converts numeric strings to integers. (Ilia)

Shouldn't this be called JSON_NUMERIC_CONVERT? or JSON_FORCE_INTEGER? It's not just a "check" - guess it's too late now? :)

WordPress 3.0...
WordPress 3.0 came out today. Tonight I'll probably upgrade this site and see how well it works. I'm going to check it in to Subversion first so I can roll back if needed.

Some key changes I wanted to talk about...

  • One thing that was highlighted is the option to use custom header images - which can easily be done right now. I did it well over a year ago in a theme. With post meta you can always load metadata about a post and use it in the theme, so this update seems a bit specific to me, since themes were already customizable. Why build a feature that is so specific? Same with background images/colors...
  • Custom menus/menu editor - this could get cool, the menu editor is the more exciting piece as it will allow a visual way to manage the taxonomy. Not sure how it will mix in with tags and categories though, guess that's "I'll see it when I upgrade."
  • MU merge - finally, I can run multiple installs off the same WP install, hopefully, without wp-config.php hacks. How exactly it works I will have to find out.
  • Custom post types - now all of a sudden you can make any sort of object with custom attributes, which opens the door to things such as the item below.
  • WP e-Commerce says they're going to change from using all their extra tables to using core WP schema. That's awesome.

A couple bones to pick...

  • It's not a rewrite. It's still a blogging tool that is being extended further to be a full-featured that can handle "anything" - however the tables are still named "posts" even though now you can create an arbitrary type of item. I'd like to see it renamed and normalized.
  • All the plugins and themes and such are procedural code, but some inner workings such as the DB layer are OO. That seems amateur to me, and unnecessary.

I'd love to see WP get rewritten. It has a LOT of overhead and includes built in that need calling and a lot of other cruft that I stumble across. Go back to the drawing board with building a list of every feature it has, and look at it from a longer term perspective. It's great to see something keep growing, but when it comes down to it, it is still a fork of b2, which was made for blogging, not for anything and everything.

It's got the right idea with extensibility and such, but to me the core has a lot of code - and lots of code means more complicated execution paths, more "I'll just add this in instead of refactor this old code," more cruft. I'm quite sure I could get as much extensibility out of a fresh rewrite with less than half the code under the hood. Things like text styling for example should be moved to a plugin (I disable all the wptexturize filters for example... throw those in an include and make it enabled by default instead!)

Of course, WordPress does have millions of users so it has a proven track record. I can't complain that much, I do use it myself. For blogging, it's the best tool out there. For other things, it typically leverages plugins which may or may not have decent UIs or APIs to interact with. That's where it shows signs of weakness. It also isn't as strict as Drupal when it comes to code conventions either, which would greatly increase the usability of a lot of plugins.

Categories: PHP, PHP-FPM, WordPress Tags:

The Trifecta with AT&T

June 2nd, 2010 mike No comments

Today AT&T reported a bunch of data plan changes, perfectly aligned with screwing over people when iPhone OS 4 comes out.

OS 4 will give us tethering ability with AT&T. Of course, that comes with an additional cost now. If you want to "officially" tether with AT&T, you'll have to switch to one of their two data plans, and THEN buy tethering on top of that. Instead of your $30 for unlimited, you'll be paying $45 for only two gigs of bandwidth, vs. $30 currently for unlimited. Or $35 for a measily 250 megs.

They claim that 98% of its users fall within those tiers. Sounds like they're giving 98% of us a way to save a few bucks, right? Wrong. What people are overlooking is the fact that those statistics don't include the fact that you will be TETHERING. As in, your computer will be transferring data, and you're already accustomed to a much heavier data consumption through that medium. Think of how those little widgets on your laptop grab information off the net every so often, or a single Youtube video could easily be 20+ megs. It does add up, and ultimately anyone who wants to tether with AT&T should use it sparsely - otherwise, they'll be paying $10/gig for your overages.

I'll give AT&T some credit - their marketing geniuses and social engineers are gaming this system well - using the upcoming iPhone and OS for service type changes, some of which require contracts, some don't - helping them limit the impact on their network in creative ways while making you think you're getting a better deal. I especially like the fact once you drop out of an unlimited contract you can't go back, and they're trying to sway you out of it by not changing your expiration date if you drop down, and "allowing" you to switch back and forth between the two plans. Oh, and new iPad users? If you don't have a plan by the time OS 4 launches, you'll be subject to these new limits.

Let's face it - AT&T's network can't handle the iPhone. It's a blame game that ultimately both could be doing better at. I'm sure the iPhone could change it's tower-hogging style behavior, and I'm sure AT&T could be deploying all these upgrades they keep telling us about faster.

For me, if I do decide to go with the next iPhone, I won't be buying it with a contract. I'm going to stay a free agent, and not get locked in to a new agreement, and not buy their joke for insurance (monthly fee and still the cost of buying a refurbished unit for the deductable?!) - and I am getting closer every day to switching over to maybe the Evo 4G on Sprint - a hybrid solution with a limited 4g network around the area. Sprint and Verizon seem to have a much more reliable network, and since this device is still primarily a phone, voice calls do count for something. Sprint's at least would afford me faster WiMAX when I could get it, and openly promote the device's ability to share the connection with up to 8? devices.

I haven't investigated the fees, but when I can't go a single day without a dropped call, and I try to find landlines to fall back on where I can instead of my phone, something has got to change.

Categories: Consumerism Tags:

Chrome now supports SPNEGO!

May 28th, 2010 mike No comments

As of Chrome 5, it appears that SPNEGO (that seamless sign-on that happens using Kerberos tickets and GSSAPI and all that magical crap) on a Windows-centric network is supported. Thanks to Tim for noticing that today and after upgrading to version 5, I could confirm it.

I have to say that I have been impressed with Chrome, for the most part. I still would like a status bar at the bottom, I'm used to having some sort of "frame" around my windows to know where they end. Also it has a limited amount of things to customize inside of the options. However as far as development goes, it's moving along quite steadily after the initial launch and stagnation. I did expect this version to be noticeably faster but so far it seems the same. I especially expected Gmail and other Google properties to magically perform better... but nothing major to report so far.

When it comes down to it though it's becoming the default browser on almost all of my machines. It's faster on startup and such than Firefox and less prone to large memory usage (but still is a bit bulkier than I'd like...) but it's design is much better than Firefox's due to it's sandboxing. Hopefully development continues at the same rate though!

Categories: Software Tags:

Netflix++

May 26th, 2010 mike No comments

Once again I have to show praise for this company. In a time where everyone is cutting corners they are giving proactive discounts when they totally could not bother with even notifying me about a delay.

We're Sorry Your DVD Shipment Was Delayed

Dear Michael,

Due to a technical problem, your DVD shipment was delayed and will ship on Wednesday, May 26th.

We pride ourselves in delighting you, and we've let you down. We apologize, and we will issue a 10% credit to your account in the next few days. You don't need to do anything. Your credit will automatically be applied to your next billing statement.

Categories: Consumerism Tags:

AT&T takes a shit on us again?

May 22nd, 2010 mike 1 comment

Wow - two headlines in the same amount of weeks worth screaming about.

They're increasing ETF fees on all devices that actually matter and put any strain on their network. They've reduced fees on "basic and quick messaging phones" - which aren't anything that anyone cares about anymore.

"... the ETF will increase to $325, and be reduced by $10 for each month that you remain with us as a customer during the balance of your two-year service agreement."

Do the math: if you ride out your contract until month #23, you still owe them $95. You can never break even until you've gone out of your contract. I bet this will stay in effect for next year's iPhone refresh (assuming the pattern continues) - which means larger ETFs/upgrade costs for people who want to upgrade to the next iPhone after the 4G. All of us folks who plan on getting an iPhone 4G will be agreeing to these new terms (assuming we buy into a contract.) AT&T's got virtual crack with the iPhone (and iPad, I suppose) - they rope you in with two year agreements but release a new device each year... it would be so great if Apple got out of their damn agreement with AT&T.

Will have to weigh the options - I might be out of my contract soon anyway and it might be cheaper to buy the phone without a contract. Assuming I even stay with AT&T.

Ref: http://www.att.com/gen/press-room?pid=17951

Categories: Consumerism, Toys Tags:

PHP-FPM and nginx upstart scripts

May 21st, 2010 mike 3 comments

Upstart is becoming the de-facto standard for everything in Ubuntu, and I do enjoy it's process management and re-spawning capabilities.

(Actually, before PHP-FPM I used to use upstart jobs to su - $user php-cgi -b $port :) )

These are VERY simple but effective scripts, and would actually be beefed up to be more intelligent (chaining nginx to start after PHP-FPM for example. However, if you do not need PHP, then that's a useless chain. So I kept it simple. I suppose you could add a short delay to start nginx then...)

Note: make sure PHP-FPM is set to daemonized = yes.

Second note: this works for PHP 5.2.x w/ the PHP-FPM patch, on Ubuntu Lucid Lynx (10.04) - anything else YMMV. I am not using PHP-FPM w/ PHP 5.3 yet since I have no environments that I know will support 5.3 code. When I finally get one, I will look for the same opportunity.

/etc/init/nginx.conf:

description "nginx"

start on (net-device-up and local-filesystems)
stop on runlevel [016]

expect fork
respawn
exec /usr/sbin/nginx

/etc/init/php-fpm.conf:

description "PHP FastCGI Process Manager"

start on (net-device-up and local-filesystems)
stop on runlevel [016]

expect fork
respawn
exec /usr/local/bin/php-cgi --fpm --fpm-config /etc/php-fpm.conf

Once you've done this you can remove all the /etc/init.d/php-fpm, /etc/init.d/nginx and /etc/rc?.d/[K,S]??php-fpm and /etc/rc?.d/[K,S]??nginx symlinks and files. This takes care of all of that.

Feel free to comment and leave better tips, tricks and ideas!

Categories: Development, PHP, PHP-FPM, nginx Tags: