Skip to content

Instantly share code, notes, and snippets.

View hossainemruz's full-sized avatar

Emruz Hossain hossainemruz

View GitHub Profile
@hossainemruz
hossainemruz / k8s-prepare-node.sh
Created June 15, 2022 12:20
Bash script to automatically install and configure container runtime, cni plugins etc
#!/bin/bash
set -eou pipefail
#========== Step 1: Disable Swap ============
echo "Disabling Swap......."
sudo swapoff -a
sudo sed -i '/^[^#]/ s/\(^.*swap.*$\)/#\1/' /etc/fstab
free -h
echo ""
```yaml
apiVersion: kubedb.com/v1alpha2
kind: MySQL
metadata:
name: wordpress-mysql
namespace: demo
spec:
version: 8.0.21
replicas: 3
topology:
apiVersion: stash.appscode.com/v1beta1
kind: BackupSession
metadata:
name: instant-trigger
namespace: <namespace>
spec:
invoker:
apiGroup: stash.appscode.com
kind: BackupConfiguration
name: <backupconfiguration name>
@hossainemruz
hossainemruz / ElementaryDark.qss
Created July 28, 2019 08:48
Albert Theme: Elemetary Dark
/*
* author: Bart Zaalberg <https://github.com/bartzaalberg>
*
* Check http://doc.qt.io/qt-5/stylesheet-syntax.html especially the subtopics:
* The Style Sheet Syntax (http://doc.qt.io/qt-5/stylesheet-syntax.html)
* Qt Style Sheets Reference (http://doc.qt.io/qt-5/stylesheet-reference.html)
*/
* {
border: none;
<!DOCTYPE html>
<html>

<head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>

<body>
version: "2"
services:
universe:
build: .
working_dir: /usr/src
environment:
- NODE_ENV=default
- PORT=3000
volumes:
- /usr/src
#!/bin/bash
DB_NAME="database_name"
DB_USER="username"
DB_PASS="password"
DB_HOST="localhost"
DB_PORT="3306"
while ! nc -q 1 $DB_HOST $DB_PORT </dev/null; do
echo "Waiting for database to be ready....."
sleep 5
@hossainemruz
hossainemruz / kube-dns.yaml
Created November 8, 2018 08:11
YAML config file for kube-dns with upstreamNameserver
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-dns
namespace: kube-system
data:
upstreamNameservers: |
["8.8.8.8", "8.8.4.4"]
@hossainemruz
hossainemruz / mysql-initialization-with-init-container.yaml
Created November 2, 2018 05:56
This sample show how to use init container to download init.sql file and initialize mysql database using this file
# this pvc will be used to store downloaded init.sql file
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: init-script
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
@hossainemruz
hossainemruz / mysql-init-demo.yaml
Created October 30, 2018 16:57
Sample MySQL deployment to initialize from *.sql file
# Here, I am using a gcePersistentDisk disk to store my init.sql file.
# You can you any Kubernetes volume such as hostPath,nfs etc.
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-init-demo
spec:
selector:
matchLabels:
app: mysql