Skip to content

Instantly share code, notes, and snippets.

View sanjid133's full-sized avatar
🎯
Focusing

Sanjidul Hoque sanjid133

🎯
Focusing
View GitHub Profile
@sanjid133
sanjid133 / git-reset-author.sh
Created October 25, 2020 17:29 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@sanjid133
sanjid133 / filelimit
Last active May 5, 2020 08:21
Increase file descriptor limit for elasticsearch
# check file descriptor
$ ulimit -n
1024
$ nano /etc/security/limits.conf
* soft nofile 64000
* hard nofile 64000
root soft nofile 64000
root hard nofile 64000
@sanjid133
sanjid133 / fix
Created April 19, 2020 13:03
Minikube ssh: handshake failed: read tcp 127.0.0.1:50754->127.0.0.1:34251: read: connection reset by peer
Run following command
```
vboxmanage controlvm minikube setlinkstate1 off
vboxmanage controlvm minikube setlinkstate1 on
```
@sanjid133
sanjid133 / kuberntes_sample_pod.yaml
Created January 20, 2020 11:09
Kubernets demo pod
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
spec:
containers:
- name: myapp-container
image: busybox
{
"mapping": {
"dynamic_templates": [
{
"product_objects": {
"path_match": "product_summary.info.*",
"match_mapping_type": "object",
"mapping": {
"dynamic": "strict",
"properties": {
#!/bin/bash
set -exou pipefail
helm init || true
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
@sanjid133
sanjid133 / Install kvm2 driver ubuntu 18.04
Created May 22, 2019 19:34
Install kvm2 driver ubuntu 18.04+
#!/bin/bash
sudo apt install libvirt-clients libvirt-daemon-system qemu-kvm
sudo systemctl enable libvirtd.service
sudo systemctl start libvirtd.service
sudo systemctl status libvirtd.service
sudo usermod -a -G libvirt $(whoami)
newgrp libvirt
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
&& sudo install docker-machine-driver-kvm2 /usr/local/bin/
@sanjid133
sanjid133 / link
Created April 19, 2019 13:35
GoThings
@sanjid133
sanjid133 / mysql.yaml
Created February 26, 2019 10:12
Install MySql on Kubernetes (dev)
apiVersion: v1
kind: Service
metadata:
name: mysql
spec:
ports:
- port: 3306
selector:
app: mysql
clusterIP: None
@sanjid133
sanjid133 / gist:314d2560203a615121a01de1c3246d45
Created January 9, 2019 11:13
Kube svc error 2019/01/09 10:56:55 Get https://10.96.0.1:443/api?timeout=32s: dial tcp 10.96.0.1:443: i/o timeout
systemctl stop kubelet
systemctl stop docker
iptables --flush
iptables -tnat --flush
systemctl start kubelet
systemctl start docker