Category Archives: Uncategorized

Zip droplet

This has been some hot garbage since I posted it. This is now actually not bad, but I can’t help but feel it’s clumsier than it could be. *meh*

Quick and dirty AppleScript droplet to zip files in the Finder.

-- http://strawhousepig.net/

-- Default location to save the .zip file.
property def_loc : path to desktop

-- This script will not send files beginning with '.' (dot) to be zipped.
(*
If you're going to be sending zip archives to a location other than
a file-system domain (directories which the system has a 'nickname' for)
 I believe the above syntax would be:
  path to file "My HD:My Folder Daryl:My Other Folder Daryl:"
Or using POSIX style path
  path to POSIX file "/My HD/My Folder Daryl/My Other Folder Daryl/"
Although I am not sure about that. Another alternative would be to add an
if clause in the zip_it function to check for the "same" setting and then
use the container of item 1 of the files list "_it" as the default location.
*)

-- Not quite sure how to use this, in the AS routines or 'zip -x' or screw it and drop files beginning with a dot?
--property no_can_zip : {".DS_Store", ".fseventsd", ".Spotlight-V100"}

on run
  tell application "Finder"
    set _it to selection as list
  end tell
  my zip_it(_it)
end run

on open _it
  zip_it(_it)
end open

on zip_it(_it)
  set _f to ""
  tell application "Finder" to set _dir to container of ((item 1 of _it) as alias)
  set my text item delimiters to {POSIX path of (_dir as alias)}
  repeat with i in _it
    if first character of name of (info for (i as alias)) is not "." then
      set _f to _f & " " & quoted form of text item 2 of (POSIX path of (i as alias))
    end if
  end repeat
  set the_c to count of _it
  if the_c > 1 then
    set z_name to (displayed name of (info for (item 1 of _it as alias))) & " + " & (the_c - 1) & " items.zip"
  else
    set z_name to (displayed name of (info for (item 1 of _it as alias))) & ".zip"
  end if
  set _z to (choose file name with prompt (the_c as string) & " file(s) to zip." default name z_name default location def_loc)
  do shell script "cd " & quoted form of POSIX path of (_dir as alias) & " && zip  -ry " & quoted form of POSIX path of _z & _f
end zip_it

Convert PDF to grayscale using GhostScript

[UPDATE] Huge caveat! While this is really meant to deal with RGB documents or objects, it does also convert CMYK and spot colors to grayscale. Unfortunately spot colors remain as separate plates that retain their name. This results in them being printed in color though on screen they appear gray. At least the colors (Pantone) and printer I tested on took spot channels and ripped them according to what they are named. If your printer does not have it’s own rendering library that matches your spot color names then I’m guessing they will print as grayscale.

It is possible to rasterize the art, which results in a pure grayscale, but you need such a high resolution even a simple business card with type and line art increases in size at least 30 times. I knew this was all too easy…

This script / app / droplet will convert a PDF or PostScript (.ps) document from whatever colorspace it lives in to grayscale. Has not been thoroughly tested. I mean, I ran it against a couple of files. One to work out the gs command, the other to test if it actually made a grayscale duplicate. That file was generated by MS Word so was of course RGB. The converted document was in fact true grayscale. I would say it converted to what you would get if you used a gray gamma 2.2 profile.
Continue reading

Speaking against the media narrative of motor vehicle collisions

As a once/sometime/hopefully again vehicular cyclist, a father, and a driver who tries to change my own attitude toward driving and motor vehicles, I consider myself part of the Crash Not Accident crowd. And this is my comment/rant on a recent article about a “truck getting into an accident with a pedestrian” (to paraphrase it).

Genericized and placed here for possible future use. This may be expanded on at some point.

Drivers don’t get cited because society gives us a pass. That’s starting to change but we need publications like this one to get on board. When describing a collision involving a motor vehicle do not attribute it to the vehicle. The truck didn’t hit the pedestrian, the driver did.

Also, drop the term “accident.” When an outside force is not involved these crashes and wrecks are *never* an accident. Faulty manufacturing, poor maintenance, and especially lack of due care while driving are all 100% preventable by a person making a better choice. The smoldering wreckage and broken bodies of a motor vehicle collision are consequences, not accidents.

Driving is by far the most dangerous thing most people will ever do. It’s past time to (once again) see it for what it is. Maybe then tens of thousands of people wouldn’t be killed year after year after year.

Cyclists behaving badly? Riding group won’t share the road [Because there isn’t room to]- YouTube

This “news” piece is a disgusting example of stoking motorist elitism and violent attitudes. I feel a few things need to be made straight:

  • There is not room for a car and a bicycle to safely share those lanes side-by-side. Repeat that.
  • Taking the lane is done to cause a motorist to not try to squeeze past with their multiple ton metal box in a lane that does not accommodate that safely. Slowing down and waiting for a safe opportunity to pass will take, what? 10 seconds? 20? 30 or 60? How many minutes would it take for you to be comfortable with someone risking the rest of your life and your family’s lives without you? I’m guessing there isn’t any number at which anyone would be, so don’t risk that of anyone else for the same. Just slow down, be patient and hope others treat you with at least that basic amount of human decency.
  • By riding abreast a large group significantly reduces its length and likewise the time and distance it takes to overtake them. Imagine trying to pass a single file line of 20 bicycles that must ride in the center of the lane due to lack of safe space. That part of British Columbia’s Motor Vehicle Act should be changed for everyone’s benefit.
  • No one stops at stop signs. Whether people walk, ride, or drive people go right on through whenever they feel they have the chance. This is not a cyclist thing, it’s a people thing. The only difference is when a motorist does it it is dangerous for everyone around them. Every time. This article does a good job of introducing a study from the University of South Florida which reflects this point.
  • On that point, imagine how happy the average angry motorists would be to have to sit and wait for 20 bicycles in front of them to each come to the complete stop motorists only demand of cyclists? Yet it will only take a few seconds for the whole group to follow the leader. There’s no need to imagine that, though. In San Francisco, people on bikes do just that occasionally.

I hope the shortsighted producer(s) at CTV who made this video trash is ashamed of the hateful, violent comments it’s drawn. Because I guarantee someone they love and who means the world to them, or someone that person loves, will face the violent hatred of a motorist someday for the simple act of riding a bicycle. Same goes for those commenters.

All it takes is a little empathy and considerate thought about the way things work to see you owe the world around you the utmost care while operating a machine as dangerous as a motor vehicle and that, no, a motor vehicle does imbue you with privilege above others.

Auto-eject drive Folder Action

This script is meant to auto-eject a drive after the amount of time set in the script. It will prompt you first, so you may cancel at that time.

Why would this be useful? I have a Garmin Edge 130 bicycle computer. I had been using my phone, but every app/service has binding arbitration garbage in their 50 page click contract (aka baloney), even so far as with Strava flat out stating they may delete your account if you opt-out of it. Via real mail, of course. Outrageous. So I went with Garmin, who actually have a much smaller click contract. Like a breath of fresh air.

At any rate, my wife also has a Garmin Forerunner 35 watch and, like my Edge 130, includes a drive which mounts on your desktop when plugged into a computer. I believe this drive is used for manually installing watch faces or “widgets” and data screens. Although Garmin makes software to load those sort of things.

We typically plug these devices into a computer to charge them and when they are unplugged the Finder complains about the drive having not been ejected properly and file damage or something. Who even reads those things? That’s where this script comes in and why the trigger is “GARMIN”.

This script is meant to be attached as a Folder Action on the Volumes folder.

-- http://strawhousepig.net/

-- Name of disks to watch out for.
property triggers : {"GARMIN"}

-- Number of seconds until the script executes its mission unless user cancels.
property TKO : 30

on adding folder items to this_folder after receiving added_items
  do_it()
end adding folder items to

on run
  do_it()
end run

on do_it()
  tell application "Finder"
    try
      set these_hds to every disk whose name is in triggers
      if these_hds is not {} then
        set now to current date
        display dialog "The following volumes will be ejected in " & (TKO as text) & " seconds." & return & return & these_hds as text with icon 2 giving up after TKO
        set the_res to the result
        if gave up of the_res is true then
          my inspected_detected_and_ejected(these_hds)
        else
          set now_now to current date
          delay TKO - (now_now - now)
          my inspected_detected_and_ejected(these_hds)
        end if
      end if
    on error theErr number theNum
      if theNum is not -128 then display dialog theErr giving up  after TKO -- Error -128 is the cancelled by user error.
    end try
  end tell
end do_it

on inspected_detected_and_ejected(these_hds)
  repeat with this_hd in these_hds
    try
      tell application "Finder" to eject this_hd
    end try
  end repeat
end inspected_detected_and_ejected

Notable is that this script delays the full set time whether the user clicks “OK” or not.

Using Netatalk & CUPS

Using 20+ year old hardware is as much a curse as it is a blessing.

Set-Up:

Imagesetter (AccuSet 1000) – RIP (PowerMac 7500) – CUPS server (Raspberry Pi) – Clients (OS X 10.5, macOS 10.12)

The OS X 10.5 client currently serves as an MDNS print server for the newer OS machine since that is the last Macintosh OS version to speak AppleTalk, which the even older RIP requires (thankfully via ethernet).

In this day and age OS X 10.5 (Intel) has nothing close to a modern web browser. Thanks to the incredible persons at floodgap.com, 10.5 on PPC does in the wonderful TenFourFox, which (as its name implies) means OS X 10.4 has a more modern web browser than 10.6. Hell, Mac OS 9 has Classilla (progenitor of TenFourFox). In a perfect world I would use the 10.5 machine as the server for a newer, betterer everyday workstation, but that money doesnt exist. So out comes the Raspberry Pi.
Continue reading

New wheels

2011 Masi Speciale

This is the coolest bike I found after starting to search for one in earnest. Picked it up at Arizona Bicycle Experts. There are some custom / by hand frame builders that put together some fantastic stuff, but those are *way* outta my price range. Got it under MSRP since it is an older model, but I’ll still be paying for it for a while. These things is expensive. I actually went in to look at aluminum Masi’s, but this one fit and I’m glad it did.

Before jumping in the water I got my road bike toes wet on an aluminum Schwinn Empire from Wal-Mart. Not a bad bike on the cheap. Not a great one, either, since the components are all pressed steel not machined aluminum. Took quite a bit of tweaking to get it rideable. Although you could easily get your monies worth out of it, it never felt… I dunno, permanent I suppose. The Masi does. Could be that having years of experience with a quality steel frame helped me develop a bias.

Now to get my fat ass out there more often. The main reason for starting on this was to lose some weight and get in better shape. Hopefully even commute to work this summer. Used to love the road bike I had as a young teenager, so I’m looking forward to it.

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.