Topics

General notes on the following technologies:

Git

Squashing commits

This seems to be the standard method.

To summarise - on the relevant branch use the following to open the default text editor (where x is the number of commits to include):

git rebase -i HEAD~x

Leave one commit as ‘pick’ and change the rest to ‘squash’.

Interesting discussion of the squash rebase workflow.

There are alternative approaches:

Use reset to merge

Rebasing wtih DevOps and squash commits

Scenario: A pull request has been made based on a developemnt branch. Upon completion will be merged to master using a squash commit. In the meantime, additional development - that is dependent on the changes that make up the first PR - has started. When the the PR is completed the second development branch will have a different history (it’s based on the original commits that have now turned in to a single squash on master). To avoid dealing with conflicts the second development branch can be rebased on to of master.

  • Once the PR is complete, checkout ‘master’ and pull to ensure it is up-to-date.
  • Checkout the development branch and run the following (change the final number to reflect the number of commits in the development branch):
git rebase --onto master HEAD~1

Cleaning up old branches

git remote prune origin --dry-run

Additional notes

Docker

Useful containers

docker run -d --name seq -e ACCEPT_EULA=Y --restart always -p 5341:80 datalust/seq
docker run -d --name ghost --restart always -p 3001:2368 ghost

Copying files

docker cp name-1:/dump/onet C:/

Volumes

DO NOT use ~ (home directory) when specifying volumes (on Windows).

DOES NOT WORK
volumes:

- ~/files:/home/docker-user/files

WORKS
volumes:

- /home/host-user/files:/home/docker-user/files
  

House keeping

Remove all images that aren’t connected to a container:

docker image prune -a

Error occured: Cannot enable hyper-v service

This occured after a BIOS update. Hyper-V was still enable but Docker could not launch. Running:

bcdedit /set hypervisorlaunchtype auto

As discussed here resolved the issue.

Docker Compose

Find out information about running processes:

docker-compose top

SQL Server

When logs get big you can try this (from here):

DBCC SHRINKDATABASE (DataWarehouse, 10);
GO

Node

npm ls -g --depth=0 // List out top level global packages

Python

Installing on Windows

Installation method Expected path
Manual (all users) C:\Python3x
Manual (local user) C:\Users\[user]\AppData\Local\Programs\Python\Python3x
Microsoft Visual Studio C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64

See this SO answer for more information about the Microsoft Visual Studio location.

Anaconda

The key benefits of using Anaconda from this SO answer:

Anaconda is a python and R distribution. It aims to provide everything you need (Python-wise) for data science “out of the box”. It includes:

  • The core Python language
  • 100+ Python “packages” (libraries)
  • Spyder (IDE/editor - like PyCharm) and Jupyter
  • conda, Anaconda’s own package manager, used for updating Anaconda and packages

and

It is quite complete and avoids problems in building libraries that you need from source code, that frequently plague one by one installations of those libraries by tools like pip.

Considerations:

  • The independent package management can sometimes be behind.
  • Larger size - is it suitable for the project e.g. Docker perhaps?

Unit testing

Azure

ACR (Azure Container Registry)

az acr repository show-tags --name <registry>.azurecr.io/<image>:<tag> --repository <repo>