A video intro to web feeds
Sat 28 Apr 07 01:59 | Tags: Blogging, Guides, Internet
A site called Common Craft has created a short video on web feeds. The short, casual, quick-paced video helps to graphically explain the concept of web feeds in a simple way anyone can understand. If you have yet to become a feed addict like me, watch the video and give it a try.
I found this video via a post at Dosh Dosh. What I found interesting is that both this video and the post at Dosh Dosh recommend that you use one of the many web-based feed readers, like Google Reader, Bloglines, Pageflakes, Netvibes, or so on, instead of using an actual feed reader application. As I've mentioned before, my preferred feed reader is Vienna, which is an actual OS X application, not something I use through a web browser. But it's interesting that as new people are discovering this cool new tech of web feeds, so many people are first turning to web-based solutions instead of standard applications. This is perhaps a reflection of the coming-of-age of serious web-based applications, a concept which I myself am beginning to warm to.
Then again, as someone who's making my own sort of web-based feed reader/aggregator in the form of Siteb.us, I guess I shouldn't be so surprised…
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
0 Comments | 0 Trackbacks |
| ![]()
The easiest way to use OS X fonts with GIMP
Fri 13 Apr 07 21:47 | Tags: Command Line, Guides, Mac, Software
Judging by RGR's stats, the most popular articles when it comes to hits from search engines have been those I've written about MacPorts. So I guess I should invite some more hits and write a little bit about it again, albeit somewhat indirectly.
If you've been reading RGR for a while, you've probably figured out that I'm a bit of a tightwad. I'd like not to be, but at this point in my life I'm not in any sort of position not to be, unfortunately. I can't really afford to do my image editing with the $650 Adobe Photoshop, as much as I'd like to (and, being a programmer myself, I can't pirate it). So instead I use the free open-source image editor GIMP, which can be easily installed via MacPorts. It falls short of Photoshop's capabilities in many ways, and the fact that it's not a "true" Mac OS X app and I can't copy-and-paste between it and other apps is pretty annoying, but it does the job, and you can't argue with the price.
When you first install it, it is somehow smart enough to find all of the standard OS X fonts, and make them available in GIMP. I'm not sure how it does this (I'm not a Unix expert; I just play one on the internet), but it's pretty handy; early on in OS X's history, when you installed GIMP, you'd just have a short list of plain and/or ugly Unixy fonts to choose from. However, if you've installed any new fonts besides the ones that come with OS X, those new fonts won't show up in GIMP's font menus. If you poke around the internet, you'll find various tips and tricks for getting your new Mac fonts to work with GIMP; I recently ran into this problem myself. I found another solution, however, and I believe the method I'm about to show you is the best and the easiest – in fact, I'm surprised I haven't come across it before.
This solution assumes you've installed your Mac fonts in the standard way; by double-clicking on them in the Finder, which causes Font Book to launch, then clicking Font Book's "Install Font" button. Installing fonts this way puts the font in the Fonts folder inside your Library folder, which is in turn inside your home folder – in Unix terms, in ~/Library/Fonts/. So all we need to do is tell GIMP to check for fonts there.
First, open up GIMP's preferences; select "Preferences" from the main "File" menu. Note that "Preferences" does not appear in the "File" menu attached to a GIMP document; you have to choose the "File" menu in GIMP's palette window, the one with the title "The GIMP." Yes, this is confusing. Thank you, Windows, for your inspirational innovations in user interface design.
Here's what the Preferences window looks like. Click the triangle next to the "Folders" item in the list on the left (labeled with a red 1 in this picture); this will make several folders appear below it. Click the Fonts item (2). A list of folders will appear to the right side of the window, but there will only be one item in the list; this is where GIMP is currently checking for fonts to use. You could copy fonts into this folder and have them show up in GIMP, but that'd be a pain; what we'll do instead is tell GIMP to also look in the folder where our fonts are already being stored.
To do this, click the icon that looks like a file (3). Then click the button with the ellipsis (4). In yet another wonderful stroke of obvious user interface design, this will bring up a navigation box that will let us choose the folder to add. It should show your home folder. Double-click on the Library folder, then click on the Fonts folder and click the OK button. That should close the navigation box and bring you back to the Preferences window. Click the Preferences window's OK button. GIMP will show you a little note about how you need to restart GIMP for the changes to take effect; click the OK button, then go ahead and quit and restart GIMP. Ta-daa! You should now see your installed fonts in GIMP's fonts menus.
An aside: If you're Unix-savvy, you may have noticed that there are not actually any fonts in GIMP's default font folder, ~/.gimp-2.2/fonts/. So how is GIMP seeing the standard OS X fonts? Answer: I don't know. I'm curious, though; if you can enlighten me on this, please do so in the comments.
Also, if you have any questions about MacPorts (or GIMP), please don't be afraid to mention them in the comments, or, if you're shy, contact me directly.
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
8 Comments | 0 Trackbacks |
| ![]()
Flippin' iSight pictures
Sat 31 Mar 07 04:55 | Tags: Guides, Mac, Software
All Apple MacBook and MacBook Pro laptops come with a built-in iSight camera. The camera is built into the frame of the display of the laptop and faces inward. Thus, it's best suited for taking pictures of yourself. Apple includes an application to facilitate doing just that, called Photo Booth. It's not fancy -- the resolution is low compared to other inexpensive cameras nowadays, and the picture is grainy -- but for a tiny, built-in camera, it works well enough to do the job. However, a few weeks ago, I was joking around with some friends on IRC and we were taking pictures of ourselves with dumb signs and stuff (hey, come on, it's the internet; I'm not going to be doing serious research and stuff all the time) when I noticed a quirk with the program.
By default, Photo Booth flips the image as a mirror would do, instead of taking an unflipped image like a normal camera would. Previously, just taking pictures of myself without the sign, I never noticed that.
Fortunately, it's easy enough to flip; you can just select the photo after you've taken it, then select Flip Photo (Command-F) from the Edit menu. Or, to make sure future photos are correct, you can select Auto Flip New Photos. As you take the photo, the preview will still be mirrored, but after the picture is taken it will be un-mirrored as a normal camera would capture. No worries if you forget to turn this setting on, though; flipping the photo after it's taken does not seem to cause any destructive recompression of the image, as far as I can tell. You can hold down Command-F to flip the image hundreds of times rapidly, but it happens pretty fast and the quality doesn't seem to deteriorate, so I guess it's just tweaking some bit of metadata.
Ah, that's better. Now you can more clearly see that my handwriting has not improved since the first grade.
(If these images look like they were taken in my bathroom, well, they were. I did up this article at night, and the bathroom has the best indoor lighting in the whole place, so please forgive the kitsch.)
A while later, I wanted to make a video of a Nintendo DS game. I can capture video from the iSight using iMovie pretty easily, but again, this was only easy if I captured video of myself; trying to capture the DS was a bit of the pain. The difficulty comes from the placement of the inward-facing camera. If I turned the game system toward the camera, then I couldn't see its screen and couldn't play the game while recording. If I turned the laptop around and put it between my arms, I could see the game system's screen, but not my laptop, so I couldn't check to see if the DS was properly centered in the camera, and it would be rather uncomfortable to have to stretch and bend my arms around the laptop like that. The best compromise I could find was to tilt the lid of my laptop down so that it was over the DS. This let me see both the laptop and the DS screens at the same time, but as the DS was still facing me, it appeared upside-down in the video.
Fortunately, I found a way to fix that using iMovie's special effects tools. iMovie has a Mirror effect which was apparently designed to only mirror part of the image, for America's Funniest Home Videos circa 1991-style effects. However, it's pretty easy to tweak the settings so it flips the entire part of the image. So:
- Select the video clip you want to mirror.
- Click the Editing button.
- Click the Video FX tab.
- Select Mirror from the list of effects.
- Set the Effect In and Effect Out sliders to 00:00 by dragging them completely to the left.
- Drag the Vertical and Horizontal sliders completely to the right to apply the effect to the whole image.
- Click the Apply button.
Viola. Here's an example of the effect in action.
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
2 Comments | 0 Trackbacks |
| ![]()
More MacPorts tricks
Sat 10 Mar 07 15:00 | Tags: Command Line, Guides, Mac, MacPorts
It's been a while since I wrote anything about MacPorts, so let's revisit it, shall we? Those of you who are entirely unfamiliar with MacPorts may wish to skip this article; it won't be of much use to you.
As I mentioned earlier, I was recently toying with the idea of switching to WordPress for this blog. In order to test WordPress out, I installed it on my own computer before installing it "live" on the public web server.
WordPress requires MySQL. I installed PHP without MySQL on my computer because I personally don't use MySQL; I prefer to use SQLite whenever I write programs that need to use a database. So I needed to add MySQL support to my PHP installation before I could use WordPress. Fortunately, I'm using MacPorts, so that's going to be pretty easy to do. There's a few different ways to go about it, though.
As I said in that earlier article, I could have used a "variant" trigger when I first installed PHP to add MySQL support. A list of possible variants for a port can be found by typing port variants portname:
Monster:~ Albright$ port variants php5
php5 has the variants:
universal
darwin_6
darwin_7
darwin_8
freebsd
macosx
apache
apache2
fastcgi
snmp
macports_snmp
mysql3
mysql4
mysql5
postgresql
ipc
pcntl
pear
Monster:~ Albright$
And you can see what variants your currently-installed port is using (as well as the version of that program) by using port installed portname:
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.0_0+darwin_8+fastcgi+macosx (active)
Monster:~ Albright$
(Just typing port installed will list everything that MacPorts has installed on your system and their versions. It may be a pretty long list.)
So I want the mysql5 variant on my PHP 5 installation. How should I go about that? It depends on circumstances.
Adding variants through upgrades
If the version of the port you currently have installed is out of date, you can choose to change the variants of the installation when you upgrade it. To check if an installed package is outdated, use port outdated portname. In this example, my SQLite installation is out of date.
Monster:~ Albright$ port outdated sqlite3
The following installed ports are outdated:
sqlite3 3.3.11_0 < 3.3.13_0
Monster:~ Albright$
But if you just get a blank line after the first line, then the package is up-to-date. In this example, my MySQL installation is current.
Monster:~ Albright$ port outdated mysql5
The following installed ports are outdated:
Monster:~ Albright$
In the above example, I had PHP5 version 5.2.0_0 installed. But it looks like it's out of date!
Monster:~ Albright$ port outdated php5
The following installed ports are outdated:
php5 5.2.0_0 < 5.2.1_1
Monster:~ Albright$
So I can upgrade it using the upgrade command, and specify my desired variants. MacPorts will respect those variants as it installs the new version of the package. (Remember that we need to prepend commands with the sudo command and type our password whenever we run a command that will install or remove files.)
Monster:~ Albright$ sudo port upgrade php5 +fastcgi +mysql5
Password:
---> Fetching php5
[...]
---> Activating php5 5.2.1_1+darwin_8+fastcgi+macosx+mysql5
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5 (active)
(You can get a list of all out-of-date installations by using just port outdated (with no port name), and upgrade all outdated ports at once using port upgrade installed. Be sure not to use port upgrade all, as that will try to install every single port available on your system! I found out that little fubar by personal experience, needless to say…)
Brute force reinstallation (avoid it!)
But what if your installed version of the package was already up-to-date? MacPorts won't let you upgrade an up-to-date installation, even if you try to specify different variants; it will fail silently.
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx (active)
Monster:~ Albright$ sudo port upgrade php5 +fastcgi +mysql5
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx (active)
How can we force MacPorts to rebuild the package with the new variants? Well, we can make like Luke and use the force… flag. Adding -f to a command forces MacPorts to follow a command, even if it doesn't think it's a good idea to do so. I generally recommend you never use this flag with MacPorts; it can make for some unpleasantness. However, using it with upgrade won't foul things up too much. It's a bit slow, because it seems to also fetch and reinstall all of the dependencies for the package you're trying to reinstall, but it works eventually.
Monster:~ Albright$ sudo port upgrade -f php5 +mysql5 +fastcgi
Note that you'll probably see some dire-looking warnings stating "Warning: Uninstall forced. Proceeding despite dependencies." Don't worry; all of the dependencies that it's uninstalling are being immediately re-installed anyway. Like I said, it's not pretty, but it works.
Cohabitation
But here's the coolest and most pleasant way to get around this problem. MacPorts is smart enough that it can handle multiple installations of the same package at the same time, so long as each installation has a different version number or different variants. Watch this:
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx (active)
Monster:~ Albright$ sudo port install php5 +fastcgi +mysql5
Password:
---> Fetching php5
[...]
---> Activating php5 5.2.1_1+darwin_8+fastcgi+macosx+mysql5
Error: Target com.apple.activate returned: Image error: Another version of php5 (5.2.1_1+darwin_8+fastcgi+macosx) is already active.
Error: Status 1 encountered during processing.
Uh oh, but it caused an error! No problem, really.
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx (active)
php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5
See? I've got two installations of PHP now. However, the one without MySQL support is not "active;" it's not the PHP installation that the computer is going to use. MacPorts gives us two commands to change this; deactivate and activate. deactivate essentially "turns off" an installation without uninstalling it.
Monster:~ Albright$ sqlite3 -version
3.3.11
Monster:~ Albright$ sudo port deactivate sqlite3
---> Deactivating sqlite3
Monster:~ Albright$ sqlite3 -version
-bash: /opt/local/bin/sqlite3: No such file or directory
Monster:~ Albright$ sudo port activate sqlite3
---> Activating sqlite3
Monster:~ Albright$ sqlite3 -version
3.3.11
Monster:~ Albright$
As you can see, the usage is pretty simple: activate portname and deactivate portname. However, if you try to use it like that on a package you have multiple installations of, MacPorts rightly becomes confused. So to use these commands (as well as others, such as uninstall) on packages with multiple versions, you have to specify the version you wish to act on exactly as port installed labels them. You may find it helpful to do as I do and copy-and-paste the version numbers. So here, I'll disable the PHP installation without MySQL, and enable the one with MySQL:
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx (active)
php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5
Monster:~ Albright$ sudo port deactivate php5 @5.2.1_1+darwin_8+fastcgi+macosx
---> Deactivating php5 5.2.1_1+darwin_8+fastcgi+macosx
Monster:~ Albright$ sudo port activate php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5
---> Activating php5 5.2.1_1+darwin_8+fastcgi+macosx+mysql5
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx
php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5 (active)
Monster:~ Albright$
Now, if I wish, I can uninstall the non-MySQL installation without any whining about dependencies or anything like that, because I already have another current and working installation on my machine.
Monster:~ Albright$ sudo port uninstall php5 @5.2.1_1+darwin_8+fastcgi+macosx
---> Uninstalling php5 5.2.1_1+darwin_8+fastcgi+macosx
Monster:~ Albright$ port installed php5
The following ports are currently installed:
php5 @5.2.1_1+darwin_8+fastcgi+macosx+mysql5 (active)
Monster:~ Albright$
This is a much prettier solution than the brute force method.
This "cohabitation" of installations can also work with two different versions of the same package. So, for example, if you're using version X of a vitally important application, and version Y has come out, you can install and activate version Y and test it out without uninstalling or installing over version X; just remember to use install portname instead of upgrade portname. If it turns out version Y is buggy or faulty, you can the very easily deactivate it and reactivate version X without causing too much downtime.
MacPorts is a powerful program for managing the more Unix-y software on your computer. It can be a bit tough to use at first, but as the above shows, its learning curve allows for some pretty convenient functionality -- and it's definitely still easier to use than compiling and installing applications and dependencies "by hand." If you have any questions about MacPorts, please post them in the comments or email me, and I'll try to help you out.
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
2 Comments | 0 Trackbacks |
| ![]()
Automatically junk spam messages with images
Mon 26 Feb 07 21:23 | Tags: Guides, Mac
I use Apple's standard Mail client for my email. It has a built-in spam filter, but unfortunately, the filter doesn't quite seem smart enough at filtering out spam messages where the sales pitch is located in an image attached to the message, as is increasingly common nowadays, instead of in text in the body of the email. However, I've found a simple way to make sure that these spam messages don't make it into my inbox. I'll show you how. It should be applicable to most other email clients as well.
The trick lies in the fact that the images attached to these junk mail messages are invariably in the GIF image format, and that Mail lets us filter messages based on the filenames of attachments. So we're going to create a "rule" (other email clients call this a "filter") that will automatically move a message to the Junk folder if it contains an attachment which has a filename ending in ".gif". To do this:
- From inside Mail, select "Preferences…" from the Mail menu.
- From the toolbar at the top, select "Rules."
- Click the "Add Rule" button at the right.
- This window can be a bit confusing, so I'll just show you an image of how it should look. Note that the full name of the "Any Attahment Na" menu item is "Any Attachment Name;" that's a bit long, so OS X is truncating it when the menu isn't open. If you want the message to be moved to another folder besides the Junk folder, feel free to change that part. Click "OK" when you're done.
- Mail will ask you if you want to "apply your rules to messages in open mailboxes." Go ahead and click "Yes."
- Close the Preferences window.
That does it. Now, whenever you get a message with a GIF attached, it will automatically be moved to the Junk folder, even if Mail's standard spam filtering algorithms don't think it's spam. Note that this won't work for all images, so whenever my aunt sends me family photos via email, Mail doesn't junk them because those images will be in JPEG format. I've yet to have this method register a false positive. There is one oddity, though; if Mail checks your mail and finds nothing but spam, it won't notify you. If it downloads any messages that it doesn't think are spam, however, it will notify you, even if those messages aren't in your inbox. So sometimes Mail will download a message which will be sent to my Junk folder by this rule, then make its "new mail" noise. But when I switch to the program, there's actually no new mail in my inbox. I think that's a minor annoyance, though, compared to the major annoyance of all those manhood enhancement and investment opportunity messages that were slipping through.
Get more great Ray Gun Robot content sent directly to your feed reader or email inbox! Subscribe today!
Articles & Links — Via Email
Articles Only — Via Email
2 Comments | 0 Trackbacks |
| ![]()

