Skip to content

Instantly share code, notes, and snippets.

View alexproca's full-sized avatar

Alex Proca alexproca

View GitHub Profile
@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
@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 / openfire.yml
Created June 8, 2015 21:30
Docker Compose for Openfire XMPP server
xmpp:
image: sameersbn/openfire:latest
restart: always
hostname: xmpp.alexproca.ro
ports:
- "80:9090"
- "5222:5222"
- "5223:5223"
- "7777:7777"
- "7070:7070"
@alexproca
alexproca / docker-machine-rename
Last active November 23, 2020 17:15
Rename docker-machine
#!/usr/bin/env bash
#copy this in a folder from path ex: /usr/local/bin
#usage: docker-machine-rename default my-default
# Authors
#
# alexproca initial script
# eurythmia sed magic
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=""
DISPLAY=:0 xinput --set-prop 'FT5406 memory based driver' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1
echo "Public name: $(hostname)-incrementaltech.$(wget -qO- --header=Metadata:true 'http://instance-data/metadata/instance/compute/location?api-version=2017-04-02&format=text').cloudapp.azure.com";
echo "Public ip: $(wget -qO- --header=Metadata:true 'http://instance-data/metadata/instance/network/interface/0/ipv4/ipAddress/0/publicIpAddress?api-version=2017-04-02&format=text')";
echo "Local hostname: $(hostname)"
echo "Private ip: $(wget -qO- --header=Metadata:true 'http://instance-data/metadata/instance/network/interface/0/ipv4/ipAddress/0/privateIpAddress?api-version=2017-04-02&format=text')";
echo "Zone: $(wget -qO- --header=Metadata:true 'http://instance-data/metadata/instance/compute/location?api-version=2017-04-02&format=text')";
echo "Load: $(uptime | awk -F'[a-z]:' '{ print $2}')";
kubectl create clusterrolebinding user-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl create clusterrolebinding --clusterrole=cluster-admin --serviceaccount=default:default concourse-admin
helm init --service-account=tiller
#!/bin/bash
search_term=${1-local/}
helm update;helm search $search_term | sed -n '1!p' | awk -v login=$2 '{\
v_count=split($2, versionArray, ".");\
q_count=split(versionArray[3], qualifierArray, "-");\
qualifierArray[1]=qualifierArray[1]+1;\
qualifier=qualifierArray[1];\
for(i=2;i<=q_count;i++)\