kubectl api-resources
Short name | Full name |
---|---|
csr | certificatesigningrequests |
cs | componentstatuses |
cm | configmaps |
ds | daemonsets |
deploy | deployments |
ep | endpoints |
package main | |
import "fmt" | |
func main() { | |
myEmail := &Email{} | |
myEmail.withFrom("sender"). | |
withTo("recipient"). | |
withSubject("hello"). | |
withBody("howdy?") |
package main | |
import "fmt" | |
func main() { | |
var sendEmail emailAction = func(payload string) { | |
fmt.Printf("sending email: %v\n", payload) | |
} | |
action := sendEmail. |
kubectl api-resources
Short name | Full name |
---|---|
csr | certificatesigningrequests |
cs | componentstatuses |
cm | configmaps |
ds | daemonsets |
deploy | deployments |
ep | endpoints |
package main | |
// https://play.golang.org/p/3DeMCc248KQ | |
import ( | |
"crypto/rand" | |
"encoding/binary" | |
"fmt" | |
) | |
func main() { |
#!/bin/bash | |
# | |
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext | |
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just | |
# from time to time | |
# | |
# Usage: ./checkpoint.sh | |
# | |
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up. | |
# Or, make an Automator action and paste the script. |
#!/bin/zsh | |
# the PrivilegesCLI (verson 1.5.2) is located under | |
# /Applications/Privileges.app/Contents/Resources/PrivilegesCLI | |
# running it without any arguments would show the following hint | |
# Usage: PrivilegesCLI <arg> | |
# | |
# Arguments: --add Adds the current user to the admin group | |
# --remove Removes the current user from the admin group | |
# --status Displays the current user's privileges |
#!/bin/zsh | |
# To make the command line version of Privileges more accessible so that it can be run as part of a script | |
# For Privileges v1.5.2 (1195) | |
ln -s /Applications/Privileges.app/Contents/Resources/PrivilegesCLI /usr/local/bin/admin | |
# Usage | |
# admin --add | |
# admin --remove |
A gist copied from kapeli page
Integer Comparison | |
---|---|
-eq |
is equal toif [ "$a" -eq "$b" ] |
-ne |
is not equal toif [ "$a" -ne "$b" ] |
#!/bin/bash | |
# https://www.starkandwayne.com/blog/bash-for-loop-over-json-array-using-jq/ | |
# how to run | |
# chmod u+x loop-over-json.sh | |
# ./loop-over-json.sh | |
sample='[{"name":"foo"},{"name":"bar"}]' | |
for row in $(echo "${sample}" | jq -r '.[] | @base64'); do | |
_jq() { |
version: "3"
services:
zookeeper:
image: 'wurstmeister/zookeeper:latest'
ports:
- '2181:2181'