Skip to content

Instantly share code, notes, and snippets.

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

JothiBasu jbontech

:octocat:
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jblinuxclicks on github.
  • I am jblinuxclicks (https://keybase.io/jblinuxclicks) on keybase.
  • I have a public key ASAWH9MS89HFBSJZhCuBjUHk4Z-gqLUDWdl1QsHoTELSvQo

To claim this, I am signing this object:

@jbontech
jbontech / power.sh
Created June 16, 2020 14:19 — forked from chrisyco/power.sh
Suspend, hibernate, restart or shutdown the computer without sudo!
#!/bin/sh
# Suspend, hibernate, restart or shutdown the computer without sudo!
# by Chris Wong
# Released to the public domain.
NAME=$0
usage() {
echo "Usage: $NAME suspend|hibernate|restart|shutdown"
@jbontech
jbontech / Jenkinsfile
Created May 21, 2020 12:09 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@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 / 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 / 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 / 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 / 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 / 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;
}
}
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files