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
1. Unistall package in ubuntu | |
sudo apt-get purge package_name | |
## remove dependencies as well | |
sudo apt-get purge --auto-remove package_name |
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
# git rename current branch | |
git branch -m <newname> | |
# change last commit message | |
git commit --amend |
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
def hello | |
puts 'Hello world' | |
end |
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
# config/routes.rb | |
Rails.application.routes.draw do | |
# resources :books becomes... | |
get '/books' => 'books#index' | |
get '/books/new' => 'books#new' | |
post '/books' => 'books#create' | |
get '/books/:id' => 'books#show' | |
get '/books/:id/edit' => 'books#edit' | |
put '/books/:id' => 'books#update' |
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
Rails.application.routes.draw do | |
resources :books | |
end |
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
# This file is used by Rack-based servers to start the application. | |
require ::File.expand_path('../config/environment', __FILE__) | |
run Rails.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
env = { | |
'REQUEST_METHOD' => 'GET', | |
'PATH_INFO' => '/hello', | |
'HTTP_HOST' => 'railsexamples.com', | |
# ... | |
} | |
status, headers, body = app.call(env) | |
status # => 200 |
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
location /assets { | |
alias /var/myapp/public/assets; | |
gzip_static on; | |
gzip on; | |
add_header Cache-Control public; | |
} |
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
### List all pods from all namespaces in current cluster | |
kubectl get pods --all-namespaces | |
### Get info about specific pod | |
kubectl describe pods --namespace pod-name pod-id | |
### SSH to a pod | |
kubectl exec -it -n insert_namespace_here -c web insert_pod_name_here -- bash | |
### Investigate CrashLoopBackOff state by finding previous container logs |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/html4/loose.dtd"> | |
<HTML> | |
<HEAD> | |
<TITLE>Gone!!!</TITLE> | |
<link rel="shortcut icon" HREF="/favicon.ico" TYPE="image/x-icon" /> | |
<META NAME="description" | |
CONTENT="Swapnil Gourshete, tech enthu." /> |