Archive for the 'Internet' Category

Public Repositories

Set­ting up and main­tain­ing Exis­ten­tial Media I’ve learned some things that I would like to share. I’m adding my hacks and code that I’ve used for Exis­ten­tial Media to GitHub. This will include some Word­Press themes and altered plu­g­ins ini­tially, but I will be adding more. Trans­parency. Roll your own.

Using suexec and mod_fcgid

Since set­ting up our new server, I’ve been try­ing to fig­ure out user/group per­mis­sions. I wanted Word­Press to be able to write to the server (to cre­ate thumb­nails, update plu­g­ins, etc), and at the same time I wanted to be able to write to the server log­ging in as my user in Trans­mit. I had resolved to set­ting the user/group to www-data (the Apache user, so Word­Press could write to the server). Then I added myself to the group www-data and set the per­mis­sions for all the files to 775.

That worked. But it didn’t seem right. On our shared server before this it wasn’t like this. This is when I dis­cov­ered using suexec and mod_fcgid. Using suexec PHP can run as my user. That way I can have the cor­rect file per­mis­sions and be the owner of my files. It took me a while to find infor­ma­tion on how to set this up, and once I did I was def­i­nitely con­fused at points. I based my work on two tutorials.

The first tuto­r­ial I worked with was on Howto­Forge. I skipped the steps on installing Apache and set­ting up vir­tual hosts. I fol­lowed the other instruc­tions pretty closely. But once I had fin­ished, the server was throw­ing up 500 errors.

The sec­ond tuto­r­ial I found to help me with where I hadn’t suc­ceeded. The steps were fairly sim­i­lar. The one dif­fer­ence I noticed that fixed my prob­lem was to make the php-fcgi-starter exe­cutable. Wow. Simple.

chmod a+x

Setting up Ubuntu on Slicehost

DIY. Punk. What­ever. DIT. Open source. I have been semi-successful in mov­ing off of shared host­ing to VPS host­ing with Slice­host. I hope you don’t get the impres­sion that this was easy and I could setup a server when­ever with my eyes closed. I put some work into it. And that is why I’m writ­ing this. This post is com­ing to you from Ubuntu 9.10, Apache 2.2.12, MySQL 5.1.37, and PHP 5.2.10. All of which I installed with apt-get. I chose Ubuntu because I had a lit­tle expe­ri­ence with it already, and because since it is pretty pop­u­lar that means a lot of peo­ple are work­ing on it.

I chose to do this project because I thought it impor­tant to know more intri­cately how these kinds of things work. I had a pretty good under­stand­ing of the basics, but I wanted to delve deeper. Opti­mize. It was an art project for me. Roll your own. Also, I’m not going to lie, there was a mon­e­tary aspect to this as well. The price is the same as my old server, but the new server is much more well endowed.

Let’s talk about process. To setup the server, I fol­lowed this tuto­r­ial from the Slice­host wiki. I did some things dif­fer­ently because this tuto­r­ial is a lit­tle out­dated. For exam­ple, they instruct you to build Apache from source, but I so much more eas­ily installed the Ubuntu pack­age. Also, this tuto­r­ial doesn’t really talk about set­ting up Vir­tu­al­Hosts in Apache, which is nec­es­sary for adding domains. Here are my steps for doing this in Ubuntu.

  1. cd /etc/apache2/sites-available
  2. sudo cp default yourdomain.com
  3. sudo nano yourdomain.com
  4. Add the line ServerName yourdomain.com and change the DocumentRoot and Directory to where your site resides on your server (i.e. /var/www or your home folder)
  5. Ctrl-o to save your changes, then ctrl-x to exit.
  6. Run sudo a2ensite yourdomain.com to add your domain to sites-enabled
  7. Then reload Apache with sudo /etc/init.d/apache2 reload

This now means more of the respon­si­bil­ity for how things work is in my hands. No more rely­ing on oth­ers. Tak­ing care on my stuff.

jQuery: Not as hard as it sounds

For the new blogs page I wanted to put together an accordion-like fea­ture for view­ing the posts to make it feel some­what like a feed reader. I looked at dif­fer­ent javascript libraries for this and chose to go with jQuery, not that oth­ers wouldn’t work, but because I had some lim­ited expe­ri­ence with it.

I started toy­ing around with the slideTog­gle() func­tion, but after a cou­ple hours I had to look around the inter­net for some help. I couldn’t have done it with­out Steve Krueger’s tuto­r­ial. Although I didn’t fol­low it exactly, it helped be over a few hurtles.

Here is the code I ended up with.

jQuery(document).ready(function($){
	$('.story').hide();
	$('.title').click(function(){
	if($(this).is('.active')) {
		$(this).toggleClass('active');
  		$(this).next('.story').slideToggle('fast');
  		return false;
  	} else {
  		$('.story:visible').slideUp('fast');
		$('.title.active').removeClass('active');
		$(this).toggleClass('active');
  		$(this).next('.story').slideToggle();
  		return false;
		}
	});
});

Also, as I was delv­ing deeper into this project, I spent a lot of time around the Word­Press Codex. I found this great func­tion called wp_enqueue_script for load­ing javascript libraries. This is for use in Word­Press plu­g­ins and themes so there is no con­flicts or super­flu­ous code. Pretty neat.

Update — June 29
I edited the page so when open­ing an item it will scroll to the top of your win­dow. So much bet­ter. Some help from Learn­ing jQuery and Marc Gra­ban­ski. I am using the jQuery.ScrollTo plugin.

Here is the updated code:

jQuery(document).ready(function($){
	var scrollTop = jQuery(window).scrollTop();
	$('#content > div.story').hide();
	$('#content > h2.title').click(function() {
		$('#content > h2.title').removeClass('active');
		$(this).addClass('active');
		var $nextDiv = $(this).next();
		var $visibleSiblings = $nextDiv.siblings('div.story:visible');
		if ($visibleSiblings.length ) {
			$visibleSiblings.slideUp('fast', function() {
				$nextDiv.slideToggle('fast');
				jQuery('#content > h2').each(function(i, h2){
				h2top = jQuery(h2).offset().top;
				if (scrollTop  h2').each(function(i, h2){
				h2top = jQuery(h2).offset().top;
				if (scrollTop < h2top) {
					jQuery.scrollTo('.active', 300 );
					return false;
				}
			});
		}
	});
});

An ongoing investigation: Browsing the www

I’ve had a very ter­ri­ble cou­ple of years com­ing up on the Inter­net. When it began, it was easy. I had my gate­way lap­top, I used IE until 2004 when I heard about Fire­fox. It was a sim­ple choice. Fire­fox had tabs, it was faster, it had the lus­ter of being open source. (In fact, it inspired my fanati­cism for all things open source). But in 2005 I got a tiny power­book and Safari was so cute and new. I was dis­ap­pointed with Fire­fox on my power­book. The wid­gets were ugly and pix­e­lated, noth­ing like aqua at all. At this point I was ded­i­cated to Safari, only using Fire­fox for sites that rejected Safari for what­ever reason.

But I wasn’t sat­is­fied. I started flirt­ing with other web browsers: Shi­ira, Opera, Omni­Web, Camino, Opti­mized Fire­fox builds… It was a con­fus­ing time. I exper­i­mented heav­ily. Even­tu­ally I began to fall in love with Camino. It had the ten­der­ness of real mac app, but also the cer­tain flare of being open source and dan­ger­ous like Firefox.

When I upgraded to Leop­ard, it was back to square one. I went with Safari for a while because Camino was strug­gling with 10.5. Then Fire­fox 3 came around with its hype and fancy Smart Loca­tion Bar. I fell back into my old ways. I was using a PC at work, Fire­fox felt right, cut­ting edge, cus­tomiz­able, fun.

Since then I’ve not set­tled. I can’t decide. I’m switch­ing weekly. Nobody has exactly every­thing I want. Here is where I stand now:

Safari 3

  • I love to use cmd-1, cmd-2, etc for links on the book­marks bar
  • You can­not set Google Reader as your default feed reader
  • In gen­eral, works fine, but
  • is bor­ing

Safari 4 beta

  • “Smart Address Field”, sim­i­lar to Firefox’s Smart Loca­tion Bar
  • Top tabs, makes sense.
  • Devel­oper Tools are very cool
  • Top Sites? Yuck!
  • Chokes here and there
    • Espe­cially in Word­press
    • And with the Tum­blr book­marklet: when I use a key­board short­cut to open, in my case cmd-1 because it is first on my book­marks bar, it opens into a new tab instead of a new win­dow. Very frustrating.

Camino

  • Uses cmd-1, etc for book­marks bar
  • Uses Key­chain to save passwords
  • Feels very at home in OS X
  • But but­tons suck in Leopard
  • Some sites still reject Camino

Camino 2 beta

  • But­tons fixed for Leopard
  • Del key no longer works for going back a page
  • Finally has drag­gable tabs
  • No smart loca­tion bar, which I’ve become very com­fort­able using

Fire­fox 3

  • No key­board shorcuts for the book­marks bar :-(
  • Doesn’t use Key­chain to save pass­words, which is very annoying
  • One mil­lion awe­some extensions

So I have no idea what to do. I was using Fire­fox for the last month, but last week I went back to Safari. It is hard to choose. What are you feel­ings? Do you have such trou­ble deciding?

Use This: Vanilla

I fre­quent a hand­ful of forums, and most of my favorites use Vanilla. Vanilla is great because the first view you see is a list of all recent dis­cus­sions instead of cat­e­gories, which is nice because it is only one click to read a thread rather than two or more. Also, the objec­tive of Vanilla is to be a min­i­mal­ist forum, not many default fea­tures, very fast, very exten­si­ble. Because Vanilla is very basic by default, it is fun to cus­tomize. I use it for Nice.

cargo-talk

These screen­shots are of some really nicely designed forums that I like. They are used as sup­port and bug report­ing for dif­fer­ent ser­vices. Sim­i­larly, I use a Vanilla pow­ered forum to man­age free­lance work and other projects.

indxr-forum

Any­how, use Vanilla, it is cool. Use it.

Moving Existential Media from Movable Type to WordPress

Over the last two days I moved Exis­ten­tial Media from Mov­able Type to Word­Press MU. Here is the process I fol­lowed to achieve this.

  1. Cre­ate new blog in Wordpress.
  2. Cre­ate the new author in Wordpress.
  3. Export posts from Mov­able Type blog.
  4. Import posts into Word­Press blog.
  5. Move Mov­able Type blog files to Word­Press blog files directory.
  6. Have Mov­able Type gen­er­ate a .htac­cess file to redi­rect old posts to new posts.
    Redirect 301 /merde/ http://existentialmedia.org/merde/
    Redirect 301 /merde/<$MTArchiveDate format="%Y/%m"$>/<$MTEntryTitle dirify="1" trim_to="30"$>/ http://existentialmedia.org/merde/<$MTArchiveDate format="%Y/%m"$>/<$MTEntryTitle encode_url="1"$>/
  7. Run sql find and replace to update links to files like images, mp3s, etc.
    update wp_2_posts set post_content = replace(post_content, 'http://existentialmedia.org/merde/', 'http://existentialmedia.org/merde/files/merde/')

The future of Existential Media

I’ve been lik­ing Mov­able Type less and less lately. A lot of the prob­lems stem from it being writ­ten in perl and per­for­mance issues related to that (I assume). I’ve been look­ing at dif­fer­ent ways to make Exis­ten­tial Media work bet­ter (faster) and be more sta­ble. I’ve done some opti­miz­ing lately of Mov­able Type and my tem­plates (as far as I can with my know-how), but it hasn’t helped ter­ri­bly. I’ve looked at dif­fer­ent hosts and host­ing plans, but there is always cost to con­sider, as well as effort it takes to move to a new host. So in the short term it looks like we are stick­ing with Mov­able Type and Dreamhost.

I’ve started to look at this prob­lem and set long term goals. Although I have learned a lot about Mov­able Type and although it would be a pain to learn a new plat­form, I’ve been “shop­ping” around. I’ve looked at Textpat­tern, which though I like a lot, wouldn’t be good at han­dling some­thing like Exis­ten­tial Media. It works bet­ter to power one site / one blog. Man­ag­ing users and per­mis­sions and blogs seems like it would not be fun. There is also Expres­sio­nEngine, but there is the prob­lem of cost, so that’s a no go. I’m get­ting to the point now. I’ve been heav­ily con­sid­er­ing using Dru­pal. Dru­pal is what is used to power the Onion’s web­site. I installed it and have been tin­kered around with it for a last cou­ple days. So far so good I guess. There is a huge learn­ing curve. It’s a whole new deal. I don’t really know how to come at it just yet. And they focus on being easy on the resources, which is also a good thing. I’ve also looked at Word­press MU, which is what they use to power wordpress.com. It might be exchang­ing one prob­lem for another, but Word­press is very fast and pretty. I’ve more or less decided to go with Word­press (that is, unless Mov­able Type is rewrit­ten in PHP or some­thing). Also, the most recent ver­sion of Word­press was designed by Happy Cog, which is pretty cool.

At first I thought heav­ily about going with Dru­pal, but I decided against it. Although it would work, Dru­pal doesn’t have blog­ging first in mind, it is a full fea­tured CMS. I also was hav­ing trou­ble get­ting to know it. Before I decided against it though, I started writ­ing this post. So I’ve mod­i­fied it. Here is my orig­i­nal game plan for Drupal:

I have to fig­ure out how this all works. I need to “port” my themes over to Dru­pal. I need to move all the data too. There is a Typepad/Movable Type con­ver­tor, but I’m not sure exactly how it will work. There is a list of things I can’t fig­ure out just yet and I thought it would be good to present here.

  • Giv­ing a user a blog: I’m a lit­tle con­fused about this. I want it to be like it is now. I give Laura a blog named lady­parts and it has a cer­tain design. And the con­tent does not get inter­mixed with the rest of the site. I’m not really clear how to man­age “blogs” yet. A project that I’ve been look­ing at is Dru­pal MU. This solves the prob­lem of hav­ing a dif­fer­ent theme for each blog. Some­things I’m con­fused about though. Like does the blog name always have to be the same as the user’s? (Like “Laura’s Blog” … existentialmedia.org/laura)
  • Hav­ing many users to one blog: I’m not really clear on how this would work. Think­ing about WIWT, how can I have a blog named “What I Wore Today” and have the url (/today) and have dif­fer­ent users post to it? Is this possible?
  • I need to fig­ure out how to have a list of the most recent posts on the home­page with the blog col­ors, but that might come once I fig­ure out the other things.

But since we prob­a­bly won’t be using Dru­pal, there is no need to worry any­more about that. Here is why I like Wordpress.

  • It is easy to man­age, and although it is very dif­fer­ent than Mov­able Type, I felt at home almost right away. It has the same idea of blogs and users, and try­ing out the import fea­ture it imported all the posts and com­ments on my blog flawlessly.
  • I did need to install one plu­gin right away to embed youtube, vimeo, etc which isn’t the most ideal. But was painless.
  • Word­press is very fast because it is writ­ten in PHP. I like this part a lot. No more rebuild­ing! I plan on installing one of the caching plu­g­ins too so we shouldn’t have any problems.
  • The only rea­son we aren’t there yet is that I have to fig­ure out the tem­plates. It looks to be not that hard, but will take some time. I want to make the tem­plates more eas­ily cus­tomiz­able and this seems pos­si­ble to do with Word­press themes.

Do you have any ques­tions? Fears? Knowl­edge to impart on this sub­ject? I would really like to be in com­mu­ni­ca­tion with every­body as much as pos­si­ble on this.

Ongoing Organization: Gmail Filters

labels.pngI’ve been really inter­ested in orga­niz­ing all my email mes­sages. But I don’t really want to go through every sin­gle mes­sage to do that. Today I tried to make some fil­ters in Gmail to at least get some gen­eral organization.

First I attempted to get all money related emails into one place.
To do this I looked for all the email addresses of my banks, stu­dent loans, online buying/selling, that kind of stuff. At first I was get­ting every address, but I real­ized it would be much faster to grab whole domains. So this is what I did.
from:(@cems.wamu.com OR @ebay.com OR @amazon.com OR @wellsfargo.com OR @mint.com OR @checkout.google.com OR @paypal.com OR billing@dreamhost.com)

Then I wanted to try and orga­nize emails with attach­ments by file type.

For images
Has the words:(.jpg OR .jpeg OR .gif OR .png) has:attachment

For media
Has the words:(.avi OR .mov OR .mp3 OR .m4a) has:attachment
For doc­u­ments
Has the words:(.pdf OR .doc OR .docx OR .xls OR .xlsx OR .ppt OR .pptx OR .oo3) has:attachment

For design
Has the words:(.ai OR .psd OR .indd OR .qxd) has:attachment

The one prob­lem that I’ve run into so far with this is with PDFs. About half of the pdf emails are related design. This is also a prob­lem with Fire­works PNGs.

This is by no means com­plete. It is only a quick stab at email orga­ni­za­tion. Hence “ongo­ing.” If you have any ideas on how to improve this or any fil­ters you’ve set up that work well, comment.

I helped

certificate.png