Skip to content

Instantly share code, notes, and snippets.

@limbuu
limbuu / ProgrammaticNotebook.ipynb
Created June 2, 2020 10:26 — forked from fperez/ProgrammaticNotebook.ipynb
Creating an IPython Notebook programatically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}' | grep 'image-name')
from concurrent.futures import ThreadPoolExecutor
from time import sleep
def return_after_5_secs(message, time=2):
print('Stariting {}'.format(message))
sleep(time)
print('Fisnihed {}'.format(message))
return message
def concurrent_test():
ssh -L 8000:localhost:8889 remote-server-username@remoter-server-ip
8000: host port
8889 : port application is exposed in remote server
If you see this on any sshed client or server:
```
Write Failed: broken pipe
```
Then, install this :
sudo apt-get update
sudo apt-get install screen
Then do:
screen -r
1) Code snippet at Skaffold.yaml
portForward:
- resourceType: service
resourceName: my-service
port: 8000
address: 0.0.0.0 #optional since uses 127.0.0.1 by default
localPort: 9000
2) Through SSH Tunneling
## Minikube with specific resources
minikube start --cpus 4 --memory 8000 --insecure-registry "192.168.0.0/16" --disk-size='40000mb' --vm-driver=virtualbox
## Minikube hangs up
minkube delete && minkube start --vm-driver=virtualbox
## Delete the stopped containers first
docker rm $(docker ps -a -q)
## Now,delete the <none> type images of all stopped containers
docker rmi $(docker images -f dangling=true -q )
## Delete the images
docker rmi $(docker images -q)
## Delete all images with image name
## To list all remote branches
git branch -r
## Check out remote branch as local branch
git fetch &&
git checkout -b origin/remoteBranch
## Fetch all remote branches changes in local repository
git fetch --all