These are interview questions for bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#verify-you-have-cuda-enabled-system | |
| # https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation | |
| # https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=debnetwork | |
| # https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#post-installation-actions | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| # https://github.com/NVIDIA/nvidia-docker | |
| echo "Install gcc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| ) | |
| func mainHandler(w http.ResponseWriter, r *http.Request) { | |
| fmt.Println("Success 1") | |
| w.Write([]byte("Success 2")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Courtesy of: https://stackoverflow.com/a/37549527/2330648 | |
| package main | |
| import ( | |
| "net/http" | |
| "net/http/httptest" | |
| "testing" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arp -a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Password only | |
| ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected] | |
| # Key only | |
| ssh -o IdentitiesOnly=yes -i ~/.ssh/server.key [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import os | |
| import glob | |
| import getpass | |
| import argparse | |
| from PyPDF2 import PdfFileWriter, PdfFileReader | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install everything | |
| brew install kompose kubectl | |
| brew cask install minikube virtualbox | |
| # Start minikube | |
| minikube start | |
| # Convert | |
| kompose convert -o k8s.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM docker:18.03.0-ce-dind | |
| COPY . /work | |
| WORKDIR /work | |
| RUN apk add -U bash git python jq openssl util-linux apache2-utils gettext curl py2-pip && \ | |
| pip install awscli docker-compose | |
| ENTRYPOINT ["/work/entrypoint.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -it --rm --privileged --pid=host justincormack/nsenter1 |