Skip to content

Instantly share code, notes, and snippets.

dzlab / kubectl_describe_tfjob_mnist-tensorflow-job.txt
Created Jul 18, 2020
TensorFlow Distributed Training on Kubeflow with TFJob
View kubectl_describe_tfjob_mnist-tensorflow-job.txt
Name: mnist-tensorflow-job
Namespace: default
Labels: <none>
Annotations: API Version:
Kind: TFJob
Creation Timestamp: 2020-07-18T18:54:31Z
Generation: 1
Resource Version: 43041
Self Link: /apis/
View spark-operator.yaml
apiVersion: v1
kind: Namespace
name: spark-operator
apiVersion: v1
kind: Namespace
name: spark-apps
dzlab /
Last active Jun 11, 2021
Configure NGINX to log HTTP POST request's body
echo "Building NGINX along with Echo module"
# install prerequisites
yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel
# download the Echo module
curl -L -O ''
tar -xzvf v0.58.tar.gz && rm v0.58.tar.gz
mv echo-nginx-module-0.58 /tmp/echo-nginx-module
dzlab / go_sftp.go
Created May 6, 2016
an example of sftp in golang
View go_sftp.go
package main
import (
func main() {
addr :=my_ftp_server:22"
config := &ssh.ClientConfig{
dzlab /
Last active Apr 14, 2016
A collection of maven commands
# maven ignoring license
mvn install -Dlicense.skip=true -DskipTests
# maven fat jar
mvn assembly:assembly -DdescriptorId=jar-with-dependencies -DskipTests
# maven generate webapp project
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp
# maven generate empty project
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
dzlab /
Last active Dec 1, 2015
A collection of docker related commands
#Build a docker image
cd myproject
docker run --rm -v "$(pwd):/src" -v /var/run/docker.sock:/var/run/docker.sock centurylink/golang-builder
#Create Docker machine on AWS
docker-machine create --driver amazonec2 --amazonec2-access-key $AWS_ACCESS_KEY_ID --amazonec2-secret-key $AWS_SECRET_ACCESS_KEY --amazonec2-vpc-id vpc-be157ddb --amazonec2-region eu-west-1 --amazonec2-instance-type t2.medium aws01
eval $(docker-machine env aws01)
#Swarm + Compose on AWS
export CLUSTER_ID=$(docker run swarm create)
dzlab / vim.commands
Last active Oct 8, 2015
View vim.commands
Paste toggleEdit
Vim provides the 'paste' option to aid in pasting text unmodified from other applications. You can set it manually like:
:set paste
:set nopaste
dzlab /
Last active Apr 14, 2016
Some useful text manipulation commands (sed, gawk, etc.)
# print the number of columns
gawk '{print NF}' file | sort -nu | tail -n 1
# Use head -n 1 for lowest column count, tail -n 1 for highest column count.
# print columns
gawk '{print $0}' file # all columns
gawk '{print $4}' file # 4th column
gawk -F "," '{print $2}' file # specific separator
# split a string with a delimiter into lines
dzlab / bosh-lite-cf-installer
Last active Jun 8, 2018
CloudFoundry Bosh Lite installer script
View bosh-lite-cf-installer
#!/usr/bin/env bash
## This script install prerequisites: git, virtualbox, vagrant, ruby/rubygems.
## Then, it boots up bosh-lite in a local Vagrant/Virtualbox VM,
## then uploads and deploys Cloud Foundry into it.
## Finally, it logs into Cloud Foundry as an admin user,
## creates an initial organization and space,
## then deploys an example application.
dzlab /
Last active Apr 14, 2016
A collection of commands
# Virtualbox: Mount the shared folder
sudo mount -t vboxsf temp Shared
# process listening on a port (e.g. 5000)
lsof -i :5000 # find the process
lsof -i :80 # find the program running on a port
kill -9 PID # kill process
sudo netstat -lpn |grep :5000
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c # view list of connections and their states
ss -rota | less # list all connections and timers