This file contains 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
# 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 |
This file contains 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
# 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 |
This file contains 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 | |
## | |
## 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. | |
## |
This file contains 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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: spark-operator | |
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: spark-apps | |
--- |
This file contains 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
Name: mnist-tensorflow-job | |
Namespace: default | |
Labels: <none> | |
Annotations: API Version: kubeflow.org/v1 | |
Kind: TFJob | |
Metadata: | |
Creation Timestamp: 2020-07-18T18:54:31Z | |
Generation: 1 | |
Resource Version: 43041 | |
Self Link: /apis/kubeflow.org/v1/namespaces/default/tfjobs/mnist-tensorflow-job |
This file contains 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 ( | |
"github.com/pkg/sftp" | |
"golang.org/x/crypto/ssh" | |
) | |
func main() { | |
addr := “my_ftp_server:22" | |
config := &ssh.ClientConfig{ |
This file contains 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 "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 'https://github.com/openresty/echo-nginx-module/archive/v0.58.tar.gz' | |
tar -xzvf v0.58.tar.gz && rm v0.58.tar.gz | |
mv echo-nginx-module-0.58 /tmp/echo-nginx-module |
OlderNewer