Skip to content

Instantly share code, notes, and snippets.

View MrAmbiG's full-sized avatar
💭
Roar

Gajendra D Ambi MrAmbiG

💭
Roar
View GitHub Profile
@MrAmbiG
MrAmbiG / testing
Created January 7, 2016 18:21
Verifying that +mrambig is my blockchain ID. https://onename.com/mrambig
Verifying that +mrambig is my blockchain ID. https://onename.com/mrambig
#install the centos7 repository
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
#install python3.6
sudo yum -y install python36u
# install pip3 for python 3.x (since pip is for python 2.x)
sudo yum -y install python36u-pip
# it shows the default python 2.x
python -V
# this is how you run the python 3.x but it is inconvenient
python3.6 -V
cd /home/
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install -y https://centos7.iuscommunity.org/ius-release.rpm
yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install -y perl gcc dkms kernel-devel kernel-headers make zip unzip bzip2 wget git kernel-devel kernel* kernel-devel-$(uname -r) open-vm-tools
yum update -y
ls -l /usr/src/kernels/$(uname -r)
wget -O atom.rpm https://atom.io/download/rpm/
chmod +x atom.rpm
yum install -y atom.rpm
@MrAmbiG
MrAmbiG / rest_git_write
Last active November 15, 2018 14:22
This will write the content of db.conf to a file in your repository using curl
# https://gist.github.com/caspyin/2288960
data_encoded=$(cat db.conf | openssl enc -base64)
curl -X PUT -k -H 'Authorization: token <my token>' -i 'https://api.github.com/repos/<username>/<reponame>/contents/<filename>' --data '{ "message": "commit message", "content": "'"$data_encoded"'"}'
@MrAmbiG
MrAmbiG / db.conf
Created November 15, 2018 13:55
Created via API
Demo
@MrAmbiG
MrAmbiG / centos7k8s
Last active December 16, 2018 16:10
#!/bin/bash
# tested on AWS CentOS 7.5 ec2-instance
# Installs docker and kubernetes on a centOS system
# basic things first. recommended.
# add docker repo if not present
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum -y update
sudo yum -y install qemu-kvm libvirt libvirt-daemon-kvm
@MrAmbiG
MrAmbiG / docker on ubuntu18+
Created December 31, 2018 21:27
This should install docker and docker-compose on ubuntu. Tested on ubuntu 18.04 (with mate desktop).
#!/bin/bash
: '
This should install docker and docker-compose on ubuntu.
Tested on ubuntu 18.04 (with mate desktop).
'
sudo apt update -y
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update -y
@MrAmbiG
MrAmbiG / jupyter_youtube
Last active January 19, 2019 19:52
Embed video into jupyter notebooks
address='https://www.youtube.com/embed/e2qQ_T6njhs'
from IPython.display import IFrame
IFrame(address, width="1280", height="720")
@MrAmbiG
MrAmbiG / l3gateway
Created May 26, 2019 06:55
L3Vmotion gateway setter for vmware esxi 6.x [courtesy : lucd]
Write-Host "make sure you are connected to a vcenter first"
$cluster = Read-Host "cluster name?"
$vmhosts = Get-Cluster $cluster | Get-VMHost | sort
$stackName = 'vmotion'
$ipGateway = Read-Host "default gateway?"
$ipDevice = Read-Host "vmk device?" # ex: vmk2
forech $VMHost in $vmhosts {
$esx = Get-VMHost -Name $VMHost
$netSys = Get-View -Id $esx.ExtensionData.ConfigManager.NetworkSystem