Skip to content

Instantly share code, notes, and snippets.

View jbontech's full-sized avatar
:octocat:
Focusing

Jothibasu jbontech

:octocat:
Focusing
View GitHub Profile
@jbontech
jbontech / tmux-cheatsheet.markdown
Created April 18, 2019 03:33 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jbontech
jbontech / Jenkinsfile
Created July 26, 2019 07:45 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage c…
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8-alpine
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
@jbontech
jbontech / gist:e132a57988bf5694adce7086c9adcf9a
Created April 5, 2020 04:13 — forked from mgedmin/gist:d6d271f4ee6ae82d9a86
Jenkins groovy script to print scheduling rules for all the jobs
import hudson.triggers.*;
for (item in Jenkins.instance.getItems(Project)) {
println("--- Scheduling for " + item.name + " ---")
def trigger = item.triggers.get(Jenkins.instance.getDescriptor(TimerTrigger.class));
if (trigger) {
println trigger.spec;
}
}
@jbontech
jbontech / generate_aws_ssh_config.py
Created April 20, 2020 13:16 — forked from mjbommar/generate_aws_ssh_config.py
Generate .ssh/config lines from EC2 instance information using boto.
'''
@author Bommarito Consulting, LLC
@date 2012-12-23
Generate .ssh/config lines from EC2 instance information.
'''
# Imports
import boto
import os
@jbontech
jbontech / create_ec2_ssh_config.py
Created April 20, 2020 13:17 — forked from Havoc24k/create_ec2_ssh_config.py
Python script to generate an SSH config file for EC2 instances
#!/usr/bin/python
"""AWS EC2 SSH config Generator."""
import boto3
import os
# The location and name of our generated config file
path_to_config = '/.ssh/aws_demo.config'
@jbontech
jbontech / aws_ssh_config.py
Created April 21, 2020 03:44
Create the ssh_config from for all the aws machines
#!/usr/bin/python
"""AWS EC2 SSH config Generator."""
import boto3
import os
import sys
# The location and name of our generated config file
path_to_config = '/.ssh/aws_demo'
@jbontech
jbontech / complex_salt_orchestrate.sls
Created April 28, 2020 07:00 — forked from whiteinge/complex_salt_orchestrate.sls
An example of a complex, multi-host Salt Orchestrate state that performs status checks as it goes
# /srv/salt/upgrade_the_app.sls
# Example of a complex, multi-host Orchestration state that performs status checks as it goes.
# Note, this is untested and is meant to serve as an example.
# Run via: salt-run state.orch upgrade_the_app pillar='{nodes: [nodeA, nodeB], version: 123}'
{% set nodes = salt.pillar.get('nodes', []) %}
{% set all_grains = salt.saltutil.runner('cache.grains',
tgt=','.join(nodes), tgt_type='list') %}
{# Default version if not given at the CLI. #}
@jbontech
jbontech / _readme.md
Created May 13, 2020 10:27 — forked from mislav/_readme.md
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@jbontech
jbontech / Jenkinsfile
Created May 21, 2020 12:09 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples