Skip to content

Instantly share code, notes, and snippets.

@mwin007
mwin007 / shorten-prompt.md
Last active April 25, 2020 19:10
shorten-prompt

PS1='\u:\W\$ '

@mwin007
mwin007 / nautilus
Last active April 25, 2020 19:11
nautilus admin
`nautilus admin://`
php bin/magento admin:user:create --admin-user="<admin>" --admin-password="<newpassword>" --admin-email="<[email protected]>" --admin-firstname="<Test>" --admin-lastname="<Test>"
# Get current region
aws configure get region
# Right click on the slide image->copy image address, then do curl
curl -O https://image.slidesharecdn.com/...[1–5]-638.jpg
@mwin007
mwin007 / RAILS_5_CHEATSHEET.md
Created August 27, 2018 00:57 — forked from harrietty/RAILS_5_CHEATSHEET.md
Ruby on Rails 5 Cheatsheet

Ruby on Rails Cheatsheet (5.1)

Architecture

RVM

$ rvm list - show currently installed Rubies

kubectl Cheat Sheet
See also: Kubectl Overview and JsonPath Guide.
Kubectl Autocomplete
$ source <(kubectl completion bash) # setup autocomplete in bash, bash-completion package should be installed first.
$ source <(kubectl completion zsh) # setup autocomplete in zsh
Kubectl Context and Configuration
Set which Kubernetes cluster kubectl communicates with and modifies configuration information. See Authenticating Across Clusters with kubeconfig documentation for detailed config file information.
$ kubectl config view # Show Merged kubeconfig settings.
@mwin007
mwin007 / DockerFile_app
Created April 23, 2018 01:28 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Configuring main directory
RUN mkdir -p /app_name
WORKDIR /app_name
# Setting env up
ENV RAILS_ENV='production'
ENV RAKE_ENV='production'
docker stop $(docker ps -a -q); docker rm $(docker ps -a -q); docker volume rm $(docker volume ls -qf dangling=true)
docker network rm $(docker network ls -q)
sudo lsof -nP | grep LISTEN
sudo kill -9 1548
# Where on the last line, 1548 was a service that was using port 80 as returned by the penultimate line.