Skip to content

Instantly share code, notes, and snippets.

MiniKube Setup:
1. https://kubernetes.io/docs/tasks/tools/install-minikube/
2. https://kubernetes.io/docs/tasks/tools/install-kubectl/
KOPS Setup for production:
http://github.com/kubernetes/kops
@mshRoR
mshRoR / important-git-repo-link.txt
Last active January 18, 2020 07:54
important-git-repo-link
@mshRoR
mshRoR / docker-permission.txt
Created April 8, 2020 08:04
How to fix docker: Got permission denied issue
If you want to run docker as non-root user then you need to add it to the docker group.
1. Create the docker group if it does not exist
$ sudo groupadd docker
2. Add your user to the docker group.
$ sudo usermod -aG docker $USER
3. Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
$ newgrp docker
4. Check if docker can be run without root
$ docker run hello-world
@mshRoR
mshRoR / ubuntu-command.txt
Last active April 27, 2020 11:08
Important ubuntu comamnds
# Refresh ubuntu keys server
$ sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
# Group permission change
$ sudo chgrp -R root esdata
# Add current login User ID to .bashrc or .zshrc file
$ echo "export UID=$UID" >> ~/.bashrc
or
$ echo "export UID=$UID" >> ~/.zshrc
# Check server process is using jemalloc
# ref. [Japanese] https://tech.studyplus.co.jp/entry/2019/09/09/094140
class AppController < ActionController::Base
def show
r = `strings /proc/#{Process.pid}/maps | grep jemalloc`
render plain: "<h1>#{ENV['LD_PRELOAD'].presence || 'empty'}</h1><pre>#{r}</pre>"
end
end
@mshRoR
mshRoR / upgrade-postgresql-with-docker-compose.txt
Last active January 2, 2024 07:39
upgrade-postgresql-with-docker-compose
# spin up our new (empty) database
docker compose up -d db_postgres_151
# login to postgres
$ psql -U postgres
$ CREATE DATABASE database_name
# dump our existing database
docker compose exec -it db_postgres_146 /bin/bash -c 'pg_dumpall -U $POSTGRES_USER > /backup/20230127.sql'
@mshRoR
mshRoR / filterable.rb
Created January 11, 2024 07:28 — forked from justinweiss/filterable.rb
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call