Archive for the ‘Uncategorized’ Category

Software for a new Mac user

May 1, 2015

I recently purchased my first Mac.  As a convert from PC’s running Linux, there were a few tools I’ve found particularly useful that I wanted to note.

  1. Duet Display – Attach your iPad to your Mac and use it as a 2nd monitor – great for working on the go.  I’m a web developer so this is awesome – to be able to have my browser in one monitor and the web console in the other.
  2. Better Touch Tool – I miss my mouse buttons from the PC world (I still use a Linux desktop) so some gestures like middle click a tab to close it, middle click a link to open in new tab are pretty hard wired.  Better Touch Tool allows you to setup gestures, buttons, etc.  You can separately configure the trackpad, magic mouse, and PC mouse, and you can set up rules per application as well.
  3. Karabiner – Keyboard mapper for Mac.  As I was struggling to get used to the differences in the Mac keyboard shortcuts, I found this doubly frustrating when I docked my Mac at my desk and was using a PC keyboard as the Control, Alt, and Command buttons were in different places from the Mac keyboard.  Karabiner allows you to customize your keyboard layouts, and specifically allows you to set mappings for the built in keyboard, external mac keyboard, and external PC keyboards separately.  This allowed me to change just the PC keyboard layout to match the mac keyboard layout for the control, alt, and command keys.
  4. iTerm2 – Has some improvements over the built in terminal app and some sweet features.

That’s it thus far.  I’m still learning so will update this list as I find other things.  Hope this helps someone out there

Launch of scrible’s new bookmarklet toolbar

May 4, 2011

I’m the cofounder of scrible.com, and we’ve just launched our new bookmarklet toolbar to help you do your online research.  Previously we’d done a limited launch with only an IE plugin, but the bookmarklet works in pretty much all the major web browsers and OS’s (finally – I’m a linux guy, so no more having to jump into the windows VM for this).  Our tool allows you to highlight and take notes on live webpages, and then save them into a gmail like library where you can tag, full text search.  Our service caches the page so you don’t have to worry about link rot in your research.

Check it out and click the feedback button to let us know what you think!

X509Certificate2 Verify method fails on valid certificate…

April 8, 2010

I’m using a the .NET X509Certificate2 Verify method to verify that a file was validly signed with my code signing certificate.  I ran into one machine that this check was failing on (while it worked on all the other machines on the same network) and beat my head against it for 2 hours trying to figure out why.

Turns out that if the date/time on a machine is off by a certain amount (in this case it was about a day) it causes the certificate validation to fail (apparently relates to the revocation check).  Hopefully this will save someone some time in the future.

For reference here is how I’m preforming the validation of the signature on the file (as an example args[0]) – I additionally check that the subject matches my certificate using the cert2.Subject property.

X509Certificate cert = X509Certificate.CreateFromSignedFile(args[0]);
X509Certificate2 cert2 = new X509Certificate2(cert);
Console.Out.WriteLine("Is Signed File Valid? Verify=" + cert2.Verify());

If you need more information about the chain or failures of the check you can use code outlined here on MSDN for the X509Chain.  For this particular error, it didn’t help – just said “The revocation function was unable to check revocation for the certificate.” and “The revocation function was unable to check revocation because the revocation server was offline.”

Supposedly you can configure how strict the checks are (whether it checks for revocations, whether it errors out if certificates are expired, etc) with the X509Chain.ChainPolicy, but I wasn’t having much luck with it.  I couldn’t get it to validate iexplore.exe (IE8 for win7) presumably because the code signing cert used has now expired.

Internet Explorer Plugins and Vista

October 20, 2008

So I’ve recently got a new machine that came pre installed with Windows Vista.  And now I’ve got the fun task of trying to make everything work again with my plugin 🙂

 

There are a number of places where I’ve found some good info on this, which I will enumerate here for your and my benefit.

http://www.codeproject.com/KB/vista-security/PMSurvivalGuide.aspx – A Developer’s Survival Guide to IE Protected Mode

http://technet.microsoft.com/en-us/magazine/cc138019.aspx – Inside Windows Vista User Account Control

http://msdn.microsoft.com/en-us/library/bb250462.aspx – Understanding and Working in Protected Mode Internet Explorer

http://blogs.msdn.com/ie/archive/2006/02/09/528963.aspx – Protected Mode in Vista IE7

A couple of key things if you’re relying on the compatibility shims: (described in a little more detail in the 4th link)
Registry Accesses (to HKCU software) are moved to
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\InternetRegistry\REGISTRY\USER\[User security identifier – SID]\Software\[my key]
File accesses (to acceptable locations) are moved to 
 %userprofile%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Virtualized\{system drive letter}\Users\{username}
I hope to update more this as I dive further into updating my plugin and making it work in both XP and Vista.

IE BHO: Including local images in a remote page…

October 1, 2007

I’ve been writing an IE plugin (or BHO) and ran across a problem when I tested it under IE 7.  When I included images off of the local harddrive, most didn’t show up under IE7 (but worked fine under IE 6).  However, I noticed that one image I was using did work.

The difference was that this image was a CSS style background.  So I was able to work around this problem by simply converting all of my images to be spans/divs with the style.backgroundImage=”url(‘path to local image file‘)”.

Of course the caveat is that this behavior is probably not something they intended, and may fix it at some point.  But until then, it’s an easy change (compared to using the res protocol or a custom protocol – mentioned in the BhoWiki ) to get the job done.  Also, I’ve heard that the IE7 is slightly different under Vista as compared to XP.  I have been testing IE 7 under XP using the Microsoft Virtual PC testing images they have freely available for download (Info about it here and download page actually has XP with IE6 (if you have upgraded to IE7 already) and XP with IE7 (in case you still are running IE6 or Vista).  The article links to an older version of Microsoft Virtual PC, but you can use the latest one here (I’ve noticed it fixed some issues I saw under the old version).

UPDATE: 4/7/2010 Forgot to post this back here till now, but IE8 seems to have closed this hole.  I’ve given up on locally serving them and now host them on my website.  There was something I had read about possibly creating the images as resources in a DLL (like the images in the about:tabs page – something like res://ieframe.dll/tab_icon.png .)   I’ve not tried it, so this approach may not work due to security zone restrictions.

Intro

June 5, 2007

Occasionally when coding, I run across something I think is particularly spiffy, or spectacularly painful. Especially when I run across the painful things that I haven’t had much luck searching for solutions, I thought it would be a grand idea to create a blog of my own to detail these in for future use by myself and others, as many times when I do find a good solution, it is in this type of forum.

Happy coding!