Oct 27

I always find these commands handy when working with apache.

Part of any VirtualHost config involves making the right directories and you can make your job easier by using curly braces. I suppose you could call it regular expressions. I don’t actually know the technical terms for it. I know it works in bash which is what I use on a daily basis.

Learn how to create directories without having to issue multiple mkdir commands. This is a pretty simple one.

mkdir -p /path/to/some/vhost/docs

This is fairly straight forward. Make the parent directories if they don’t exist. So if /path/to/some/vhost/docs is what you want, and /path or any of it’s children don’t exist, then it will get created. It’s a fairly safe command because it intelligently checks before creating directories.

This example is a bit more complicated but it’s awesomeness will blow you away. I used this when I was making virtualhosts for multiple domains or even sub domains of the same parent.

mkdir -p {sub1,sub2,sub3}.domain.com/{docs,logs,cgi-bin}

or

mkdir -p www.{domain1,domain2,domain3}.com/{docs,logs,cgi-bin}

that command will create all your directories in the appropriate hierarchy so that you don’t need to issue multiple mkdir commands. It will create the parent directories for you as well. Here is what it does.

$ find .
.
./www.domain1.com
./www.domain1.com/cgi-bin
./www.domain1.com/docs
./www.domain1.com/logs
./www.domain2.com
./www.domain2.com/cgi-bin
./www.domain2.com/docs
./www.domain2.com/logs
./www.domain3.com
./www.domain3.com/cgi-bin
./www.domain3.com/docs
./www.domain3.com/logs

You can also do that with ls.

$ ls -d www.domain{1,2}*
www.domain1.com    www.domain2.com

Or even with rm

$ rm -vr www.domain{1,3}*
www.domain1.com/cgi-bin
www.domain1.com/docs
www.domain1.com/logs
www.domain1.com
www.domain3.com/cgi-bin
www.domain3.com/docs
www.domain3.com/logs
www.domain3.com

Enjoy!

Tagged with:
Oct 10

It’s my very first Wordpress plugin!

Tweeps4WP is a very simple WP widget that connects to twitter using your credentials and then gets the list of people that follow you or that you’re following I think they’re called tweeps. So spruce up your side bar with something a bit more unique.

It can display this list as “mini” profile images or as “normal” profile images. It also provides a link to the full list of whatever group you’ve chosen to display along with a link to your twitter home page. You can customize the title to fit your needs.

Unfortunately for those of you who are super security crazy, you’ll probably not like this little tid bit.

Tweeps4WP requires you to provide your twitter account password.

It stores in in the wordpress options table as clear text. It’s never displayed on the screen. Not even in the configuration panel in the dashboard so it can’t be copied out of the browser once it’s been saved. Hopefully that will ease your concerns a little bit.

I am considering changing the behavior by allowing an option that will let you provide the user whose tweeps should be displayed so you’re not storing your super secure twitter creds in a database.

You can see it in action (doing nothing) on the right side of this page. Twitters limitation is that it will only give you 100 tweeps at a time. That’s fine by me considering tweeps are listed reverse chronologically. People will see the most recent ones at the top.

I don’t know why i used that name. In retrospect, I should have called it something else.

Download

The download link is not active yet as it’s not officially released. I still have a few more kinks to work out if they can be worked out.

Changelog

Version 0.0.5
-bug in 0.0.4. Found immediately. normal images were no longer displaying correctly. Fixed it so mini resizes to 24×24 and normal to 48×48.

Version 0.0.4
-mini images from twitter aren’t always mini. They’re called mini but sometimes they’re normal. This update ensures that all images are resized to 24×24 just like twitter.com does.

Version 0.0.3
- got rid of the ugly error messages that appear when you provide a bad password. Just displays a message instead of broken code errors.

Version 0.0.2
– Fixed issue with justification of photos. Tested in Firefox, IE7, Safari, and Opera. Particular themes may decide to display this widget differently.
– Theme jQ does some goofy stuff with CSS which breaks the way that Tweeps are displayed. I will try to fix this in 0.1.0.

Version 0.0.1
– Initial release.

 

Tagged with:
Sep 23

So, I got some direct feedback from some folks and for the most part it was good. I ran over my time by a little bit and fudged up some of the pages a bit. So definitely some room for improvement. Peggy says I used the words “uhh, umm, like, right?” quite a bit and that’s also something to improve upon. I’d like to think I’m eloquent but in the heat of the moment, all the control over that just goes out the window.

I didn’t know we were going to get a room that big actually. The last time I was there, we were cramped in a smaller space. I’m glad it worked out for us. It’s also a good thing I brought my mini-displayport to VGA adapter.

Michael Schaffner, who runs the group, said it was great and that he got lots of good comments from the presentation. I quote

I just wanted to drop you a brief note to thank you again for last
nights presentation. We have been planning this thing for a long time,
but it was without a doubt worth the wait. I found your presentation
outstanding and the amount of time you put into getting it together
was very apparent. We drew a great crowd and many first time
attendees. It was nice to have someone with such great presentation
skills deliver so much valuable  information. It reflects well on our
group and  guarantees that first timers will return for more. In fact
upon my return home last night I had already received e-mails about
the meeting and registration for next month.

I understand the amount of time and effort it takes to put together a
presentation and I want you to know how much I truly appreciate you
stepping up and volunteering to present. Our group has always been
dependent on the contribution of generous folks like yourself willing
to share.

Well, that is just awesome! I felt quite appreciated and I also felt good about myself. Made some new connections and some people who are really trying to get around the PHP “issue”. Learning new things is always tough especially when you’re the only one responsible for learning. No one is pushing you to do it and so it becomes very easy to cast it aside and focus on things you enjoy doing. We’re all guilty of it. I’ve been trying to learn Flex and iPhone programming for months now but I prefer the TV it seems more than anything when I get home. We all have uphill battles and some are more difficult to conquer than others. But if you try, I think you’ll make some progress and it’s enough to get the ball rolling. That’s what I learned on Monday night.

I’m looking forward to doing more presentations to help people and to help myself.

Picture from the back of the room from Peggy's Blackberry

Picture from the back of the room from Peggy's Blackberry

That’s a picture of me (sort of)  basking in the warm glow that the macbook screen emits.

Tagged with:
preload preload preload