Archive for the 'I'm a Geek' Category

Back in Time to Dec 14th

Sunday, January 3rd, 2010

I’ve been having trouble with on particular flash drive while trying to make my dad a Fedora Live USB sitck. Tonight briefly tried to fiddle with it to try and figure out what I was doing wrong. Not paying attention I fdisked my laptop drive and wiped out my drive partition. Kudos to Back In Time. I had a snapshot from december 14th of all my data. Most of anything I hadent backedup was pushed to a code repo elsewhere, so I just reinstalled. A few additional packages, email, VPN and kerb configs later I was back into a dec 14th state.

Back up you’re data!

Wordpress mu non-wildcard vhosts

Friday, December 4th, 2009

*** UPDATE ***
This hack is probably unnessesary, I found that wp-mu has a sites framework that is not exposed, there is a plugin that’s trying to accoplish the same thing I am. Just google ‘wordpress mu sites’
*******

I need to have multiple wordpress instances installed, but I want them each to have their own vhost, I also want an easy way to maintain them (upgrades and such). I thought wordpress mu could do this… but out of the box it only supports wildecards on a single domain. (blog1.example.com and blog2.example.com and blog3.example.com) Turns out you can change 2 lines (3 if you want to clean up a view cosmetically) and you seemingly can use wordpress-mu to host multiple domains. www.blog1.com and www.blog2.com and www.blog3.com

I’ve not deployed this yet… so use at your own risk. I’ll post again later with results after I’ve migrated a couple sites to it.

The problem: wp-mu assumes in vhost mode that all your blogs are of convention {something_here}.example.com. It does this by concatenating the domain you configure at install time onto the name of any new wordpress site you setup.

The solution: tell it not to append your installed time configured domain when you setup a new site. No special magic seems to happen with a new wordpress site’s configured domain after install time.

To show how this works this we’ll setup an example.com instance of wordpress mu and replace the wildcard magic so that not-example.com is hosted by the same code base.
1. download and and install wp-mu just as they tell you to, use example.com (set a hosts record to point example.com to your localhost) You’ll now have a fresh new wp-mu blog at example.com.
2. patch the files to remove the wildcard vhost magic
a. This change will remove the hardcoded base domain and will assume the domain name you’re accessing wordpress with is the current domain. Without amking this dynamic the authentication would fail on some or all of the configured sites.

wp-config.php
@@ -38,7 +38,7 @@
-define(‘DOMAIN_CURRENT_SITE’, ‘example.com’);
+define(‘DOMAIN_CURRENT_SITE’, getenv(‘HTTP_HOST’));

b. This is the concatenation magic that we want to prevent from happening. It undoes the “force append install-time configured domain” or in our example case, don’t force .example.com on the back of my new blog.

wp-admin/wpmu-edit.php
@@ -147,7 +147,7 @@
if( constant(‘VHOST’) == ‘yes’ ) {
-                       $newdomain = $domain.”.”.$current_site->domain;
+                       $newdomain = $domain;

c. This last one is optional. It’s just removes the domain name below the test box on the form for a new blog. This is a pure cosmetic change.

wp-admin/wpmu-blogs.php
@@ -582,7 +582,7 @@
<?php if ( constant( “VHOST” ) == ‘yes’ ) { ?>
-                                                       <input name=”blog[domain]” type=”text” title=”<?php _e(‘Domain’) ?>”/>.<?php echo $current_site->domain;?>
+                                                       <input name=”blog[domain]” type=”text” title=”<?php _e(‘Domain’) ?>”/>

3. Add a new wp site at not-example.com (add the hosts record that points to localhost again to test)
4. use the dashboard -> tools -> export to get an xml dump of a single instance blog that you can import into a wp-mu managed blog.

Like I said I’ve not actually deployed this yet, but authentication in and out of the two domains dashboard and frontend seem happy. I’ll be sure to update this post with any other issues I come across. let me know if you try it and if it works!

Google found JADDOG

Friday, August 7th, 2009

I was working on something for work that involved python and kerberos again. Very generic search looking for the docs I used last time I was implementing similar functionality. Something seemed familiar about the last result on the second page:

JaddogGoogle

I don’t feel so much like and island in nowhere land any more.

PyCon ‘09

Thursday, March 26th, 2009

It’s been over a month since I last posted. Lots has happened. Sickness, work, new baby on the way, training for the triathlon and God has been faithful through it all.

This week I’m in Chicago at PyCon ‘09. I’ve been enjoying the conference and have a few new concepts to apply to my python programming.

I’m on the train to meet my family for dinner. Mmm Thai. Just wanted to through down a couple lines. I have been wanting to write a couple posts on things I’ve been learning. I finished Basic Christianity and have cross referenced Worship Matters with Authentic Christianity. I also started Why Small Groups by CJ Mahaney. It’s a book I’m reading with a Leadership Development group at church. All have a post associated with them.

I’m thankful for the desire the Lord has given me to read in the past few months and I pray the more consistent consumption of reading material continues.

The state of the Internet

Friday, January 9th, 2009

I get emails from time to time from Akamai regarding “The State of the Internet”. I have no idea how I got on the email list but it’s beside the point. While we were roaming around Cambridge tonight, btw we made it to FUDCon safely, past an Akamai building. On the ground floor there was a huge room with lots of tv’s all over the wall with graphs and stats on them. You know, a “mission control” kinda room. I took a picture that doesn’t do the room justice but gives you a little idea of what was in there. Kinda cool to see.

dsc08806-640x480

dsc08810-640x480

Fedora Road Trip

Wednesday, January 7th, 2009

So I want to be the uber geek I am and post this blog post as I ride in a 15 passenger van to Boston. There are 9 of us in the van on our way to attend FUDCon F11. We have a power strip plugged into the cigarette adapter and half a dozen laptops plugged into the power strip. We also have a wireless access point broadcasting an internet signal it gets through it’s onborad PC card slot pulling over the cell towers. It’s almost 11pm night. ETA  in Boston: lunch time tomorrow…  More to come. I’ll be in front of a computer at the conference through the weekend.