Skip to content

Blog

Reducing file size of a PDF on Mac OS

The file size of PDFs can become quite large, especially when scanning documents or documents containing images. Instead of sending large files, it is almost always recommended to reduce the file size. To do that, there are several ways. For example, there is an app called PDF Squeezer in the Mac App Store (in 2013: €3.59 or $3.99, more expensive today).

The same functionality can be achieved using Quartz filters in the ColorSync Utility. There is already one called Reduce File Size but it might lead to a blurry PDF. You can copy this filter and adjust the settings. However, I found custom filters in the Apple Support Community that work quite well.

  • Download the filters
  • Move the filters to ~/Library/Filters
  • Open your PDF with ColorSync Utility
  • In the bottom, choose the appropriate filter. There are several options starting with "Reduce to ..."
  • Click "Apply"
  • If you are satisfied with the result, save the file under a different file name (File > Save As).

Alternatively, you can place them into /Library/PDF Services/ instead. Besides the fact that the filters will be available to all system users, when exporting PDFs in Preview, you can select a filter directly in the dropdown under Quartz Filters.

If the filters don't work perfectly for your use, you can adjust the settings within the ColorSync Utility.

The original creator of the filters to be credited seems to be Jerome Colas according to this GitHub repository.

Updates to this blog post

  • December 2017: Uploaded the ZIP file to my own server, since the original link became unavailable.
  • 27.10.2024: Replaced ZIP file with link to GitHub repository to download filters

LyX: Installing unknown document classes

If you either received a LyX file that uses a document class unknown to your LyX installation or you would like to create a document using one of the options in the settings dialog, you need to install that document class.

This description is for Mac OS based on the latest version of MacTeX (as of May 28th 2012 this is MacTeX-2011), but should work with any version.

PostgreSQL accepts any or no password when connecting

When connecting to the database with the postgres user I realized it accepts any password or no password even though the user has a password set. I don't know if this happens also when using the installer to install PostgreSQL. In my case I used initdb to set it up.

I remember it mentioned something regarding "trust" after setting it up but didn't take much notice until I realized it accepts any password.

In pg_hba.conf it adds all local connections to be trusted which means connecting from the same host doesn't require authentication.

host    all             all             127.0.0.1/32            trust

If you don't like that just change it to another method.

Using multiple SVN clients with the svn+ssh protocol and a putty profile

When trying to access an SVN repository using the svn+ssh protocol with TortoiseSVN it might happen that the password prompt shows up endless times. One suggested solution is to set up a profile in putty and use a private key for authentication for SSH there. Then in TortoiseSVN the host name just has to be changed to the name of the profile, e.g., svn+ssh://username@puttyProfileName/path/to/repo.

This works well until trying to reuse the stored SVN information of your local working copy in another client, for example your IDE. In my case I am using Eclipse with the Subclipse plug-in, and my first approach didn't work with Subclipse. This meant I couldn't do any team actions from within Eclipse when the projects where checked out using TortoiseSVN. If you are only using either of them it works fine.

The solution is quite simple: Rename the putty profile to the actual hostname and use the regular URL for the repository. That's it. If you've used the putty profile name before just use relocate in TortoiseSVN to change the repository URL. TortoiseSVN will then still use the putty profile with the private key to authenticate. Other clients like Subclipse see it as an actual hostname and are able to use that.

Hide star besides email addresses in Thunderbird

If you—for some reason—don't like the yellow (for contacts in your address book) or gray (for unknown contacts) star next to email addresses in the message header there's a simple way on how to hide it.

If you don't have one yet, all it needs is a file called userChrome.css inside a folder called chrome inside your profile folder. Add the following content:

.emailStar {
    display: none !important;
}

If you ever want to see it again just delete those lines.

Thunderbird Extension: Toggle Headers

After updating my Thunderbird to the current version there was one extension not working anymore: Headers Toggle. Even manually adjusting maxVersion in the install.RDF to pretend it's compatible didn't work. This extension allowed you to switch the headers view between seeing all headers (All) and the most important header information (Normal) with a single key shortcut H. Unfortunately this extension hasn't been updated in a long time.

I created a new Thunderbird extension called Toggle Headers that allows you to do this and works with the current (and upcoming) Thunderbird version.

Update: The newest version (0.3) of Toggle Headers  is compatible with CompactHeaders. When both are used at the same time the current state of the headers view is taken into account:

  • when collapsed and H is pressed, the headers view will be expanded and all headers shown
  • pressing H again will switch back to the normal headers view but also collapse the view again (the previous state is remembered)

Newer blog posts

Things discovered in Struts 2

In this post I write about some things I discovered during the development of a university project where Struts 2 is used. I note them since I couldn't find them in the documentation and they were discovered by digging through pieces of documentation, the code, and the web.

Hide the "Network" icon from Windows 7 Explorer

If you want to hide the "Network" icon from the sidebar of the Windows Explorer in Windows 7 you can do this by modifying the registry. In order to be able to do this you have to be logged in as an Administrator. Despite that you'll have to give yourself the permissions to change the value. You can remove the permissions after you are done again.

Caution

Please be aware that you should back up the registry before making any modifications. At least the key you will modify.

In the registry go to the following key HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder\ and change the value of Attributes from b0040064 to b0940064. (Source)

Important

The network environment will still be accessible. It will not restrict access to it using other ways.

Mac OS: Airport not connecting automatically to Wi-Fi

A few weeks ago I helped a friend with an issue he had on an iMac with the Wi-Fi. After a while AirPort stopped from connecting automatically to the Wi-Fi. Although this can be caused by various different issues I want to describe the one I found. All the other instructions can be easily found on the web with the search engine of your choice.

If the Wi-Fi uses a hidden SSID it can often cause problems. This was not the cause here though. Although it doesn't really increase the security (because there are tools you can use that reveal it) it can help on a social basis when people just shouldn't see that there is a Wi-Fi.

Anyways. As a side note: There were two iMacs set up the same way. One worked fine but the other didn't so something must have been different between the two. A lot of tips didn't help but they could help in your case. In this case the problem was caused by the fact that the SystemPreferences application was moved out of it's original place. After moving it back to the Application directory (/Applications) and restarting the machine it worked fine again. I suspect this could cause more problems than the one described here.