If you’re anything like me and you have to print to an old AppleTalk printer, server, or RIP, -my condolences- keeping up-to-date and bridging that old connection becomes more difficult every decade. You are left with two choices; Keep an oldish Mac on hand capable of running Mac OS X 10.5 or earlier (a Power PC (PPC) is best in order to run the only browser using a modern cipher suite, TenFourFox from the brilliant and beautiful people at floodgap.com) or you can run an OS built on GNU+Linux, even as virtual machine, and have a fully modern desktop OS. Although in a VM a headless console will have a smaller footprint.
Continue reading
Tag Archives: fixit
Postfix PCRE TLD body check
This is used to reject spam e-mail containing a URL to the top level domains .date or .loan, and can of course be modified to include others. If you feel your users may ever have a legitimate need to be contacted about these domains it would be best to not use this.
Some familiarity with perl compatible regular expressions in postfix will be helpful.
/https?:\/\/([a-z,0-9,-]+\.){1,3}(date|loan)\// REJECT
This pattern matches both http and https protocols, and links containing from 1 to 3 subdomains of the TLD (http://3.2.example.com/ or https://example.com/ would match were .com the target).
Insert that line into your custom body checks file and no more spam du jour. Enjoy.
OS X Server 5 Shenanigans
OS X Server 5 for OS X 10.10. and 10.11, while a significant improvement to Lion Server for OS X 10.7, still behaves oddly when mixing SSL and non-SSL requests. Whereas before it wanted every request redirected to the SSL pipe, now it will let you do either. It won’t, however, let you do both.
WordPress will try to do both. Why? I dunno. It should work, and did on plain Apache 2, but OS X Server 5 puts up a proxy to the WAN and serves from a different port. This is not presented upfront to the Server.app user, but is most likely in the docs. RTFM much? Ha-ha! No.
The affect this had on my WordPress install is instead of logging in being presented with a page that merely stated,
You don’t have permission to view this page.
Or some such equally helpful information. A little web searching turned up the answer. To overcome this the following can be added to wp-includes/http.php
/* Adding this BS for OS X Server 5 being a dick... */
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS']='on';
}
I saw a post on wordpress.net that said to put this into config.php, but that did not work for me. Neither did the mod_rewrite mumbo-jumbo in that thread and apparently it didn’t for the OP, either.
I admit being ignorant to what HTTP_X_FORWARDED_PROTO is, but it appears to be a HTTP header from an Apache mod Apple is running. Unique to them or something well known? I dunno. I don’t pretend to try to keep up with this stuff any longer. That’s why I went to WordPress; So I wouldn’t have to.
MTB conversion
In my quest for a better street bike I can either spend a few hundred on a used better model bike or a new low end model bike. Or I can convert my aging, better model MTB, a 19″ 1992 Trek 930 hardtail.
Tires were 1.95 knobbed, now 1.5 road tires. Makes for a noticeably stiffer ride. Though it actually seems harder to pedal. Since I’m as out of shape as I’ve ever been I cannot rely on this assessment.
Chainrings (110BCD) can be replaced with some slightly larger ones. Outer chainring is already 48t, but I can fit a 54t on it. They really do need to be replaced as it is, so why not go a little more road worthy? Sugino makes a set that will increase the outer and granny gear, letting me keep my crank and derailer.
Handlebar (upright) will likely not be replaced with a drop bar since I would need to replace the stem as it’s a one-piece high rise, but an aerobar might help.
In the end I’m still torn because I’d be making a workable tank of an MTB into a Frankenstein road bike that never will be one. At this point, I think stopping at tires is enough.
iPhoto import from folders AppleScript
Preface: Having upgraded my phone (Nokia N8) firmware to “Belle” — whatever version that is, the Nokia Multimedia Transfer application no longer imports photos to iPhoto.* Tragic because the camera is the sole reason I bought this phone. Ordinarily this would not be a problem since the phone uses a “DCIM” folder at the drive root and can store images with 8 character names (5 of which you set yourself). But not every photo app does store them there or with a “proper” name. Even though there exists an “Images” folder in the drive root that I know gets used, Mass Storage.app does not access it. Could be another naming convention similar to DCF
This is an AppleScript to get around this limitation, and to allow (in my case at least) the importing of camera files named by date. In short you choose which folders you want this script to tell iPhoto to import from and can be used with any folder(s), no specific device required.
Notable: Uses ‘defaults’ to store and load folder paths in a property list (.plist) file.
Continue reading
Hide thumbnails of certain users content on Flickr
Using CSS you can identify and hide thumbnails from users. Makes it a bit easier to skip past or ignore people who can’t help but taint your favorite groups with inappropriate or offensive material or idiotic political themed collages. Nothing kills my buzz like having the local flora, fauna, and other interesting things interrupted with fear mongering hate rhetoric.
/**** A-holes on Flickr ****/
a[href*="/USER_ID/"]:before {
content: "NUTJOB ";
}
a[href*="/USER_ID/"] img {
display:none !important;
}
This does not hide the actual content on its own page or disable any links. It just lets you easily identify items to avoid while hiding the thumbnail.
The USER_ID can be culled from the URL the item resides at. For instance my ID in context: http://www.flickr.com/photos/strawhousepig/ Keep in mind that not all IDs are human readable. The default value is a seemingly random string.
Mac ready “lightbox” close widget
I use a Mac, you use a Mac. Our close window button is in the top left corner of the window so it’s convenient when a JavaScript pop-over puts the “button” there, though most don’t. A few I run into I’ve decided to throw some CSS at to fix them.
/**** Mac ready "close" widget ****/
/* WordPress admin "More info..." */
div#TB_ajaxWindowTitle {
position:absolute;
top:0px;
left:25px;
float:none !important;
display:inline !important;
}
div#TB_closeAjaxWindow {
display:inline !important;
float:left !important;
clear:left !important;
}
/* Amazon */
div.ap_close {
left: 24px !important;
}
span.ap_closebutton {
float:left;
clear:left;
}
/* "Fancybox" */
a#fancybox-close {
left:-15px !important;
}
/* "MultiBox" */
div.MultiBoxClose {
left:-26px !important;
}
/* Disqus profile */
a.dsq-modal-close-btn {
position:absolute !important;
top:10px !important;
left:10px !important;
}
This would of course go into your user defined CSS file. Which in Safari can be added at Safari > Preferences | Advanced – Style sheet:
AppleScripted file contents search using grep
This is a workaround for the Finder insisting on starting a search of the entire HDD on every new search rather than the good ol’ days of 10.3 which was to search in the directory you were staring at. I know you can click a button to switch it, but every time? No, I like the old way better.
Continue reading
Redirect old URI’s to new WordPress posts using PHP
In my case I migrated from a custom blog to WordPress. My old one used a GET string in the URL to define which post to load and now I’d like to redirect one and maybe others to their WordPress counterparts.
Continue reading
Steam client for Macintosh
What a pile. All it is is a web browser. That’s pretty much it. And a poor one at that.
Instant beefs:
- It installs games as hidden files not applications.
- It runs a process named ‘ipcserver’ that remains alive after you quit the client.
- The UI is non/sub-standard.
- It doesn’t clean up after itself if you relaunch after force quitting it which then prevents it from starting* (though the ‘ipcserver’ seems to have no trouble starting).
To overcome that last item (which throws an error stating “steam engine instance already exists”) you have to manually remove a couple of files from /private/tmp. In Terminal type rm /private/tmp/*-steam-mstr-* and press return, then launch Steam.
*[UPDATE] Newer clients (the About window doesn’t actually list a version. More Steam on Mac “goodness” 😐 ) will launch after a force quit by apparently recycling the left over files which needed to be removed manually before.