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
# create a topic with specified partitons | |
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --create --partitions 2 --topic test-partitions | |
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --describe --topic test-partitions | |
# create a topic with default partitions | |
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --create --topic test-def-partitions | |
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --describe --topic test-def-partitions | |
# alter the number of partitions of an existing topic | |
kafka-topics --bootstrap-server xx.xx.xx.xx:39092 --alter --topic test-def-partitions --partitions 3 |
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
#conda create an env | |
conda create -n py376-tf241 ipykernel python=3.7.6 | |
conda activate py376-tf241 | |
# find out current gpu avaliablity | |
import tensorflow as tf | |
print(tf.__version__) | |
print(tf.config.list_pysical_devices()) |
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
sudo service docker stop | |
sudo vi /etc/docker/daemon.json | |
{ | |
"data-root": "/path/to/your/docker" | |
} | |
sudo service docker start |
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
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo | |
sudo dnf repolist -v | |
dnf list docker-ce --showduplicates | sort -r | |
sudo dnf install --nobest docker-ce | |
sudo systemctl disable firewalld |
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 docker | |
sudo apt-get update | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg \ | |
lsb-release |
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
cd .git/hooks | |
curl -o pre-commit.sh https://raw.githubusercontent.com/google/yapf/main/plugins/pre-commit.sh | |
chmod a+x pre-commit.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
mkdir -p data_sources && curl -s "http://localhost:3000/api/datasources" -u admin:admin|jq -c -M '.[]'|split -l 1 - data_sources/ | |
for i in data_sources/*; do \ | |
curl -X "POST" "http://localhost:3000/api/datasources" \ | |
-H "Content-Type: application/json" \ | |
--user admin:admin \ | |
--data-binary @$i | |
done |
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
##FILE SPACING: | |
# double space a file | |
sed G | |
# double space a file which already has blank lines in it. Output file | |
# should contain no more than one blank line between lines of text. | |
sed '/^$/d;G' | |
# triple space a file |
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
1 launch.sh | |
2 curl -L https://github.com/kubernetes/kompose/releases/download/v1.9.0/kompose-linux-amd64 -o /usr/bin/kompose && chmod +x /usr/bin/kompose | |
3 kompose up | |
4 kubectl get deployment,svc,pods,pvc | |
5 kompose convert | |
6 ls | |
7 kubectl apply -f frontend-service.yaml,redis-master-service.yaml,redis-slave-service.yaml,frontend-deployment.yaml,redis-master-deployment.yaml,redis-slave-deployment.yaml | |
8 kompose --provider openshift convert | |
9 kompose convert -j | |
10 ls -l |
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
kubectl -n kube-system get deployment coredns -o yaml | \ | |
sed 's/allowPrivilegeEscalation: false/allowPrivilegeEscalation: true/g' | \ | |
kubectl apply -f - |