Skip to content

Instantly share code, notes, and snippets.

View azec-pdx's full-sized avatar
👋
Always available ...

Amer Zec azec-pdx

👋
Always available ...
View GitHub Profile
@azec-pdx
azec-pdx / gist:0663529ec796c961e23fa87f6fe2681b
Created October 31, 2023 15:44 — forked from remen/gist:31e798670783261c8a93
Run shell command in groovy
/**
* Runs commands using /bin/sh and returns stdout as string
*
* <p>
* If the exit code of the command is non-zero, the stderr of the command is printed to stderr
* and a RuntimeException will be thrown.
* </p>
* <b>Example</b>
* <pre><code>
* def files = sh('ls $HOME').split()
@azec-pdx
azec-pdx / proton_opn_wg.md
Created February 8, 2023 04:48 — forked from morningreis/proton_opn_wg.md
OPNsense + ProtonVPN + Wireguard Configuration Guide

OPNsense + ProtonVPN + Wireguard

Published: 16 December 2022

Reference: https://docs.opnsense.org/manual/how-tos/wireguard-selective-routing.html

Goal: Set up one or more Wireguard connections from ProtonVPN on OPNsense, with policy based routing, and optional Killswitch.

I'm writing this guide first as a reference for my future self for when I inevitably forget how to do this, but also to help others out. I found there were not many guides on this specific configuration, particularly not with multiple concurrent connections, and these were some steps which were not at all obvious. I did begin with the guide in the official OPNsense documentation, but even that was missing info to make ProtonVPN work. If you are a pfSense user, it is very similar to OPNsense, and you should be able to follow along with some success, but I have not tested it myself.

@azec-pdx
azec-pdx / bash_strict_mode.md
Created April 20, 2022 23:17 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@azec-pdx
azec-pdx / gist:d8192932d33fe97bc656cde1b5cc3f13
Created April 5, 2021 19:33 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@azec-pdx
azec-pdx / mongo-ls.js
Last active May 13, 2019 21:27 — forked from matteofigus/mongo-ls.js
A script to list all the collections and document count for a specific mongodb db
// Usage: mongo {Server without mongodb:// example 127.0.0.1:27017}/{DbName} [-u {Username}] [-p {Password}] < ./mongo-ls.js
var collections = db.getCollectionNames();
print('Collections inside the db:');
for(var i = 0; i < collections.length; i++){
var name = collections[i];
if(name.substr(0, 6) != 'system')
print(name + ' - ' + db[name].count() + ' records');
@azec-pdx
azec-pdx / README.md
Created June 23, 2017 17:43 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


install Sublime text 2 via PPA or manually

install pythonbrew from https://github.com/utahta/pythonbrew (as root if you wish)

curl -kL http://xrl.us/pythonbrewinstall | bash

install python 2.6.6 enabling 4 bytes unicode

pythonbrew install -C --enable-unicode=ucs4 2.6.6