Skip to content

Instantly share code, notes, and snippets.

View perfecto25's full-sized avatar

mrx perfecto25

  • NYC
View GitHub Profile
@perfecto25
perfecto25 / upload2artifactory.sh
Last active October 19, 2017 14:50
upload pkg to artifactory
#!/bin/bash
# sample upload script to upload Postgres RPM package to Artifactory
# usage: ./upload2artifactory.sh /tmp/some-rpm-name.rpm
if [ $# -le 0 ]; then echo "missing RPM name as parameter"; exit 1; fi
rpm_location=$1
rpm_name=$(echo $rpm_location | awk '{match($1, "[^/]*$", a)}END{print a[0]}')
artif_pkg_path="/stable-rpms/p/postgres/${rpm_name}"
artif_key="Artif API KEY here"
@perfecto25
perfecto25 / distribute SSH keys via Ansible
Created November 2, 2017 18:11
SSH keys with Ansible
- hosts: webservers
tasks:
- name: update nessus SSH keys
become_user: root
become_method: sudo
become: true
authorized_key:
user: nessus
key: "{{ lookup('pipe','cat ../files/ssh_keys/nessus.pub') }}"
state: present
@perfecto25
perfecto25 / default.j2
Last active July 27, 2023 19:05
Python function to send email using a Jinja HTML template
<style type="text/css">
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
.body {
width: 90%;
@perfecto25
perfecto25 / vscode_settings
Last active October 1, 2018 03:02
VSCode settings
{
"window.zoomLevel": 1,
"workbench.colorTheme": "One Dark Pro",
"http.proxy": "http://xxxx.local:8080",
"http.proxyStrictSSL": false,
"window.menuBarVisibility": "default",
"editor.fontSize": 19,
"editor.fontFamily": "'Inconsolata', 'Droid Sans Mono', 'Courier', 'Droid Sans Fallback'",
"terminal.integrated.fontFamily": "Inconsolata",
@perfecto25
perfecto25 / terminator_config
Last active August 29, 2018 21:32
Terminator colors ~/.config/terminator/config
[global_config]
window_state = maximise
[keybindings]
[layouts]
[[default]]
[[[child1]]]
parent = window0
type = Terminal
[[[window0]]]
parent = ""
@perfecto25
perfecto25 / fish.config
Created February 22, 2018 20:24
fish terminal config
set -U fish_user_paths /usr/local/bin /usr/sbin $fish_user_paths
@perfecto25
perfecto25 / .bashrc
Last active December 5, 2018 17:55
.bashrc PS1 settings
#!/bin/bash
# Colorize your terminal according to hostname - helps avoid typing wrong commands into PROD!!
termcolorenv() {
HOST=$(echo "${1}" | cut -d'@' -f2)
case $HOST in
qbt* ) PROFILE="PROD" ;;
atlas* ) PROFILE="PROD" ;;
qbch* ) PROFILE="PROD";;
awstestbox ) PROFILE="DEV" ;;
@perfecto25
perfecto25 / backbone_search
Last active March 6, 2018 15:08
k15 Jira backbone sync status search
@perfecto25
perfecto25 / jira-maestro.py
Last active March 8, 2018 21:17
Tornado-based asynchronous web service listener
#!/usr/bin/env python
# coding=utf-8
# JIRA webhook listener "Maestro"
# uses python Tornado scalable web server to handle requests coming
# coming in via webhooks from Jira instance
import tornado.httpserver
import tornado.ioloop
import tornado.options
@perfecto25
perfecto25 / docker_build.sh
Created March 27, 2018 20:28
Docker Build with Splunk logging
#!/bin/bash
# Jira Maestro Docker Build
set -x
APP_ENV="dev"
PORT=5810
IMAGE_VER=$APP_ENV-$(date '+%Y%m%d%H%M%S')
TAG="artifactory.local/jira-maestro"
DEV_HOSTNAME='mrxdev1.vagrant.local'
DEV_IP='14.115.20.166'