Stop Check Point VPN Client Autostart

For some VPNs that I need to connect to, the required program is called Check Point Endpoint Security. One of the most annoying features of the application is that it starts up when your computer starts, and throws up the connect dialog immediately.

There is no way in the UI to disable the autostart. What you have to do is to go into the file

/Library/LaunchAgents/com.checkpoint.eps.gui.plist

and change the part where it says

 <key>RunAtLoad</key>
<true/>

to

 <key>RunAtLoad</key>
<false/>

Alternatively you can use the plist editor from Xcode and change the RunAtLoad setting from YES to NO.

Screenshot 2016-05-14 11.24.57

One major itch scratched. Thanks to my colleague SimonD for finding the solution.

Advertisements

Taking CTRL Over UNIX Shortcuts in OS X

Did you know that many of the standard keyboard shortcuts from *nix also work in OS X? Not only in the Terminal where Bash shortcuts work, but globally in the OS. 

The shortcuts I mostly use are ctrl-a for moving the cursor to the beginning of the current line, ctrl-e for moving to the end of the line, and ctrl-d for delete. The normal way to use home, end, and delete on the MacBook Pro keyboard require you to leave the home row and use Fn in combination with arrows or backspace. 

From an ergonomic point of view, the ctrl key is in a slightly awkward position since it requires you to bend, twist, and stretch your left pinky in order to press it. I resorted to mapping Caps Lock to the ctrl key, since I never use caps lock, and the remapping is really easy to do in OS X. In System Preferences – Keyboard Settings, and Modifier keys… you can choose what function each of the modifier keys should have.  

 

Wikipedia has a good list of shortcuts with the ctrl key in different OSs. 

Three Finger Drag on Trackpad with Force Click

A really neat gesture I use on my trackpad is using three fingers to move a window. No clicking, holding, and dragging is necessary, just moving around with three fingers. On older MacBook Pros without Force Click, the configuration dialog looks like this:  

 
When I got a new computer, I was going to enable it there too, but the setting wasn’t there anymore! The configuration now looked like this:  

 
After some Googling, I found out that the setting has been moved under Accessibility – Mouse and Trackpad – Trackpad Options:  

 
There you go. I hope this helps someone 🙂

Programmatically Copying Files to Clipboard on OS X

After using the script I showed you in my post on command line zip for a while, we tried to scratch one more itch. We wanted to avoid having to manually copy the file to the clipboard, and wanted to see whether it was possible to have the script put it there.

We ended up using the osascript command to run some AppleScript. Here is the updated script.

#!/bin/bash
rm dist.zip
zip -r -x *cache* -X dist.zip ui api index.html
dir=`pwd`
osascript \
  -e 'on run args' \
  -e 'set the clipboard to POSIX file (first item of args)' \
  -e end \
  "${dir}/dist.zip"

The first lines is the old script that removes the existing zip file and zips up the content we want. Afterwards, we fetch the current directory (the full path is needed), and run the provided AppleScript to put it in the clipboard.

Another itch scratched 🙂

Window Manager for OS X

One thing that I found a bit difficult on the Mac was to arrange windows. Maximizing the window did not always work as I wanted it to, it was a hassle to arrange two windows side-by-side. In Windows 7, you can snap a window to half the display by simply dragging it to the edge of the display. I wanted something similar in OS X.

After a quick Google-search, I found several alternatives, quite a few commercial ones, but I wanted something free, so I tried out ShiftIt, and haven’t tried anything else since that. It did exactly what I wanted it to do, and more.

ShiftIt provides keyboard shortcuts for moving current window to any quarter or half of your display, move the window to the next display, maximizing, increasing and decreasing size, and centering the window. It is a tool that helps scratching another itch 🙂

A few notes about ShiftIt (and I think this applies to other window managers too). In order to allow ShiftIt to modify your windows, it needs to be allowed to use the Accessibility UI. The place where this happens has moved in OS X 10.9 and 10.10. So, if you get the following message:

ShiftIt Accessibility

You have to go into the following place, and check the box. NOTE! If the box is already checked, you might have to uncheck it, and check it again.

Accessibility settings

Command Line ZIP on OS X

To zip up files and folders for the distribution package I mentioned in my previous post, we use the shell script below. The same command can of course be used directly from the command line too.

#!/bin/bash
rm dist.zip
zip -r -x *cache* -X dist.zip ui api index.html

The key here is the zip command. The different options we give in to the command are:

  • -r for recursive, since we want to include subfolders too
  • -x to exclude things, in this case, the cache folder (located inside the api-folder)
  • -X to exclude extra file attributes, can’t remember if this was necessary, might be, since we target Windows
  • dist.zip, the filename to create
  • …. the files or folders to include

This has really sped up the deployment time, and also reduced a lot of frustration. Instead of hand-picking the files and folders to include, and manually copy over those files to the server, there is just one file that is created automatically by the script above. It did not take many minutes to research and implement, once I actually allowed myself to take a break and scratch this particular itch.

UnZip with VBScript

When deploying a project to a certain customer’s servers, for a couple of reasons, we have to do it by manually copying over the files to a certain directory over RDP and SSL VPN. To speed up the transfer, we zipped the files on our development machines, since it’s quicker to copy one big file than many small ones.

Metal zip

Unzipping on the (Windows) server was a bit tedious (right-click, extract here, yes overwrite, etc.) so we cooked up a small VBScript that did the extraction. The code below is saved as ‘unpack.vbs’.

ZipFile="dist.zip"
ExtractTo="./"

Set fso = CreateObject("Scripting.FileSystemObject")
sourceFile = fso.GetAbsolutePathName(ZipFile)
destFolder = fso.GetAbsolutePathName(ExtractTo)

Set objShell = CreateObject("Shell.Application")
Set FilesInZip=objShell.NameSpace(sourceFile).Items()
objShell.NameSpace(destFolder).copyHere FilesInZip, 16

Set fso = Nothing
Set objShell = Nothing
Set FilesInZip = Nothing

The code contains the hardcoded name of the zip file, gets the absolute path names of the source and destination, followed by instructions to copy the files from the zip to destination. The ’16’ in the options means to overwrite without asking. Finally, there’s some cleanup taking place.

What this script allows us to do is instead of manually unzip, choosing to overwrite, etc, just double click on this script file. That’s one itch less.

In a follow-up post, I’ll show you how we zip the files we want on OS X.