This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/windows/servercore:ltsc2019 | |
# install needed fonts for googlechrome to run properly | |
ADD files/fonts.tar /Fonts/ | |
WORKDIR /Fonts/ | |
RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command ".\Add-Font.ps1 Fonts" | |
WORKDIR "C:/ProgramData" | |
# enable Web-WebSockets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/php | |
<?php | |
define('CLI_SCRIPT', true); | |
/* | |
Author: Trinh Nguyen | |
Last update: August 1st, 2016 | |
NOTES: | |
* Place this file inside a folder inside moodle root. E.g.g: /var/www/moodle/your-script/moodle_course_utils.php | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trinh Nguyen, Nov 18, 2014 | |
function EmailFormConfirmation() { | |
// name of the response sheet | |
var sheetname = "sheet1" | |
// insert a blank column at the end of the response sheet | |
// store the sent mail result | |
// add this formula to the first row of this column: | |
// =indirect("AG"&counta(A1:A)) | |
var columnnumber = 34 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables common to the lms role, automatically loaded | |
# when the role is included | |
--- | |
# These are variables that default to a localhost | |
# setup and are meant to be overwritten for | |
# different environments. | |
# | |
# Variables in all caps are environment specific | |
# Lowercase variables are internal to the role |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# Author: Trinh Nguyen (Jin) | |
# 12 Dec 2020 | |
from queue import Queue | |
SAFE_RANGE = 23 | |
AXIS_LEN = 1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
SSH_KEY=$1 | |
BASTION_IP=$2 | |
USERNAME=$3 | |
PROXY_PORT=`comm -23 <(seq 13000 13999 | sort) <(netstat -tan | awk '{print $4}' | cut -d':' -f2 | sort -u) | shuf | head -n 1` | |
ssh -i "$SSH_KEY" -CND "${PROXY_PORT}" -q "${USERNAME}@${BASTION_IP}" & | |
echo "socks5://localhost:$PROXY_PORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7-stretch | |
LABEL maintainer="Trinh Nguyen <dangtrinhnt@gmail.com>" | |
WORKDIR /keycloak_flask | |
COPY . /keycloak_flask | |
ENV FLASK_APP=keycloak_flask.user | |
ENV FLASK_DEBUG=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.7-stretch | |
LABEL maintainer="Trinh Nguyen <dangtrinhnt@gmail.com>" | |
WORKDIR /keycloak_flask | |
COPY . /keycloak_flask | |
ENV FLASK_APP=apps.keycloak_flask.user | |
ENV KEYCLOAK_FLASK_SETTINGS=local_settings.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Run this script inside a bastion instance | |
# $1: kong address and administration port, e.g., kong.dangtrinh.com:8001 | |
KONG_URL=$1 | |
# get all hosts of the services | |
latest_hosts=( $(curl ${KONG_URL}/services | jq -r '.["data"][] | .host') ) | |
# list all upstream names | |
all_upstreams=( $(curl ${KONG_URL}/upstreams | jq -r '.["data"][] | .name') ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# service_text_file is the path to a text file that contains a list of service names, each service name is on each line | |
cluster=$1 | |
service_text_file=$2 | |
desired_count=$3 | |
while IFS= read -r line | |
do | |
echo "$line" |