Skip to content

Instantly share code, notes, and snippets.

View wieshka's full-sized avatar

Viesturs Proškins wieshka

View GitHub Profile
@wieshka
wieshka / middleware.py
Last active October 6, 2023 05:53
WSE middleware
#!/usr/bin/env python3
import argparse
import asyncio
import websockets
import ssl
# Since we are sending messages to wss://localhost, we need to bypass SSL verification,
# hence initialising SSL context for that
ssl_context = ssl.create_default_context()
@wieshka
wieshka / checkpoint.sh
Created July 6, 2020 12:07 — forked from bubenkoff/checkpoint.sh
Endpoint Security VPN FULL start/stop script for Mac OS X
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
@wieshka
wieshka / entrypoint-from-ssm-env-vars.sh
Created January 6, 2020 08:29 — forked from PeteGoo/entrypoint-from-ssm-env-vars.sh
Helpful SSM Parameter Store scripts
#!/bin/bash
# To use just set a variable with SSM_<target_env_var>=<ssm_parameter_store_path>
# e.g. SSM_database_password=prod/myservice/database-password
function get_parameter {
SSM_ENV_VAR_NAME=$1
ENV_VAR_NAME=`echo "$SSM_ENV_VAR_NAME" | cut -c5-`
SSM_PARAM_NAME="${!SSM_ENV_VAR_NAME}"
@wieshka
wieshka / wowza.expect
Created January 6, 2020 08:18
wowza-expect
#!/usr/bin/expect -f
set timeout -1
spawn sudo /tmp/WowzaStreamingEngine-4.7.8-linux-x64-installer.run
match_max 100000
expect {
-exact "Press \[Enter\] to continue:" { send -- "\r"; exp_continue }
-ex "Do you accept this agreement? \[y/n\]: "
}
send -- "y\r"
@wieshka
wieshka / ajenti.conf
Created December 21, 2015 23:42
Working NGINX configuration for Ajenti reverse proxy
server {
listen *:443 ssl;
listen *:80;
ssl_certificate /etc/self-signed-ssl/cert.crt;
ssl_certificate_key /etc/self-signed-ssl/cert.key;
server_name FQDN;
access_log /var/log/nginx/ajenti-web-panel.access.log;
error_log /var/log/nginx/ajenti-web-panel.error.log;