EXPR Syntax | Bash Equiv | Meaning |
---|---|---|
SEE NOTE 1 | "${ARG1:-$ARG2}" | ARG1 if it is neither null nor 0, otherwise ARG2 |
ARG1 & ARG2 |
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
# Prerequisites: | |
# [GNU Parallel](https://www.gnu.org/software/parallel/) | |
# [kubectl-neat](https://github.com/itaysk/kubectl-neat) | |
# [mikefarah/yq](https://github.com/mikefarah/yq) | |
# | |
# Usage: | |
# - Copy and paste the below into your active shell session. Alternatively, add to your shell initialization scripts. | |
# - kubectl_export <namespace> | |
# The folder structure will be created: <namespace>/<kind>/<resource_name>.yaml | |
# |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
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
#! /bin/bash | |
# ECHO COMMAND | |
# echo Hello World! | |
# VARIABLES | |
# Uppercase by convention | |
# Letters, numbers, underscores | |
NAME="Bob" | |
# echo "My name is $NAME" |
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
#!/bin/sh | |
# Only Run If Any Cloudformation Template Is Modified And Checks Linting Of The Template | |
#------------------ | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
#------------------ | |
FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.yml" "*.yaml" | sed 's| |\\ |g') |
- Guided Self learning (https://linuxjourney.com)
- Best one liners for linux command line (https://www.commandlinefu.com/commands/browse)
- Find files in linux from command line (https://linuxize.com/post/how-to-find-files-in-linux-using-the-command-line)
- Improve your typing speed on the command line with this awesome tool! (https://github.com/balzss/cli-typer)
- An interactive cheatsheet tool for the command-line (https://github.com/denisidoro/navi)
- Customize your shell environment to next level (https://github.com/alebcay/awesome-shell)
- I find it useful to learn new things with the self learning courses offered by github (https://lab.github.com)
- A static analysis tool for shell scripts (https://github.com/koalaman/shellcheck)
- A good collection of bash snippets if you are starting to learn about shell scripts in linux (https://github.com/alexanderepstein/Bash-Snippets)
- Linux workshop 10 days (https://linuxessentials.netlify.app)
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
import boto3, os, botocore, traceback | |
from botocore.exceptions import ClientError | |
s3 = boto3.client('s3') | |
# READ VALUES FROM ENVIRONMENT VARIABLES | |
source_s3_bucket = os.environ['source_s3_bucket'] | |
#kms_keyid = os.environ['Kms_Keyid'] |
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
#!/bin/bash | |
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) | |
echo -e "Installing nvidia-docker2 for $distribution" | |
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ | |
sudo apt-key add - | |
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \ |
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
root@gpu-01:~# python | |
Python 3.6.8 |Anaconda custom (64-bit)| (default, Dec 30 2018, 01:22:34) | |
[GCC 7.3.0] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from tensorflow.python.client import device_lib | |
>>> print(device_lib.list_local_devices()) | |
2019-04-03 19:09:01.537417: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA | |
2019-04-03 19:09:02.180944: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero | |
2019-04-03 19:09:02.181307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1344] Found device 0 with properties: | |
name: GeForce RTX 2080 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.545 |
NewerOlder