-
- Press F6 i.e. goto search/url bar
- Press
*[_]search_text
i.e.star
space
search_text
-
- Press
Shift+f2
, a shell at bottom of screen will show up. - Type
restart
- Press
-
- Press F6 i.e. goto search/url bar
# change file content in all the given file | |
find . -type f -name '*file-name*' -exec sed -i 's/str1/str2/g' {} \; |
from base64 import b64decode | |
import boto3 | |
unencrypted_url = "https://" + boto3.client('kms').decrypt( | |
CiphertextBlob=b64decode(config['encrypted_token']))['Plaintext'].decode('utf-8') |
data "aws_ami" "amazon_linux" { | |
most_recent = true | |
filter { | |
name = "name" | |
values = [ | |
"amzn-ami-hvm-*-x86_64-gp2", | |
] | |
} |
-
Label:
- Labels are key/value pairs that are attached to objects, such as pods.
- Labels can be attached to objects at creation time and subsequently added and modified at any time.
- Each object can have a set of key/value labels defined. Each Key must be unique for a given object.
-
Service:
- A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service.
- Behind a service, pods come and go with autoscaling but service is by which we communicate.
-
Namespace:
Docker cheatsheet, usually has one-lines to delete containers.
- Create a image from docker file:
docker build -t image-name .
- Run a container:
docker run -it --name container-name image-name:latest
- Run docker in backgroud:
docker run --name container-name --hostname container-hostname -t -d container-name:latest
- Connect to container:
docker exec -it container_name bash
- Remove all Exited containers:
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
- Remove all dangling images:
docker rmi $(docker images -f 'dangling=true' -q)
-
On macOS the docker binary is only a client and you cannot use it to run the docker daemon, because Docker daemon uses Linux-specific kernel features, therefore you can’t run Docker natively in OS X.
-
So another tool was created,
Docker-Machine
, which creates a virtual machine (using yet another tool, e.g. Oracle VirtualBox), runs Docker on that VM, and helps coordinate between the host OS and the Docker VM. -
Since Docker isn't running on your actual host OS, docker-machine needs to deal with IP addresses and ports and volumes and such. And its settings are saved in environment variables, which means you have to run commands like this every time you open a new shell.
-
To create a new docker machine :
docker-machine create --driver virtualbox vm-name-here
- List all packages :
brew list
- List all top-level packages:
brew leaves
- List packages with dependencies tree:
brew deps --tree --installed
Do not update brew installed package, while installing other packages
- Set
export HOMEBREW_NO_AUTO_UPDATE=1
IRC Networks are made of servers, and servers have channels. The default config has a few predefined networks, to list them:
-
List network:
/NETWORK LIST
-
Connect to one of network:
/CONNECT oftc
-
To join channels:
/JOIN #bash-completion
-
To highlight lines with your nickname:
/HILIGHT nick
or/SET hilight_nick_matches_everywhere ON