Skip to content

Instantly share code, notes, and snippets.

View nerobianchi's full-sized avatar

Erdem OZDEMIR nerobianchi

View GitHub Profile
@nerobianchi
nerobianchi / rvm_install.txt
Created January 25, 2019 12:00
rvm install
rvm get head --auto-dotfiles
Here's the order of the standard four files, and the condition under which they run:
.zshenv: (always)
.zprofile: [[ -o login ]]
.zshrc: [[ -o interactive ]]
.zlogin: [[ -o login ]]
# Host and port we will listen for requests on
bind 0.0.0.0
port 26379
sentinel myid 57974e20bffac235b52595581c71447f36014334
sentinel deny-scripts-reconfig yes
sentinel monitor redis-cluster 10.0.0.11 6379 2
sentinel down-after-milliseconds redis-cluster 5000
sentinel failover-timeout redis-cluster 10000
daemonize yes
pidfile "/var/run/redis_26379.pid"
@nerobianchi
nerobianchi / sentinel.conf
Created December 28, 2018 22:25
redis-ha
#1
bind 0.0.0.0
port 26379
#2
sentinel monitor redis-cluster 10.0.0.11 6379 2
sentinel down-after-milliseconds redis-cluster 5000
sentinel parallel-syncs redis-cluster 1
sentinel failover-timeout redis-cluster 10000
#3
sentinel auth-pass redis-cluster this_is_a_very_secret_password
#1
VERSION=$1
FOLDER=redis-${VERSION}
#2
export LANGUAGE="en_US.UTF-8"
echo 'LANGUAGE="en_US.UTF-8"' | sudo tee -a /etc/default/locale
echo 'LC_ALL="en_US.UTF-8"' | sudo tee -a /etc/default/locale
#3
@nerobianchi
nerobianchi / Vagranfile
Last active February 15, 2020 05:41
redis-ha
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
MASTER_NODE_COUNT=1
SLAVE_NODE_COUNT=2
MASTER_NODE_IP_START="10.0.0."
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
vb.cpus = 1
@nerobianchi
nerobianchi / git_config_set_editor.sh
Last active September 25, 2018 07:35
A git squash example
git config --global core.editor "code --wait"
# or
git config --global core.editor "vim"
@nerobianchi
nerobianchi / k8s_dashboard.sh
Created May 1, 2018 18:36
k8s dashboard w/ patch
# dashboard
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
kubectl patch service --namespace kube-system kubernetes-dashboard -p '{"spec":{"type":"NodePort"}}'
# kubectl patch service --namespace kube-system kubernetes-dashboard -p '{ "spec": { "ports": [ {"nodePort":30000,"port": 443, "protocol": "TCP", "targetPort": 8443} ] } }'
#or
kubectl patch service --namespace kube-system kubernetes-dashboard --type='json' -p='[{"op": "replace", "path": "/spec/ports/0/nodePort", "value":30000}]'
@nerobianchi
nerobianchi / k8s-creating-sample-user
Created April 30, 2018 18:09
creating-sample-user
https://github.com/kubernetes/dashboard/wiki/Creating-sample-user
@nerobianchi
nerobianchi / k8s_checking_available_versions.sh
Last active April 28, 2018 16:45
k8s Checking available versions
#Checking available versions
#You can check which Kubernetes versions are default and available in a given zone by running the following command:
gcloud container get-server-config --zone [COMPUTE-ZONE]
@nerobianchi
nerobianchi / k8s_single_host_cluster.sh
Created April 24, 2018 19:02
Allow a single-host cluster
# Kubernetes is about multi-host clustering - so by default containers cannot run on master nodes in the cluster. Since we only have one node - we'll taint it so that it can run containers for us.
kubectl taint nodes --all node-role.kubernetes.io/master-
# https://blog.alexellis.io/kubernetes-in-10-minutes/