Restful Servies, Git and Other Materials

From: DCosta, John (HAL) Sent: Wednesday, December 17, 2014 4:55 PM

http://git-scm.com/book/en/v2

http://www.javaworld.com/article/2113465/developer-tools-ide/git-smart-20-essential-tips-for-git-and-github-users.html

http://fideloper.com/hexagonal-architecture

http://alistair.cockburn.us/Hexagonal+architecture

http://codeplanet.io/principles-good-restful-api-design/

http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/

http://www.slideshare.net/mario_cardinal/best-practices-for-designing-pragmatic-restful-api

http://blog.2partsmagic.com/restful-uri-design/

http://martinfowler.com/articles/microservices.html

http://www.codingpedia.org/ama/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring/

Supporting multiple monitors with Macbook Pro

Used thunderbolt adapters to drive two external monitors.  One of them was rotated so there was another tweak necessary to get this to pickup.

Settings, Monitors

Choose: Gather Windows

Multiple windows appear, choose the window/panel with the monitor to rotate, and it should have a rotation option.

Please see attached example.

Rotate external monitor
Rotate external monitor

Offers4U Malware on Mac

Looks like John D, got hit by this item, fairly good article for removal.

http://virusremovalguideline.blogspot.jp/2014/05/offers4u-popup-how-do-i-stop-ads-by.html

Looking for MacBook Changes

John was looking around his MacBook pro to see if any Malware was installed.  These are notes from terminal history of where to look.

465 ls -ltr
466 cd /Library
467 ls -ltr
468 cd LaunchAgents/
469 ls -ltr
470 cd ..
471 cd LaunchDaemons/
472 ls -ltr

How to close save dialog with keyboard

Mac seems a bit backwards where you cannot close a dialog by default with the keyboard.  You need to go into settings, keyboard, shortcuts.

In the "Full keyboard access" section, choose the radio "All Controls"

After this, you can close without saving by using the space bar, use escape to cancel or enter to save with a prompt.

OS X: How to Change Default Application to Open File Type

If you click on a file and the wrong app opens it, you can change the default application to open that file or file type. These are the steps to both change the default app to open one specific file or to change the default app to open all files of one file type.

Change Default App for One File:

1. Ctrl-click on the file you want to open
2. Click Open with
3. Select Other
4. Select the applcation you want to open the file
5. Select Always Open With
6. Click Open button

Now that one file will always open with the application you picked.

If you want to change the default app that opens all the files of one particular file type, you can do that too.

Change Default App for All Files of a File Type:

1. Ctrl-click on the file
2. Click Get Info
3. Under Open With pick the app that you want to become the default
4. Click the Change All button
5. Confirm your decision

Macbook Sound Through HDMI

Installed sound flower and then it did not seem like audio went through the monitors speakers anymore.  Hold [Option}+[Sound Icon] at top of Macbook Panel to select the monitor's speakers again.

no vpn secrets ubuntu 14.04

I just rm'd all files in /etc/NetworkManager/system-connections/ and restarted Ubuntu 14.04. Problem solved. I know it was the last software update because I updated and shutdown. The next time I started up Ubuntu, the network kept dropping connection.

This almost worked to start from the command line but might need to run as sudo, might try if there are future problems.

Probably need this, needs read/write access to /var/run/vpnc, or change it's permissions:
$ sudo openconnect --no-cert-check gateway.hollandamerica.com

Original attempt that failed:
$ openconnect --no-cert-check gateway.hollandamerica.com

Another Idea is to try this for the, no luck with this:
[vpn]
password-flags=0

https://faq.i3wm.org/question/3796/nmcli-connection-activation-failed-no-valid-vpn-secrets/

Adding shortcuts with Forklift

From: BinaryNights Support [mailto:support@binarynights.com]
Sent: Tuesday, December 02, 2014 7:27 AM
Subject: Re: Go, Connect

Hi Maurice,

1. Go to ‘Favorites > Show Favorites’ (or press Esc) 2. Click on the plus button at the bottom 3. Select the protocol and fill in the fields then click on Save 4. Connect to the server from sidebar (or from Favorites)

kind regards,
Bam

Create Encrypted Disk Image on MacBook Pro

Refer: http://www.howtogeek.com/183826/how-to-create-an-encrypted-file-container-disk-image-on-a-mac/

Macs don’t need third-party utilities like TrueCrypt to create a secure, encrypted container for your sensitive files. You can create an encrypted disk image using the built-in Disk Utility.

Whenever you want to access your files, you can “mount” the image file and provide your password. Whenever you want to lock access to your files, you can unmount the image file.

Create an Encrypted Disk Image
To get started, you’ll need to open the Disk Utility application. Open a Finder window, click Applications in the sidebar, double-click the Utilities folder, and double-click Disk Utility. You can also just press Command+Space to open Spotlight search, type Disk Utility, and press Return to open it.

mac-disk-utility-new-image

Click New Image on the toolbar in the Disk Utility window. This will create a new disk image (.dmg) file. Here are the options you’ll need to configure:

Save As: Provide a file name for the disk image file. For example, if you name it “MyImage”, the container file will be saved on your hard drive as a file named MyImage.dmg.
Name: Enter a name for the disk image file. This name is more of a description — it will appear as the name of the container when the file is mounted.
Size: Choose a size for your disk image file. For example, if you choose 100 MB, you’ll only be able to store up to 100 MB of files inside it. The container file will take up the maximum file size immediately — so, if you choose 100 MB, it will take 100 MB of space on your hard drive even if you have no files saved inside it yet. You can enlarge or shrink the disk image later.
Format: Select Mac OS Extended (Journaled) as the file system.
Encryption: Choose either 128-bit or 256-bit AES encryption. 256-bit is more secure, while 128-bit is faster. If you’re encrypting sensitive files, you’ll probably want to choose 256-bit and accept the slight slow-down for more security.
Partitions: Select Single partition – Apple Partition Map to use a single partition inside your disk image file.
Image Format: Select read/write disk image so you can read from and write to the disk image at any time.
create-encrypted-disk-image-with-disk-utility-on-mac

Click Create and you’ll be prompted to create an encryption password for your disk image. Provide a strong password — this dialog will estimate your password strength to help you with choosing a password. If you lose this password, you’ll lose access to the files inside your encrypted disk image. Be sure to pick something memorable.

You’ll probably want to uncheck the “Remember password in my keychain” option. This option will remember the password in your Mac user account’s keychain so it can be automatically filled in the future.

choose-password-for-encrypted-file-container-on-mac

The disk image will be created, formatted, and automatically mounted for you. You’ll find it on your desktop and in the Finder under Devices. To encrypt files, just save them to this device.

To unmount the encrypted disk image, click the Eject button under Devices in finder or right-click or Ctrl+click its desktop icon and select Eject.

use-and-unmount-encrypted-disk-image-on-mac

Mount the Encrypted Disk Image
To mount the encrypted disk image in the future, locate its file on your hard drive — it will have the .dmg file extension — and double-click it. You’ll be asked for the encryption password you provided while setting it up.

After you provide the password, you can access the contents of the file just as you would access any other disk image or removable device.