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
"""Update ECS Instance Types. | |
# Check if spotinfo command is installed | |
if ! command -v spotinfo &> /dev/null | |
then | |
echo "spotinfo could not be found, please install it" | |
# Brew install spotinfo | |
brew tap alexei-led/spotinfo | |
brew install spotinfo | |
fi |
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 pathlib import Path | |
import pkg_resources | |
import toml | |
def pin_dependency_version(dependency_name, installed_packages): | |
# If the package is in the installed packages and it's not a path or git dependency | |
if dependency_name in installed_packages and isinstance(dependency_name, str): | |
# Pin the version to the one currently installed, allowing compatible updates |
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 __future__ import unicode_literals | |
import threading | |
import time | |
from django.conf import settings | |
from django.db.models.signals import pre_save | |
from django.utils.functional import curry | |
from django.apps import apps | |
from auditlog.models import LogEntry |
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 -i | |
#using shebang with -i to enable interactive mode (auto load .bashrc) | |
set -e #stop immediately if any error happens | |
# Install Open SDK | |
apt update | |
apt install openjdk-8-jdk -y | |
update-java-alternatives --set java-1.8.0-openjdk-amd64 | |
java -version |
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 django.http import HttpResponseRedirect | |
from django.conf import settings | |
from re import compile | |
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))] | |
if hasattr(settings, 'LOGIN_EXEMPT_URLS'): | |
EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMPT_URLS] | |
class LoginRequiredMiddleware: | |
""" |