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 | |
DEBIAN_FRONTEND=noninteractive apt update -y | |
DEBIAN_FRONTEND=noninteractive apt install git python3 python3-pip unzip --assume-yes -y | |
DEBIAN_FRONTEND=noninteractive apt install apt-transport-https ca-certificates curl software-properties-common --assume-yes -y | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null | |
DEBIAN_FRONTEND=noninteractive apt update --assume-yes -y |
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/bash | |
yum update -y | |
dd if=/dev/zero of=/swapfile bs=128M count=32 | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
swapon -s | |
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab |
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
def main() -> None: | |
"""Main""" | |
with Live(layout, screen=True, redirect_stderr=False) as live: | |
websocket = WebSocketClient( | |
# Demo API key for testing purposes | |
api_key="<removed>", | |
endpoint="crypto", | |
symbols=symbol_list, | |
) |
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
import json, time | |
from threading import Thread | |
from websocket import create_connection, WebSocketConnectionClosedException | |
def main(): | |
ws = None | |
thread = None | |
thread_running = False | |
thread_keepalive = None |
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
import json, time | |
from threading import Thread | |
from websocket import create_connection, WebSocketConnectionClosedException | |
def main(): | |
ws = None | |
thread = None | |
thread_running = False | |
thread_keepalive = None |
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
import json, time | |
from threading import Thread | |
from websocket import create_connection, WebSocketConnectionClosedException | |
def main(): | |
ws = None | |
thread = None | |
thread_running = False | |
thread_keepalive = None |
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 | |
yum repolist all | |
yum-config-manager --enable codeready-builder-for-rhel-8-rhui-rpms | |
yum --disablerepo=\* remove subscription-manager -y | |
yum update -y | |
yum install vim git wget httpd python39 python3-pip python39-mod_wsgi python3-markupsafe -y | |
python3 -m pip install virtualenv |
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
import sys | |
import site | |
import logging | |
logging.basicConfig(stream=sys.stderr) | |
site.addsitedir('/var/www/html/lib/python3.6/site-packages') | |
site.addsitedir('/var/www/html/lib64/python3.6/site-packages') | |
sys.path.insert(0,"/var/www/html/") |
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
<VirtualHost *:80> | |
ServerName localhost | |
WSGIDaemonProcess html user=apache group=apache threads=2 | |
WSGIScriptAlias / /var/www/html/wsgi.py | |
<Directory /var/www/html> | |
Require all granted |
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
import os | |
from app import app | |
if __name__ == "__main__": | |
port = int(os.environ.get("PORT", 5000)) | |
app.run(host='0.0.0.0', port=port, debug=True) |
NewerOlder