Skip to content

Instantly share code, notes, and snippets.

View sbuvaneshkumar's full-sized avatar
🎯
Chasing dreams

Buvanesh Kumar sbuvaneshkumar

🎯
Chasing dreams
View GitHub Profile
@sbuvaneshkumar
sbuvaneshkumar / crc.sh
Last active November 18, 2021 12:24
CRC setup.md
crc setup
crc config set enable-cluster-monitoring true
crc config set memory 15336
crc start
yum groupinstall -y "GNOME Desktop" "Graphical Administration Tools" "Development Tools" && yum install -y git tigervnc* && yum install qemu-kvm virt-manager libvirt libvirt-python libvirt-devel libguestfs-tools virt-install virt-viewer epel-release -y && systemctl enable --now libvirtd && printf "redhat\nredhat\n\n" | vncpasswd && vncserver && virsh pool-define-as --name default --type dir --target /home && virsh pool-autostart default && virsh pool-start default && yum install -y https://releases.hashicorp.com/vagrant/2.2.14/vagrant_2.2.14_x86_64.rpm && mkdir vagrant && cd vagrant && wget https://gist.githubusercontent.com/sbuvaneshkumar/962fc91abd603e9704a479bf19567fc1/raw/33451fc72b047b854787f0116447d5f88c9aa427/Vagrantfile && echo 'unix_sock_group = "libvirt"' >> /etc/libvirt/libvirtd.conf && echo 'unix_sock_rw_perms = "0770"' >> /etc/libvirt/libvirtd.conf && systemctl restart libvirtd && vagrant plugin install vagrant-libvirt && vagrant box add fedora/32-cloud-base --provider=libvirt && cd
# Vagrant
yu
- name: Check hosts status before continue
shell: "oc get nodes {{ inventory_hostname }} | awk '{print $2}' | grep -iwo ready"
delegate_to: 127.0.0.1
register: nodestate
until: nodestate.stdout == "Ready"
retries: 20
delay: 20
- name: Check hosts status before continue
shell: "oc get nodes {{ inventory_hostname }} | awk '{print $2}' | grep -iwo SchedulingDisabled | wc -l"
@sbuvaneshkumar
sbuvaneshkumar / terraform-localstack-sample.tf
Created May 23, 2021 10:48
Terraform localstack sample
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
required_version = ">= 0.14.9"
}
Vagrant.configure("2") do |config|
config.vm.box = "fedora/32-cloud-base"
config.vm.provider :libvirt do |libvirt|
libvirt.cpus = 3
libvirt.memory = 8024
end
end
external_url "https://gitlab.foobar.com"
git_data_dirs({
'default' => { 'gitaly_address' => 'tcp://10.249.30.252:8075' },
})
gitlab_rails['monitoring_whitelist'] = ['127.0.0.0/8', '::1/128']
gitlab_rails['artifacts_enabled'] = true
gitlab_rails['artifacts_object_store_enabled'] = true
gitlab_rails['artifacts_object_store_remote_directory'] = "artifacts"
gitlab_rails['artifacts_object_store_connection'] = {
'provider' => 'AWS',
# docker
curl -fsSL https://get.docker.com |bash
systemctl enable --now docker
# kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
mv ./kubectl /bin/
# kind
@sbuvaneshkumar
sbuvaneshkumar / cloud.zsh-theme
Last active September 17, 2021 09:15
Custom ZSH theme
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX='அ'
#ZSH_THEME_CLOUD_PREFIX='☁'
fi
PROMPT='%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg_bold[green]%}%p %{$fg[green]%}%c %{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}] %{$fg[yellow]%}⚡ %{$reset_color%}"
@sbuvaneshkumar
sbuvaneshkumar / ebs_autoscale.sh
Created November 27, 2019 13:35 — forked from DanielMuller/ebs_autoscale.sh
Allow autoscaling EBS volumes based on disk usage
#!/bin/bash
# Allows to attach and remove EBS volumes managed under LVM to
# have a dynamically sized partition attached to an EC2 instance
#
# Intance needs either to be launched with a role able to access to relevant AWS API endpoints
# or the credentials can be hardcoded in the config.
#
# Minimal IAM Role:
# {
@sbuvaneshkumar
sbuvaneshkumar / Jupyter-shortcuts
Created October 3, 2019 19:03
Jupyter-shortcuts
Show options available for the python code - shift + tab