Skip to content

Instantly share code, notes, and snippets.

View alexproca's full-sized avatar

Alex Proca alexproca

View GitHub Profile
@alexproca
alexproca / README.md
Created May 2, 2023 20:36 — forked from metmajer/README.md
Ansible Logging To Elasticsearch

Ansible Logging To Elasticsearch

Turns Ansible log outputs into plain JSON strings and sends them to an Elasticsearch cluster.

Place the script in your playbook's plugins/callbacks/ directory.

@alexproca
alexproca / README-setup-tunnel-as-systemd-service.md
Last active July 25, 2023 09:12 — forked from drmalex07/README-setup-tunnel-as-systemd-service.md
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
service salt-minion stop
rm -f /etc/salt/pki/minion/minion_master.pub
echo "master: salt" > /etc/salt/minion
service salt-minion start
@alexproca
alexproca / forticlientsslvpn-expect.sh
Created October 23, 2019 18:32 — forked from azizasm/forticlientsslvpn-expect.sh
Continuous run Forticlient VPN using expect. Automatically restart VPN if get disconnected or session closed.
#!/bin/bash
# Forticlient SSL VPN Client / expect
# --------------------------------------------
# CONFIGURATION
FORTICLIENT_PATH=""
@alexproca
alexproca / k8s-sa
Created September 23, 2018 10:36 — forked from mreferre/k8s-sa
Kubernetes Service Account
# Inspired by: https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl
# this script creates a service account (user1) on a Kubernetes cluster (tested with AWS EKS 1.9)
# prereqs: a kubectl ver 1.10 installed and proper configuration of the heptio authenticator
# this has been tested on Linux in a Cloud9 environment (for MacOS the syntax may be slightly different)
**************************************************
******* Create an account *******
**************************************************
# Create service account for user user1
kubectl create sa user1
@alexproca
alexproca / pom.xml
Created September 6, 2018 18:51 — forked from dwelch2344/pom.xml
Executable WAR example via Tomcat Maven Plugin
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<!-- Your stuff here... -->
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
@alexproca
alexproca / bashpath.sh
Created September 4, 2018 08:35 — forked from darrenderidder/bashpath.sh
Get path of running script in bash
#!/bin/bash
# A simple test script to demonstrate how to find the
# "absolute path" at which a script is running. Used
# to avoid some of the pitfals of using 'pwd' or hard-
# coded paths when running scripts from cron or another
# directory.
#
# Try it out:
# run the script from the current directory, then
@alexproca
alexproca / PPT.applescript
Created September 2, 2018 15:34 — forked from botanicus/PPT.applescript
Launch iTerm2 session with 3 split windows and run commands in them.
-- Find more at http://iterm.sourceforge.net/scripting.shtml
launch "iTerm"
tell application "iTerm"
activate
-- ssh in split panes to my varnish stack
set myterm to (make new terminal)
tell myterm
# How to perform a release with git & maven following the git flow conventions
# ----------------------------------------------------------------------------
# Finding the next version: you can see the next version by looking at the
# version element in "pom.xml" and lopping off "-SNAPSHOT". To illustrate,
# if the pom's version read "0.0.2-SNAPSHOT", the following instructions would
# perform the release for version "0.0.2" and increment the development version
# of each project to "0.0.3-SNAPSHOT".
# branch from develop to a new release branch
git checkout develop