Software Engineer

Category: Howto (Page 3 of 3)

Move directory from one repository to another, preserving history

I just moved one directory within a Git repository to a directory within another repository including its history. For example:

repositoryA/
.........../directoryToKeep
.........../otherDirectory
.........../someFile.ext

repositoryB/
.........../someStuff

The goal is to move directoryToKeep into repositoryB with its history, i.e., all commits that affect directory1. If instead, you want to create a repository just for the contents of directoryToKeep, just skip the last step of the preparation of the source repository.

If you have files tracked by git-lfs, please note the update at the bottom first.

Continue reading

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 (€3.59 or $3.99).

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 and unpack them.
  • 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.

Update December 2017: Uploaded the zip file to my own server, since the original link became unavailable.

Newer posts »

© 2024 Matthias Schoettle

Theme by Anders NorenUp ↑