Saturday, January 9, 2010

Firefox automatic proxy setting change made easy



Ok today let's talk about something that's been bothering me for some time. Small thing but still... annoying. It's about Firefox, proxies and laptops. If you have a laptop that you use at home as well as at work you might have the same problem I have: changing the proxy settings all the time... so boring... keep reading...


Usually at work the internet connection goes through a proxy. Meaning when you use Wifi or ethernet cable at work, instead of being directly connected to the open internet your connection goes through another computer that is called a proxy. Just a minute explanation about why this happens: usually at work, the IT guys wants to have some control about where you surf to so they have this list of rules that says where you can and where you can't go on the internet. The proxy can be used to be that "bad" computer that act as the filter. You want something from the internet, your request first goes through the proxy, that checks if what you want is on an acceptable site and if so your request is transferred to the internet and brought back to you. Also a proxy can be a tool to save bandwidth: if many people at work want the same type of information on the same site, instead of asking the internet all the time, the proxy uses the information it has already gotten for someone else to give it back to you (of course this is upadated from time to time).

Ok enough about the technical jabber... Here's my problem. If there is a proxy at work, you need to tell your browser where the hell it is or else your connection will be sloppy or you might have no connection at all. So there is a place in Firefox preferences where you can tell him how Firefox can access the proxy. But well... at home... you don't need your laptop and Firefox to go through the proxy because you have a direct connection and also for privacy reasons you don't want the work proxy server to be even called from outside work where you do private stuff ...

The cheap solution is to change Firefox proxy preferences by hand each time you are at work or at home. Here's how to do that: go to Firefox preferences (on a Mac: Firefox's Firefox Menu-->Preferences or Settings-->Advanced Tab-->Network-->Connection part and click Settings... button, on Windows: Firefox's Tools Menu-->Preferences or Settings-->Advanced Tab-->Network-->Connection part and click Settings... button). There you will have this new beautiful window where you can choose between a direct connection to internet (what you want usually at home), autodetection of proxy settings (in my experience hardly works), manual proxy configuration (sometimes you or the IT guy have to change that part at work) or automatic proxy configuration url (most of the time this is the place where the IT guy puts a cryptic address that links Firefox to that proxy computer). So you have to switch between those options each time you are at home or at work... unbearable !

Here's my solution using a too little known Firefox plugin called MM3-ProxySwitch. This piece of nice software can automatically switch between a direct connection to internet and several proxy servers or proxy autoconfiguration files depending on where you are (home, work, internet café... where ever you need a proxy). But the thing is it doesn't do this out of the box. You have to beat the little thing around a little. And the rather cryptic documentation of this piece of soft doesn't help.

Ok let's do this now:

  • Launch Firefox and download MM3 ProxySwitch (hereafter MM3) plugin here (if the link is outdated simply search MM3 ProxySwitch in the Firefox plugin site)
  • Install, and restart Firefox
  • Now let's add MM3 as a button to the Firefox icon bar: in Firefox Menu go to View-->Toolbars-->Customize. In the new window you should see the MM3 icon. Drag and drop it to your icon bar, for instance next to the Home icon. Don't worry, this is just for configuration, you can remove the icon later and forget about it.
  • Now if you click on the little arrow next to the MM3 icon, you have a tiny menu where you have edit (try not to click the MM3 button itself but the small downward arrow). Click Edit. By default there will be a bunch of cryptic stuff there that you can erase.
  • Replace what you just erased by these lines exactly:


[myproxysettings
url=xxxxxxxxxx
]
testUrl=yyyyyyyyyy both myproxysettings

  • The square brackets, the "url=" and the "testUrl=" are MM3 commands that are mandatory for what you want to do. "myproxysettings" is just a random name I gave to the settings I want, you can choose whatever you want instead as long as you replace it everywhere. "xxxxxxxxxx" and "yyyyyyyyyy" are stuff we need to change in a moment and "both" is also a MM3 command I will explain.
  • Here's what this stuff is going to do: each time you launch Firefox, the "testUrl" command will try to connect to an address that we will put later instead of "yyyyyyyyyy". "both" means that this check will be done whatever the initial proxy status of Firefox (direct internet connection or else). If "testUrl" successfully reaches the address in "yyyyyyyyyy" then MM3 will think that you are for instance at work, if it is unsucessful, it will think that you are for instance at home. If sucessful, MM3 will change the proxy status to what you have set in "myproxysettings" between the square brackets. For now, it will put the address "xxxxxxxxxx" given by the command "url=" inside Firefox's "Automatic proxy configuration URL" that we talked about earlier
  • The tricky part is what should we replace "xxxxxxxxxx" and "yyyyyyyyyy" with. For "xxxxxxxxxx" it's easy. This is for instance your proxy setting at work. Just go to Firefox's proxy setting as we did earlier in the unbearable section above. Check what's written in the "Automatic proxy configuration URL" part and copy paste it instead of "xxxxxxxxxx". Alternatively ask the IT guy for the automatic proxy configuration address at work. The really really tricky part is what to put instead of "yyyyyyyyyy"... This should be some web address that you can reach all the time at work but never at home. One easy solution is to pick any web address in your intranet, the closed local network of your office. If you don't have an intranet, you can try the IP address of your network printer at work if you're sure there is nothing like that at home... there are many solutions it depends on your environment at work... think about a clever address to put there. In the end when you have found something to put instead of "xxxxxxxxxx" and "yyyyyyyyyy", your MM3 edit file should look like this (of course with your very own addresses instead of the fake ones I put there :-D ):


[myproxysettings
url=http://myworkurl.com/proxy.pac
]
testUrl=http://myintranetadress.mycompany.com both myproxysettings

Ok it's all set, next time you launch firefox, MM3 will detect where you are, and change your proxy settings to either direct connection or use the "Automatic proxy configuration URL". When testUrl is sucessful, the MM3 button will light up else it will be shaded.

Ok lets discuss a little more about possibilities. Of course you can apply this trick anywhere: home+internet café, home+GF's appartment etc. There are also other commands that can replace the "url=xxxxxxxx" part. The "url" command changes the "Automatic proxy configuration URL" in Firefox proxy settings. Instead all the commands below will change the "Manual proxy configuration part"

http=xxxxxxxx : this will change the HTTP proxy setting
ssl=xxxxxxxx : this will change the SSL proxy setting
ftp=xxxxxxxx : this will change the FTP proxy setting
gopher=xxxxxxxx : this will change the gopher proxy setting
socks=xxxxxxxx : this will change the SOCKS proxy setting

You can put either one or all the five commands above between the square brackets and it will change one or several Manual proxy configuration settings. Of course, it is useless to have one of the five above and at the same time the "url" command as these are alternatives.

Although I did not test this, I guess you could also have several "testUrl" commands associated to several square bracket configurations so that you can switch between direct connection and proxy at several places where there is a proxy.

Finally, more obscure possibilities are described at MM3's web site here, check it out.

Please let me know if this was useful in anyway in the comments !!

Cheers.



If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!







Click to read more...

Tuesday, September 1, 2009

Face recognition in Adobe Photoshop Lightroom or Apple's Aperture to tag yours photos ?



It is quite known that, as of today, there is no face recognition technology embedded into Adobe Photoshop Lightroom and that's a shame ! If you can't wait for Adobe to include this in a future version of the software... keep reading.


This is a Mac user only trick (but you can adpat to whatever you want with a little creativity) and although this is really not difficult, this not a pretty way of giving face recognition to Adobe Lightroom. First what is face recognition ? Well, it is a technology that helps you when tagging (or keywording) your photos. When you have a lot of photos of people, you almost always want to find out all the photos of a given relative/friend/whoever. One way to do this is to add a keyword (tag) to each photo by hand in Lightroom or other software. This approach is a nightmare ! Face recognition is another way. Usually, you tag a few photos of a person and the face recognition software gets you several others pictures that might have that person. You can correct the soft if it is wrong and so on. The more you tag and the more the soft gets good at recognizing people. This is great. One soft that does this beautifully is Apple's iPhoto 2009. iPhoto 2009 comes free with every new Mac and as part of iLife 2009 for a few bucks otherwise.

The main idea here is to use Apple iPhoto's face recognition technology to tag the photos in Lightroom (or other soft) without going too much into iPhoto. Here's what we'll need:
-iPhoto 2009 (free with every new Mac),
-ExifTool for Mac, free, download and install,
-A script written by Andrew Turner found here,
-Lightroom (or other). I will assume Lightroom below.

This has only been tested with Mac OS X Leopard (don't know if it works in Snow Leopard, Tiger or elsewhere, test it and tell us).

Then, the first thing you should do is backup your photos. There is no danger here but in case the final tags are not what you expect, you should be careful.

Here are the steps:
-Open iPhoto 2009 and go to iPhoto-->Preferences-->Advanced and uncheck the Copy items to iPhoto Library option. This will prevent iPhoto from physically importing your photos and save space on your drive,
-Go get some photos and drop them into iPhoto. As an example, I will assume that you are tagging a bunch of photo with friends and Barack Obama !
-Use iPhoto 2009's face tagging to tag the faces in your newly imported pics. This is quite simple, just select a picture and click the Name button. If you are not sure about this, just look at this video.
-Now this is where things gets tricky. When you tag faces in iPhoto, the tags are in fact not added to the photos themselves. Modern photo formats such as JPEG have Metadata information that can save many information such as camera type, day, time, etc. Metadata can also save keywords and tags. Well known metadata format are EXIF or IPTC. iPhoto tags does NOT end up in any of those Metadata but are saved elsewhere. This is precisely what we need to circumvent.
-To do that, once you face tagged everything you needed, just go to iPhoto's Faces directory in the left pane. There you should see a framed picture of every person you named. Double click the frame with Obama's name, iPhoto displays every picture with Obama in thumbnails. We will now explicitely retag the pictures. In iPhoto's View menu, check Keywords (or press Shift+CMD+K) to activate keywords. This should display a space below every picture that says something like Add Keywords. Click that area below one of the pictures and add the name of the person between double quotes. For instance here "Barack Obama". The quotes are important. Now select all the pictures of the person. For some reason, you can not CMD+A... So what I do is reduce the size of the thumbnails using the size scroller on bottom left and then select every picture with the mouse. Now that every picture is selected, in iPhoto's Window press Show Keywords (or type CMD+K). This should bring a dialog with previously used keywords. As you just keyworded one photo of the person with his name, this keywords should be in the list. Just click it (in the example you should click Barack Obama). This will give every picture you selected, and that hopefully have the person's face in them, a keyword with his name. Fine !
-Now assuming that you already installed ExifTool, we will run the script you downloaded. First in iPhoto make sure that every photo we retagged in the previous step are selected. Unzip the script and double click it. It should open in Script Editor (you can change the Copyright property in the script code to append yours). Click the Execute button. This should bring iPhoto into focus and depending on the number of photos... take some time. This script uses ExifTool to write into each photo's IPTC metadata, the information that is written in iPhoto's keyword space. As we've only put the name of the person in this place, it will write only the name. (To be exact, it will also overwrite the IPTC copyright tag, that's why I suggested you should put your copyright notice in the script's code in the line that says property copyright : "©. All Rights Reserved." )
-Once the script is done, it will display a message that should say Exif writing complete. Please be patient. Now your photos of Barack Obama are tagged and ready for Lightroom. Import them into Lightroom, they should be tagged ! Do a search (by keyword) for Obama and all the photos with Obama's face should appear.

Neat ! However one point is annoying if you already have many tagged photos in Lightroom. As iPhoto, it appears that Lightroom's tags are separate from Metadata. When you import a new photo to Lightroom, it will read the metadata and extract keywords, that's what we used ! However, if you have already tagged photos, you will need to reimport the metadata* and it appears that it would erase current keywords in Lightroom... at least that's the message Lightroom displays.

Enjoy and comment !

*To reimport metadata in Lightroom, right click a photo in the library and you should see a metadata option in the contextual menu. You can right click a bunch of them.

If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!








Click to read more...

Monday, June 1, 2009

Type Latex documents and get Live Preview (almost) on your Mac



We like typing our documents (scientific or not) in Latex because it is clean and powerful. But sometimes, it is cumbersome because to preview the result, you first have to typeset (sort of compiling) and view the document in a document viewer, whether DVI or PDF. This is much more difficult and time consuming than when a regular word processor such as Word is used. Of course, I don't mention the use of Latex GUIs such as Scientific Workplace (on Windows) because it is even more cumbersome and document created in this environment are very difficult to share with non SW users.

After some time on Mac, I have found the ideal setup (for me) and a great workflow. It is easy to install, to use and you almost get "Live Preview". What I mean by Live Preview is that you can type in your text editor latex code and get almost an instantaneous preview of the final document in PDF.




The trick involves a few softwares:
Mactex is the easiest way I know to install a Tex package on a Mac. Textmate is a great text editor. One thing is that it is not free :-( but you won't regret paying for it (A trial version is availabe). It can replace the simple editor bundled with OS X, and it makes things really easy. Skim is the fastest PDF viewer I know of for Mac. So download MacTex and install it, this should be fairly easy. Install Textmate and finally install Skim.

Now let's try creating a Latex document. Open Textmate and create a new document if necessary, and look at the bottom bar. You should see the type of the document and by default it is "Plain text". Click on that area and in the list menu choose "Latex" (alternatively you can try File Menu-->New from template-->Latex-->Article). Now you've told Textmate that you'll be typing a Latex document. You can try writing any Latex code you want. Let's remain simple and type this:

\documentclass{article}
\begin{document}
Hello there !
\end{document}


Now before previewing our document, let's make sure Textmate is properly configured for Latex. Go in the Bundles menu and do: Bundle Menu-->Latex-->Preferences. In the Latex Preferences dialog, make sure the Default engine is "pdflatex" (that's my advice). Then in dropdown menu View in choose "Skim", check "Show pdf automatically". You're done so click "Done".
Now you can preview your final document as a PDF in Skim. The shortcut to do that is "Command+r" . Try that and you should see the "Typeset and view" console that report the typesetting process and show errors and warnings. Skim should open automatically, steal focus and show you your newly created PDF. Great !

Now for the "Live Preview" (almost) workflow part. Here's what I like to do. I trim the Textmate window so that it occupies half the horizontal space on my screen. The other half is for Skim. This is already a neat setup: you type in Textmate, you press "Command+r" and you see the result in Skim very fast. But you can do better. First go in the Textmate preferences: Textmate Menu-->Preferences. Go to the "Advanced" tab and in the "Saving" sub tab. Now you have to check two option:
  • First check "Perform atomic saves". Atomic saves mean that (Textmate definition) instead of overwriting the file, TextMate saves to a new file and once this succeeds, overwrites the old file. This has the advantage that if your machine should crash while saving a file, you do not run the risk of losing the contents of both the old (last-saved) and new files
  • Second check "Save files when focus is lost": this is an interesting option. It means that each time you click anywhere outside the Textmate application, Textmate's focus is lost and your current work in Textmate is automatically saved !
OK! We're almost done. One last thing to do is to tell Textmate to monitor file saving and update final preview. To do that do: Bundles Menu-->Latex-->Watch document (alternatively use the shortcut Control+Command+w). Now a new PDF of your work will be created but this one is special (you can close the old one). The Watch document option does something pretty neat: it will automatically preview your document in Skim each time you save it. But as we've told Textmate to save automatically each time focus is lost, to have an almost "Live Preview" all you need to do is type, and then click on Skim (by clicking Skim or elsewhere outside of Textmate, Textmate loses focus, autosaves, and the Watch document option creates a new preview). Pretty good !

If this is not enough, we can go one step further however this step can be as much useful as a pain in the a$$. This is a trick I pulled directly from Textmate Howto Wiki. The idea now is to use something to autosave the Latex document for you every specified time. That thing is called EverSave ! This free little app save your work in almost any app for you. Download and install it. Once you're done go inside EverSave's preferences and do the following:
  • In the General tab, make sure "Listed applications" is the option under Save Applications and "Frontmost only" under Save Documents. Under When should EverSave save check only "Timer-controlled". Uncheck everything else inside this tab.
  • Go to the Applications tab and under Automatically save these applications click "+" and browse to your application folder to add Textmate. Automatically add applications options should be unchecked.
  • Go to the Timer tab. You have to choose a Save delay. EverSave will use this to save the document in Textmate every said time. I suggest putting something like 10 seconds or less. Then under Please choose a save method you absolutely need to choose "Save by simulating save shortcut", the other option is useless with Textmate as a save dialog will prompt each time.
You're done ! You can test the system. By the way EverSave installs a Mac bar icon that you can use to Enable or Disable autosave. This is wonderful if you type corrrect Latex code very fast. However this can be a pain in the a$$ because when you are in the middle of let's say typing an equation, EverSave will save, Watch document will see that the document was saved and try to update preview. If your Latex expression was wrong or incomplete, you will get an error. I've warned you !

That's it ! Let me know if you find this useful in your comments.

If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!









Click to read more...

Tuesday, March 10, 2009

Data compression in Mac OS X: how to compress in RAR without WinRar...

Edit: Updated version for Snow Leopard thanks to reader Edgarf87 added.

Well something I miss a lot from my Windows days is an easy and efficient way to compress my data. Back on Windows, I was a heavy user of Rar compression and a big fan of WinRar. On Mac OS X, the most easy way to compress data is to use the built-in zip feature. That's fairly easy: in the Finder just right click on any folder(s) or file(s) and you should have the option to compress and create an archive in the contextual right click menu. That's pretty useful but you compress in the zip format and this is not the best way to save to compress in terms of space and you can not configure anything. So what I want is an easy way to compress in the Rar format because I came to like the compression rate and the power of this file format.




But it appears that Rar is not a popular format on the Mac side and also right clicking something to archive is not very popular either (in fact if you ever had a mighy mouse, or have a Macbook, you know that right clicking anything is not Apple's thing).

First let's talk about decompressing rar files. You can not do this out of the box on Mac OS X if I remember correctly. You have to use a third party software such as The Unarchiver or UnRarX. But my favorite option to decompress rar archives is MacPar. True, decompressing rar files is not the primary goal of MacPar but it does it smoothly. And for the same price (free...) you can create parity sets or verify data integrity. MacPar also integrate with Split & Concat.

Now back to the main question: how to create Rar archive ? If you like to put your hands in OS X's Terminal, there is a straightforward way: use the command line rar executable available at Rarsoft, the makers of WinRar. This is just like what we did on MS-DOS with PKZIP, ARJ and RAR long ago... But yeah... Who wants to go back there ? If you don't, this gets a little bit crappy. After searching a bit, I found a software called RarMe. This is some sort of a graphical interface to the command line rar executable above. Although this does the job, I was not really satisfied with this soft because it was slow, and you have to specify everything each time in the interface window... super heavy stuff. It appears that the makers of RarMe are trying to make something better... so maybe something to follow. Also there was the Tiger only SimplyRar that looked good but I don't have Tiger anymore and their web site is down, also something called Rarify that works but no right click action here !

OK finally, I settled to a custom made solution with freely available software and the help of some nice guys on some forums I was reading. The final result is quite neat: you want to compress a file or folder to a Rar archive ? You just right click and choose "Add to Rar Archive" in the right click contextual menu, just as you do for zipping in the Finder. To do this, you will use an Automator workflow with an applescript to tell the command line Rar executable above what to do ! Sounds very complicated, but actually VERY easy. So here we go:
  1. Download the command line Rar for Mac OS X from Rarsoft here (more specific scripts can be found below). This is shareware so don't forget to buy it if you like it. I have not been nagged by this utility so far. What you will download is a compressed file. When you decompress it, you will get a folder named "Rar" with some files inside.
  2. Take the whole "Rar" folder from step (1) and drop it in your Applications folder. Now in your Applications folder, you should have a folder called "Rar" and inside a file also called "rar" and some other files such as "unrar"...
  3. Next go to your Home folder (this is the folder with a little house and your name on it most of the time). Inside there is a bunch of folders and one called "Library". Leopard users: Inside the "Library" folder, check if you have a folder called "Workflows". If not create it. Inside, the "Workflows" folder, create another folder called "Applications" and finally inside this newly created "Applications" folder, create another folder called "Finder". This is the place where you need to put the Automator workflow file later on in order for the Rar option to appear in your right click contextual menu. Snow Leopard users: Inside the "Library" folder, check if you have a folder called "Services". If not create it.
  4. For Leopard users: Download, the Automator workflow here. Once you unzip this file you will have a workflow file called "Add to Rar Archive.workflow". You need to put this file in the last folder you created in step (3). Once you did this, if you click on the workflow file and press "CMD+i", the path to the file should be "Users/yourname/Library/Workflows/Applications/Finder". Optionally, you can open this workflow file with Automator, check the AppleScript and change anything you like. For Snow Leopard Users (thanks Edgarf87): Download, the Automator workflow here. Once you unzip this file you will have a workflow file called "RAR selected files.workflow". You need to put this file in the last folder you created in step (3). Once you did this, if you click on the workflow file and press "CMD+i", the path to the file should be "Users/yourname/Library/Services". Optionally, you can open this workflow file with Automator, check the AppleScript and change anything you like. As a bonus the SL workflow shows a Growl notification for those who have Growl installed.
  5. YOU ARE DONE ! Now you can right click any folder, file or bunch of folders/files and in the contextual menu go to "Plus-->Automator-->Add to Rar Archive". And in a matter of seconds (actually it depends on the size of what you want to compress) you will have a Rar Archive.
OK that's it... Neat ! By the way, you can have as many workflows as you want in this manner as long as you give each workflow a different name. I just did the step by step guide and created the downloadable workflow file but I used the help available here and the AppleScript was written originally by some guy named "pardon" and you can find his original message and script here. Thanks a lot. Also, my version of the script uses these options of the command line rar executable: solid archiving, maximum compression, recurse subdirectories, assume yes on all queries and disable all messages. You can change these in the script.

Other scripts that might come in handy:
  • Add to Rar with timestamp script [Leopard] [Snow Leopard]: this script always gives a timestamp as the name of the rar archive. WTF ? Well if you always archive the same set of files (for backup/logging purposes for instance), it's handy to have the date+time as archive name instead of anything else. This workflow creates a rar archive and gives it a timestamp in this format "20090410@032404.rar" meaning "YearMonthDay@HourMinuteSecond". With this your archives are nicely ordered. Check it out.
  • Rar to multiple volumes script [Snow Leopard]: this script will rar one or several files to multiple rar archives. A dialog box will first ask you what is the archive size (in Megabytes) you want and then compress. As I did this to satisfy one comment below, it is very basic. You can edit the script to change the dialog and the size format.
  • Rar with password [Snow Leopard]: this script will rar and password protect the archive. A dialog box will first ask the password. Warning: I did not test extensively all characters that are allowed as a password. Before password protecting anything important please do a few tests. As I did this to satisfy one comment below, it is very basic. You can edit the script to your convenience.

Tell me if the above download link is broken and ask/comment if you have any trouble.

If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!












Click to read more...

Sunday, February 8, 2009

Converting a color PDF to a black and white (grayscale or monochrome) PDF

Here's my problem. I have a PDF document that is mainly text and also some graphics. The graphics are color graphics. However, I want a PDF where everything, including the graphics, is black and white (grayscale). Sometimes this is required. What would you do ? At first I thought that this would be really easy.




In fact, I think it is if you have a lot of money. An Adobe blog poster describes a procedure here. But the trick is you need Adobe Acrobat Professional and... well no way I pay for that ! ( By the way if you had, Acrobat Pro, I think that a better way of doing things than to convert to Tiff would be to File-->Save As, choose save as Postscript, go in the Setting and set the Color option to Composite Gray. This will save your pdf to a black and white postscript (ps) file. Then using Acrobat Distiller, you can convert your ps file back to a Black and White PDF... voilà! I checked all that at the office after doing what comes next at home.)

Now I need to do that without the expensive Adobe Acrobat Professional. It turned out that with the software I had installed on my computer, I could not simply not do that task or I had to start thinking a bit. I tried saving to a PDF and looked for an option to save as Black and White document... but I did not find this (I tried with Skim on Mac and Foxit Reader and Abobe Reader 9 on Windows). Then I tried printing to PDF (with the built-in option on Mac and DoPDF on Windows) but it was nothing very clear how to set things to B&W.

It turns out that on a Mac, it is in fact easy (see next paragraph for Windows): right or control click your PDF and choose Open With-->Preview.app. Preview is the Mac's built-in "read many things software". Once opened, in the menu do File-->Save As and in the new windows you have an obscure option called "Quartz Filter" and a dropdown menu. In the dropdown menu don't be fooled by the devious option called "Black & White". Instead choose "Gray Tone" and then save (thanks Anonymous in the comments for making me realize there was this option because at first I was tricked by Black & White option). Your PDF should now be in B&W.

For Windows users, here's my solution with free software. Download and install GhostScript. Then Download and install GSview. Latex users probably already installed those. Finally you need a good free PDF writer. I like DoPDF. Open your PDF with GSview, and then choose File-->Print. In the print dialogue, choose DoPDF (or your own preferred pdf writer) as the printer. Then on the same windows bottom left you should have a "Print method" area where "Windows GDI Printer" is selected. If not select it and click Settings. In the "Colours" area select "Black and White". OK everything, and print your pdf after giving it a name. And voila! Black and White PDF from color conversion. Easy and free.
Maybe there is a way simpler way... let me know in the comments. Anyway let me know your experience in the comments !!


If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!








Click to read more...

Wednesday, January 7, 2009

Viamichelin GPS Brick or block. How to survive and solve the issue?

Looks like I am an expert at bricking things. After my cell phone I bricked my Viamichelin GPS Navigation System. Mine is a X-970T New Edition (but my remarks below should apply to many models). OK let's say it straight, I think that the people who designed those things gave little thought to user experience.
If you have a functional Viamichelin GPS unit you have to do right now something most people do not do. Go install the DVD they gave you with the unit, follow on screen instruction and get your GPS and PC Viamichelin software in sync. Why ? Because if you do not perform those steps BEFORE anything crappy happens to your GPS or your GPS SD card... you're screwed !! These steps will create a restore point for your SD card.
Of course I did not do that and I think that most people do not because they do not give in depth reading to the user manual, because this is so cumbersome and because you never think of doing that when your unit is functional. And there is another problem with this procedure. What happens if you do install your DVD and then have a problem with your PC ? Well you're screwed again ! And finally, those products are discontinued so getting customer support is very difficult. So there must be a workaround.
First here's what happened to me. My GPS was fully functional and one day I followed a step by step guide on a corporate motel web page to install new POI (point of interest), such as those hotels, on my GPS. Wrong ! Never do that. To install POIs, you have to use the software Viamichelin gave you with DVD. Because I copied one file to my GPS SD card, it got bricked !! There are other silly way to brick your GPS. For instance, if you try to make a backup of your SD card yourself, you have to be very careful. On a Mac for instance, spotlight will try to write on the SD card and you might get a bricked GPS again.
So now the GPS unit is bricked, meaning it turns on, but is not functional. I received messages such as "mapsonic.exe failed..." or infinite loops between screens. But each time it failed to reach the main menu. I only found two solutions to my problem:
  • If you are lucky, this might work: you have to hard reset your GPS unit to factory settings. To do that: (1) Plug the AC adapter to your unit, (2) Remove SD card from unit, (3) Use something pointy such as a pin to press the reset button. Most of the time the reset button is located on the back of the device, inside a small hole, (4) Just after pressing Reset button release it and quickly press and keep holding the Power button (5) Keep holding as you will see a countdown and things like that (6) In the end factory settings will be reloaded, the GPS will restart and you will get a message to put your SD Card back. (7) After choosing your preferred settings... you GPS unit might be again fully functional... Mine did not :-(
  • Second solution is more a difficult one to achieve. The simplest way to do this is to get your unit to a Viamichelin repair point... but that might prove difficult to do. So you have to enter not so legal territory. Here's the deal. When you install your GPS unit with a SD card for the first time, a digital signature is written to the SD so that it can not be used on other units. So the main point here is to find a SD card or the content of a SD card that has not been digitally signed. How ? Well you can try ebay for a new SD card. You can also try to find the content of the SD card on the net (Google, Torrents are your friends). I give this last suggestion only as a piece of information as I think that doing this is not legal. You have to read Viamichelin disclaimer to find if you have the right to possess a digital copy of a legally purchased SD card, I have no clue. You can also find somebody who just bought a GPS unit but not yet installed the SD card. Borrow the SD, write protect the SD using the physical lock, make a copy and get the content to another SD card. Anyway once you have new SD. You can perform the hard reset step explained in solution one and use your new SD. If you only manage to get the content of an original SD, you will have to format a spare SD card to FAT, copy the files from original SD to the root of your SD and then perform the hard reset step of solution one with this SD. And that's it.
I hope this work for you !

Let me know if this helps in your comments.
Click to read more...

Thursday, October 16, 2008

Journal of a Switcher: browsing the net

Your best buddy has been nagging you for years and there it is... you finally decided to give this mac thingy a try. Believe me with time you will come to love your Mac. But at first it can be VERY difficult because most of us have been Microsoft Windows formatted for so long. Anyway one of the things I found most annoying was to build from scratch a new software library. Let me try to help you with what I found out there. This is a "to be continued" Journal of a Switcher:
  • Browser: all you'll ever need is Firefox for mac or the built-in Safari. Google Chrome is not yet available for mac. Opera and others can be great alternatives just like under Windows. I'll use the space here to tell you about my Firefox experience. To be honest, I was a bit disappointed by Firefox 2.0 (don't worry this is nothing compared to my Internet Explorer 6 experience). I found it to crash often and more seriously to be a huge memory monger. Since I have Firefox 3.0 I am totally satisfied. I don't see anything really useful about the big talks nowadays about javascript speed. What I do see is the user friendliness of Firefox 3.0, most specially through all the plugins available out there. Here are the plugins I cant' live without:
  1. Firegestures: How did we do before ? I can't remember. I use mouse based navigation all the time. But most people I see using Firefox don't even know what it is.
  2. Adblock Plus: it's not when you install it that you see a real difference but when you remove it. You get so used to browse the net without annoying ads that you really believe internet is really like that... until you remove Adblock and rediscover how bad it has become.
  3. Tabmixplus: another thing I don't see people use often in Firefox is it's tab feature. Even though tabs are built into Firefox. I've seen a lot of people open as many Firefox windows as they need just as they use to do in the old Internet Explorer days. For those of you who didn't know (after all if everybody just assume that everybody knows... we're going nowhere) if you middle click on a web link while browsing on Firefox, it will open in a tab inside the same Firefox window and you can move between tabs easily. That said, eventhough the built-in tab feature is great, I always use Tabmixplus as a replacement for it's many time saving cool options. Check it out.
  4. Downthemall!: another fine Firefox extension. Downthemall! is a download manager. With it you can fast download as it can split a large file into smaller pieces and download them concurrently, you can also stop and resume downloads, mass download selected files on a page etc. Great tool.
  5. Foxmarks: If you have more than one computer and care about having the same browsing experience, this is for you. Foxmarks can syncronize your bookmarks across as many Firefox and as many computers as you have. Even works cross platform between a Mac and a Pc. And you can also access you bookmarks at any time if you're not on your computer.
Of course, there are so many extensions (check here) out there that you can spend days testing them. Find the right ones for you.

If you found this post useful, you can buy me a coffee or two... Just click the coffee cup below ;-) Thanks a lot !!







Click to read more...

Wednesday, October 15, 2008

Prevent spammers from picking your email address from your webpage

Spams are the plague of the internet. But sometimes we provide the stick that beats us. How many of us have a webpage with our email address left there in plain sight of spam crawlers ? There are several ways to avoid robots and such from getting our email addresses. The obvious is to never share it publicly. You can also misspell your address a little and leave a message: johndoe_gmail.com (Replace the "_" with "@"). Here's a neat trick: put your email address in an image file. That's easy to do and quite efficient as robots can not crawl it and your human readers still get the info in a neat way. Open any image application, such as Microsoft Paint, Photoshop, Gimp or whatever you have around. Create a new file of the size you want it and paint the background transparent. You can also paint it in the same color as your webpage's background but painting it transparent is sure fire whatever the background color. Use the text tool in your image app to type your email address and save as an image file such as jpeg or gif. Next in your webpage, remove the written email and replace with the image. If you use a web publishing application such as Frontpage or Dreamweaver, it's quite easy to do. If you type your html yourself, just use the usual <img> tag.
Click to read more...

Sunday, October 12, 2008

Tip for the short-sighted

If you're short-sighted like me, you carry around your glasses or lenses. Sometime you don't have those around and you need to see something out of your sight range. Use this tip to boost your sight a little: take your index finger and roll it around so as to leave a small hole in the middle (see picture below) . Now look through the little hole in your rolled finger. You should see things better. This is because of an optical property. If you're short-sighted, the outside image is not formed at the correct place in your retina (sort of). Looking through your rolled finger can help with that by changing the place where the image gets concentrated (kind of).



Click to read more...

Friday, October 10, 2008

Using Gmail Quick Links

Quick links in Gmail (Google's online mail application) can be a great way to save time. For instance, spammers tend to send you crap with messy time stamps. When that happens you will see that you have unread spam but you might need to go through your whole spam folder to find those messy spams. With quick links you can improve such tasks (and others). Let's try a workaround for the problem above: in Gmail's search box type "in:Spam is:unread". These are instructions in Gmail's search language. Understand "look in the spam folder for all the emails that are unread". Click "Search mail" and all your unread spams will appear. Now the thing is to do something to avoid typing this in the search box each time you need it. So immediately after the search is complete, go to the Quick Links areas (generally on the bottom left of your Gmail window). Click "Add Quick Link" you will have a new dialog box where you need to give a name for the Quick Link you just created. Type a name and a new Quick Link by that name will appear in the Quick Links area. Each time you click the link, your unread spam will appear... nice!! You can do that with anything you search: "in:All is:starred from:dann has:attachment after:2008/09/01", this will search all your starred emails for an email from dann with an attachement received after septembre 9th 2009. You can Quick Link this.

Click to read more...