Skip to content

Instantly share code, notes, and snippets.

View jolbax's full-sized avatar
💪
learning, enjoying, growing..

José Luis Barahona jolbax

💪
learning, enjoying, growing..
View GitHub Profile
@jolbax
jolbax / slack_webhook_post.py
Created February 13, 2017 06:33 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@jolbax
jolbax / salt-encrypt.sh
Last active June 9, 2017 07:10 — forked from WillPlatnick/salt-encrypt.sh
Encrypt SaltStack Pillars #saltstack #encryption #pillar
#!/usr/bin/env bash
# Usage: salt-encrypt {optional -f} <input> <keyid>, or just `salt-encrypt` for interactive mode
# Summary: Encrypt some string / file for Salt
# Help: This command can be used to gpg encrypt some content for use in salt pillars or really anything you want to encrypt with GPG
set -e
#Replace below with the default key you encrypt with
DEFAULT_RECIPIENT="XXXXXX"
multi=0
@jolbax
jolbax / deploy_keys.sh
Created March 17, 2017 15:17 — forked from jihchi/deploy_keys.sh
Add new deployment key to BitBucket via API
#!/usr/bin/env bash
set -e
KEY=public-key
LABEL=key123
###
# Method 1. Authenticate by your account & password
###
AUTH=user:password
@jolbax
jolbax / .tmux.conf
Created September 4, 2017 09:11 — forked from paulodeleo/.tmux.conf
Tmux configuration to enable mouse scroll and mouse panel select, taken from: http://brainscraps.wikia.com/wiki/Extreme_Multitasking_with_tmux_and_PuTTY
# Make mouse useful in copy mode
setw -g mode-mouse on
# Allow mouse to select which pane to use
set -g mouse-select-pane on
# Allow mouse dragging to resize panes
set -g mouse-resize-pane on
# Allow mouse to select windows
@jolbax
jolbax / InstallingTmuxOnCentOS.md
Created September 5, 2017 06:53 — forked from pierreprinetti/InstallingTmuxOnCentOS.md
Installing tmux 2.3 on CentOS 7

Installing tmux 2.3 on CentOS

Prerequites

  • libevent libevent-devel libevent-headers
  • curl
# remove old pkgs
@jolbax
jolbax / tmux-cheatsheet.markdown
Created September 5, 2017 09:35 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jolbax
jolbax / cloudstack.sh
Created October 30, 2017 15:42 — forked from k14i/cloudstack.sh
CloudStack API client shell script.
#!/usr/bin/env bash
ADDRESS="https://"
API_KEY=""
SECRET_KEY=""
USE_XMLLINT=0 # true => 1, false => 0
if [ x$ADDRESS == x ] || [ x$API_KEY == x ] || [ x$SECRET_KEY == x ] || [ x$USE_XMLLINT == x ]; then
echo 'ERROR: Set all required valiables.'
exit 1
@jolbax
jolbax / pyscript.py
Created February 9, 2018 09:44 — forked from nhoffman/pyscript.py
Python script template
#!/usr/bin/env python
"""A simple python script template.
"""
from __future__ import print_function
import os
import sys
import argparse
@jolbax
jolbax / elastic_restore.py
Created February 19, 2018 09:41 — forked from yodlegists/elastic_restore.py
elastic restore script
import elasticsearch # https://www.elastic.co/guide/en/elasticsearch/client/python-api/current/index.html
import curator # http://curator.readthedocs.io/en/v3.4.1/examples.html
import sys
PROD_PREFIX = "prod_"
REPOSITORY = "Your repository here
HOST_LIST = [{"host": "Friendly-hostname-here", "port": 9200}]
def main():
@jolbax
jolbax / tmux_build_from_source_CentOS.sh
Last active May 7, 2019 08:57 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.9
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
curl -LOk https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}