Skip to content

Instantly share code, notes, and snippets.

View dkhode's full-sized avatar
🏠
Working from home

Devikiran Khode dkhode

🏠
Working from home
View GitHub Profile
@dkhode
dkhode / create_user_and_kubeconfig_rancher2.sh
Created February 23, 2021 21:40 — forked from superseb/create_user_and_kubeconfig_rancher2.sh
Create local user and generate kubeconfig in Rancher 2 via API
#!/bin/bash
RANCHERENDPOINT=https://your_rancher_endpoint/v3
# The name of the cluster where the user needs to be added
CLUSTERNAME=your_cluster_name
# Username, password and realname of the user
USERNAME=username
PASSWORD=password
REALNAME=myrealname
# Role of the user
GLOBALROLE=user
@dkhode
dkhode / kubernetes_add_service_account_kubeconfig.sh
Created February 10, 2021 22:03 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@dkhode
dkhode / gist:81f2bdaaa72f4b4560c615db4f9027f9
Created January 2, 2017 19:35 — forked from gmhawash/gist:4043232
Reset jenkins password
0. SSH to server
1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml
2. set userSecurity to false: <userSecurity>false</userSecurity>
3. delete
<authorizationStrategy> and <securityRealm>
4. /etc/init.d/bitnami restart
@dkhode
dkhode / gist:b55da670f343374a1700e80f231cbeb4
Created December 26, 2016 05:44 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration
@dkhode
dkhode / vagrant-cheat-sheet.md
Created December 26, 2016 05:22 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine
@dkhode
dkhode / my-job-generator.groovy
Created October 10, 2016 18:00 — forked from glombard/my-job-generator.groovy
Using Jenkins Job-DSL plugin to create a job with a Post-Build Step / publisher plugin
job('my-generated-job') {
description('This job was automatically generated by a Job-DSL seed job')
steps {
shell('echo Testing Job-DSL and log-parser')
}
wrappers {
colorizeOutput('xterm')
}
// Use configure to add the 'publishers' XML node in the generated config.xml
configure { project ->