Merge Password-Protected PDF files

Sometimes, PDF files—like those from book chapters—come password-protected to prevent editing, which also stops you from merging them without knowing the password. If printing is allowed, you can work around this by printing the file to PDF, but this creates a new PDF where the text is no longer selectable or searchable. While you could re-OCR the file, a much better solution is to use an old yet powerful tool: Ghostscript, originally developed by Adobe.

Ghostscript allows you to manipulate PDF files easily, including merging multiple PDFs into one. For example, to merge three PDFs named 1.pdf, 2.pdf, and 3.pdf, you can run the following command:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf 1.pdf 2.pdf 3.pdf

Here’s what the parameters mean:-dBATCH: Tells Ghostscript to process all files and then exit (batch mode).-dNOPAUSE: Disables pauses between processing each page (no manual intervention required).-q: Runs the command quietly, suppressing most of the output messages.-sDEVICE=pdfwrite: Specifies that the output should be written as a PDF.-sOutputFile=merged.pdf: Defines the name of the resulting merged file.

If you have many files that are consecutively named (e.g., 1.pdf to 100.pdf), you can generate the file list dynamically in the command line, like this:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=merged.pdf $(seq -f "%g.pdf" 1 100)

Note that the gs tool takes considerable time to handle so many entries, but this approach saves your time after all.

Windows .bat file command line tool, wait for keypress when double-clicked

Windows .bat files can be a convenient and quick way to automate things, like, for example, a compilation command involving a lot of options. They can be executed from the command line or by double-clicking them from the explorer. In the latter case, one would want the script to wait for a keypress until they close the window. When started from the command line, the waiting from a keypress is rather annoying.

It is possible to make the script behave differently depending on the way it was executed:

IF /I %0 EQU "%~dpnx0" PAUSE

This executes the PAUSE command when the file was started by double-click.

Source: Detect if bat file is running via double click or from cmd window

Starting a local Webserver for Testing

Easiest way is to open a console window in what you would like to have as root directory of your webserver and start

python -m http.server

Then, by serving to http://127.0.0.1:8000 you will be able to view and browse the contents.

To specify a port, just add the port number to the command, for example

python -m http.server 9999

Please not that this webserver does not support https, so you have to enter the URL with a starting http:// and you might have to click away a browser warning because of the unsecured site.

Therefore, only use this for local testing!

Making Screenshots under Windows

To copy a screenshot of the active window into the clipboard: Alt + PrntScrn (Alt + Druck on a German keyboard) Note that the clipboard will be overwritten, so if you want to take two screenshots, you have to paste the first screenshot before taking the second one.

To copy the whole screen into the clipboard: PrntScrn (Druck on a German keyboard)

To make a screenshot with customized clipping, press Winkey + Shift + S.

To save a screenshot of the active window: Alt+ Winkey + PrntScrn (Alt + WinKey + Druck on a German keyboard) The image will be saved in PNG format into the folder Videos\Captures (Videos\Aufzeichnungen on a German Windows)

To save a screenshot of the whole screen: Winkey + PrntScrn (WinKey + Druck on a German keyboard) The image will be saved in PNG format into the folder Pictures\Screenshots (Bilder\Bildschirmfotos on a German Windows)

While it is crazy that two different folders are used for saving the images, other than that the shortkeys are a convenient method to quickly obtain and save screenshots.

When Windows 10 search suddenly stops working

The search function is a very convenient thing – you press the windows key and start typing, getting displayed the apps or files of interest as you type. For me this feature suddenly stopped working. A renew of the search index, as recommend on several sites did not solve the problem. The troubleshooting program of Windows identified a problem with folder access rights, but this was not the problem. The reason was that the search service was not started anymore for some reason, this might have happened at one of the past updates.

After having the problem identifed, issueing the command searchIndexer.exe /Embedding in an elevated console solved the problem for good.

Fix DPI scaling issues in Windows

If you have a computer with an awesome hi-res display (mine is 3840 x 2160) you might know the problem: some older application don’t follow the DPI upscaling setting of Windows, which makes them in practise unusable.

To fix this issue, you can tell Windows to manually scale up some particular applicatons. To do this, you must first find the place where the application file is located, for example by right-clicking on the program in the start menu:

step1-findfileThen enter the properties page of the file with another right-click:

step2-filepropertiesand tell Windows in the compatibility tab to do the scaling instead of asking the application to do it:

step3-DPIcompatibility

filegive: send and receive files across computers

filegive easily sends or receives files point-to-point, with authentication and ciphering, and the other side only needs a Web browser. No third party server is involved in the transfer. It can use common NAT traversal protocols like uPnP and NAT-PMP, manually forwarded ports, or a public ssh server.

filegive is a commandline tool available for Linux, Windows and Mac OS.

Project page with commands and download links

Connection from Mac OSX Mavericks to Windows

Solution provided by Prof.Bettstetter:

After installing OS X Mavericks on a Mac, you can no longer connect from this Mac to a Windows share.

Solution:

On the MAC: System preference (Systemeinstellungen) -> Sharing (Freigabe) -> File Sharing (Dateifreigabe) in the left side vertical bar -> Options (Optionen). Read the note about „Windows-Dateifreigabe“ and chose the user of your choice.

You may also test to uncheck the Share files and folders using SMB and check the Share files and folders using AFP checked.

See https://discussions.apple.com/message/23470245#23470245