# add shallow submodule
git submodule add --depth 1 <repo-url> <path>
git config -f .gitmodules submodule.<path>.shallow true
# later unshallow
git config -f .gitmodules submodule.<path>.shallow false
git submodule update <path>Sometimes you want to build a Docker image with secrets. To do so, you should use BuildKit and add this line to the start of your Dockerfile:
syntax=docker/dockerfile:1.4
Then, if you have the secrets as an environment variable in your local machine, do:
$ export MYSECRET=theverysecretpassword
$ export DOCKER_BUILDKIT=1
$ docker build --secret id=mysecret,env=MYSECRET .Given this directory structure
project
├── utils
│ └── module.py
└── notebooks
└── notebook.ipynb
and that you want to import module.py in notebook.ipynb. Add the directory path to the notebook like so,
| #!/bin/sh | |
| # Ref 1: https://stackoverflow.com/a/11080028 | |
| # Ref 2: https://trac.ffmpeg.org/wiki/Encode/MPEG-4 | |
| ffmpeg -i input_video.mp4 -qscale:v 2 -c:a aac -strict -2 output_video.wmv |
Install k3s master and expose api:
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --write-kubeconfig-mode 644 --bind-address 0.0.0.0" sh -The --write-kubeconfig-mode 644 gives /etc/rancher/k3s/k3s.yaml group and world read permissions so that we can run kubectl without sudo.
The INSTALL_K3S_EXEC argument can be modified at /etc/systemd/system/multi-user.target.wants/k3s.service.
| Ref: https://superuser.com/a/262795 | |
| You will have to look once at the source of the login form to find out the names of the user and password fields. As the authentication redirect all pages, use any URL to get that source: | |
| curl http://www.google.com > login.html | |
| For example, you'll find: |
| # Ref: https://hub.docker.com/r/treyduskin/python-setuptools/Dockerfile | |
| FROM ubuntu:trusty | |
| RUN apt-get update && apt-get install -y python-pip createrepo rpm dpkg-dev git | |
| RUN pip install setuptools-scm && pip install --upgrade setuptools | |
| VOLUME /build | |
| #COPY . /build/ |
https://stackoverflow.com/q/32540919
- https://stackoverflow.com/a/56191155
- Create a personal library to install the R packages
dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)
Turn paged output for git branch back off by default
git config --global pager.branch false
Reference: https://stackoverflow.com/a/48370253
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install gitIf you receive an error about add-apt-repository command not found you need to install software-properties-common, and then redo the above steps.
sudo apt-get install software-properties-common