Monday, December 3, 2012

What To Do With .sign Or .asc Files

AKA: How To Deal With .sign or .asc File Extensions

Didn't find much help with this, and what I did find didn't work, so here's what did work for me.

First off, be aware that .sign and .asc files have to do with signed files and are used to help verify or authenticate a file as true and original.

Secondly, be aware that a file can in itself be signed or be accompanied by a file that handles the signing.  In the former case, the original file is modified and given the .sign or .asc extension.  If the latter case, the original file is untouched and accompanied by a file of the same name but with a .sign or .asc extension added.

Regardless of whether there is 1 or 2 files involved, the command and options used to verify is the same!  This was contrary to many suggestions I found elsewhere.  For example, if you download foobar.tar.bz2 and foobar.tar.bz2.sign then you can do the following.
$ gpg --verify foobar.tar.bz2.sign
Now this will either work because you already have the appropriate key or fail with some message noting a DSA key ID.  In the failure case, continue as follows.
$ gpg --keyserver pgpkeys.mit.edu --recv-key <DSA key ID>
Of course, replace <DSA key ID> with the appropriate value which should be something like "ACC9965B".  Also, feel free to replace "pgpkeys.mit.edu" with some other gpg key server.  Now repeat the first command:
  $ gpg --verify foobar.tar.bz2.sign
Done!  Your file will either pass or fail verification.

BTW:

All this really does is verify that the file is in it's original form as supplied by somebody identified by the given DSA key.  Whether or not you trust that the identified person is true, real, and trustworthy is up to you.  For example, if the DSA key identifies John Doe [john.doe@acme.com] and you happen to know that John Doe works for Acme Corp then you can probably trust this whole process.  But if the DSA key points to Joe Blow [joe.blow@rootkits.com], then.....well, your call.

I found many suggestions to handle the 2 file case as follows:
$ gpg --verify foobar.tar.bz2.sign foobar.tar.bz2
Which just yielded the error "gpg: not a detached signature" because gpg thinks both files are signed. Maybe this works for other versions of gpg but it didn't for mine. My version of gpg is given below.
$ gpg --version
gpg (GnuPG) 1.4.10
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
For more details, as always:
$ man gpg

Thursday, July 12, 2012

Searching Radio Stations in iTunes

It really annoying the way you can't search radio stations in iTunes.  With hundreds of streams available per category, the fact that Apple expects you to scroll through them all to find a particular type of station is pretty ridiculous.  Luckily there's a work-around:
  • Create a new playlist.
  • Select a category and expand it.
  • Select all radio stations within the expanded category and drag them into the newly created playlist under PLAYLISTS on the sidebar.
  • Repeat above steps for any other categories you want to include in search.
  • Now click on the new playlist and voila, the Search control will now be active.
  • This lets you search all streams under a particular category.  Add more categories to search more streams.
Note how the results of searching for soma in the screenshot below.

Tuesday, July 10, 2012

CollabNet Subversion Console and Apache

I installed (CollabNet) SVN on my Windows computer (WinXP) because it's my version control system of choice when using the Eclipse IDE.  With Apache already present on the computer where SVN was installed, I found that getting into the CollabNet Subversion Edge Console was not as stright forward as following the default link (http://localhost:3343/csvn).

Following the link worked immediately after install, but not after the first restart.  In any case, some digging around resulted in the following solution to get into the console:

  1. Go into windows Services (Control Panel > Administrative Tools > Services)
  2. Stop the Apache service (Apache2.2 in my case)
  3. Start the CollabNet Subversion Edge service (note that this is not the same as the CollabNet Subversion Server service).  Even though both services are set to "Automatic" start, for whatever reason the Edge (console) service must be started manually.
  4. Not retry the console link (http://localhost:3343/csvn).
Also note that I change the default port for the SVN server from 80 to 81 (under Console > Administration) because port 80 is already used by my Apache http web server.

Thursday, May 24, 2012

Updating a jailbroken ATV2 to iOS 5

I recently updated my ATV2 to iOS 5 (w/ tethered jailbreak, - tethered meaning you need to connect the ATV2 to your computer each time to re-power or else the ATV2 won't boot-up).  Updating is easy as cheese if it's not jailbroken, but since mine was the experience definitely brings to mind the saying "if it works, don't touch it".  The good news it that it eventually worked!

So why did I touch it?  I learned about the new AirPlay feature on the iPhone 4s, after a visit to the Apple store, and wanted to try this out.  Unfortunately, my jailbroken ATV2 was stuck at iOS 4, which doesn't support this new feature.

So here's how it went:

First I followed this video: http://www.youtube.com/watch?v=dX1bsSL9bUw, which I found on the wiki.xbmc.org site.  Unfortunately, each attempt to use SeasOnPass to re-jailbreak the ATV2 resulted in an error from iTunes (error 21) and the jailbreak ultimately failing, leaving the ATV2 in a useless state.

Google searches for the error 21 come up with suggestions like: try a different cable, try again (and again, and again), restart computer, first make sure a standard restore works from iTunes.

Unfortunately a standard restore through iTunes always resulted in the same error.  And no luck with several re-tries or restarts.  Great, did I brick my ATV2?  With each re-try I have to restart SeasOnPass, which for some reason takes 5+ minutes to load, so I gave up for now...

Well, as it turns out, re-try (again and again) was the answer.  Came back a week later and tried again (may have used a different USB port) and it worked the first try when using SeasOnPass.

From here on, things went relatively smoothly.  Here are the basics steps after getting SeasOnPass loaded.

  1. Used the NitoTV installer downloaded from here: http://i0sen.dyndns.org/jailbreak-Tools.html
  2. Under ATV2 settings, set sleep to NEVER.
  3.  Followed instruction at XBMC to install latest unofficial Eden version for iOS 5 as given in this post: http://forum.xbmc.org/showthread.php?tid=127369
  4. Re-load backed-up XBMC folder (assuming you followed the YouTube instructions)
 I haven't actually tried step 4 yet, but I'll find out soon how it goes.

Hope this helps somebody.

"...original item for "Shares" cannot be found." when sharing PC to Mac

I tried to share an external drive from my WinXP box to a Mac (MBP) and always got the following error:

"The operation cannot be completed because the original item for "Shares" cannot be found."

Searches on Google came up with plenty of solutions for this error, but none of which worked in my case.  So in case it helps somebody in the future, here's how I resolved it.

A little investigation revealed that I could share other folders and access them fine from the MBP, just not the external drive.  I eventually figured out that I just couldn't share things that were large.  Since my external drive was 500 GB, it easily fell into this category.

This size restraint on sharing was fixed by following instructions here:

http://support.microsoft.com/kb/106167

Basically, there's some parameter (on the WinXP machine) you have to adjust to allow larger things to be shared.  The parameter is adjusted/added using regedit.  I changed it to the max value of 0xC (12), and that worked fine.

Tuesday, March 6, 2012

Use of PHP functions within Smarty code

Can standard PHP functions be used directly within Smarty code?  The answer is yes, but the proper syntax depends on where you use it!  For example, the syntax is different for 'assign' statements than for conditional statements.  See the examples below for getting a count from an array variable named 'aArray'.

Assignment syntax:

[{assign var="iCnt" value=$aArray|@count }]

Condition statement:

[{if count($aArray) == 0 }]DO WHATEVER[{/if}]

So in the case of assignments, a variable modifier must be used.  But within condition statements the function can be called directly.

Monday, February 13, 2012

Old Photo Effect With A Touch Of Colour

Here's the result of trying to simulate and old photo feel, but with some added colour. I used the following photo as a basis for what old looks like.

Taking note of the following characteristics:
  • Blurred edges
  • Grainy print
  • Stained edges
I went ahead and shopped the following:
  • Used Artistic > Film Grain filter
  • Gaussian blur masked by a radial gradient with the start of the gradient offset by 50%
  • Black & White adjustment layer with tint, and manually adjusted to best bring out pattern of shirt in photo.
  • Added mask to B&W adjustment layer and used grey to to partially expose some original colors.
  • Slightly reduced opacity of B&W layer to give a little overall color.
  • Added a radial gradient to the border with a tan colour and gave it Multiply blend mode.
Result is shown below.  Overall I'm pretty happy with it.  However, I wish I could have reproduced the randomness of the stained border in the true old photo, rather than just using a radial gradient.

BEFORE:
AFTER:

Wednesday, January 11, 2012

PayPal Website Payments Standard vs PayPal Express Checkout

Just a quick explanation of the difference between the PayPal services Website Payments Standard and PayPal Express Checkout and why you would choose one versus the other. I've found myself asking this question more than once now, so next time I can just recall what I wrote here.

Website Payments Standard is a completely FREE* PayPal service that can process credit cards without requiring a PayPal user account. The disadvantage is that all processing takes place off-site. That is, the integration with the retail site is limited to just re-directing the user to PayPal for checkout. After this happens, there's no guarantee the user will ever return to your site which makes having a consistent confirmation page impossible. But beggars can't be choosers and this service is, after all, free.

Express Checkout is also FREE* and offers better integration with your site. It works by directing users to the PayPal site just to enter payment info, and then returning to the retail site to complete the order. All in all this seems like a better solution, allowing complete control over the final stages of checkout, including payment processing and confirmation. Additionally, recurring payments (a.k.a. billing agreements) can also be setup and even combined with regular one-time purchases. The down side is that the API programming is more complex and the amount of user interaction required to complete an order can increase (a possible negative impact on conversion rates). But if you're comfortable with the free API (PayPal NVP) then I'd say the benefits far outweigh the disadvantages. Note that PayPal also offers a SOAP interface, but I believe use of this requires a paid account.

Either way, if you choose to integrate a FREE* PayPal service expect many headaches on the way. My experience with PayPal places it as #1 in the Worst Software Integration Experiences. Their developer/sandbox tools are more flare than function, their documentation is selective or just out-of-date (not sure which, but probably both), and their technical support is utterly useless. But what alternative do we have? For smaller volumes of sales, it's still (by-far) the cheapest credit card processing service on the planet. Have fun!

*NOTE: The word FREE here refers to no monthly service charges. All merchant gateways charge transaction fees with PayPal on the high-end.