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
<template> | |
<q-page | |
class="window-height window-width row justify-center items-center" | |
style="background: linear-gradient(#8274C5, #5A4A9F);" | |
> | |
<div class="column q-pa-lg"> | |
<div class="row"> | |
<q-card square class="shadow-24" style="width:300px;height:485px;"> | |
<q-card-section class="bg-deep-purple-7"> | |
<h4 class="text-h5 text-white q-my-md">Company & Co</h4> |
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
image: atlassian/default-image:2 | |
pipelines: | |
branches: | |
master: | |
- step: | |
name: Deploy to Production | |
deployment: production | |
script: |
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/python | |
# -*- coding: utf-8 -*- | |
# flask related modules | |
from flask import Flask, Response | |
from flask_basicauth import BasicAuth | |
from flask_admin import Admin | |
from flask_admin.contrib import sqla | |
from werkzeug.exceptions import HTTPException | |
# database set up |
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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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
=============================== Setup alluxio With Proxy =============================== | |
Get IP Address by ifconfig and replace below ip address: | |
docker volume create ufs | |
docker network create alluxio_network | |
docker run -d --rm -p 19999:19999 -p 19998:19998 -p 39999:39999 --net=alluxio_network --name=alluxio-master -v /data/master:/opt/alluxio/logs -v ufs:/opt/alluxio/underFSStorage -e ALLUXIO_JAVA_OPTS="-Dalluxio.master.hostname=alluxio-master -Dalluxio.master.mount.table.root.ufs=/opt/alluxio/underFSStorage -Dalluxio.user.file.delete.unchecked=true -Dalluxio.user.file.writetype.default=CACHE_THROUGH -Dalluxio.user.file.ufs.tier.enabled=true -Dalluxio.security.authorization.permission.umask=000" alluxio/alluxio master | |
docker run -d --rm -p 29999:29999 -p 29998:29998 -p 30000:30000 --net=alluxio_network --name=alluxio-worker-1 -v /data/worker:/opt/alluxio/logs -v ufs:/opt/alluxio/underFSStorage --shm-size=16G -e ALLUXIO_JAVA_OPTS="-D |
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
https://towardsdatascience.com/connect-to-mysql-running-in-docker-container-from-a-local-machine-6d996c574e55 | |
docker volume create mysql-volume | |
docker run --name=mysql -p 3306:3306 -v mysql-volume:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=password -d mysql/mysql-server:8.0.20 | |
docker exec -it mysql mysql -u root -p | |
password | |
update mysql.user set host = '%' where user='root'; | |
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; |
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.contrib.auth.models import User | |
from django.core.exceptions import ValidationError as DjangoValidationError | |
from rest_framework.exceptions import ValidationError as DRFValidationError | |
from rest_framework.exceptions import AuthenticationFailed as DRFAuthenticationFailed | |
from rest_framework.views import exception_handler as drf_exception_handler | |
def exception_handler(exc, context): | |
"""Handle Django ValidationError as an accepted exception |
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 datetime | |
from .base import SECRET_KEY | |
REST_FRAMEWORK = { | |
'DEFAULT_PERMISSION_CLASSES': ( | |
'rest_framework.permissions.IsAuthenticatedOrReadOnly', | |
), | |
'DEFAULT_AUTHENTICATION_CLASSES': ( | |
'rest_framework_jwt.authentication.JSONWebTokenAuthentication', | |
'rest_framework.authentication.SessionAuthentication', |
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 requests #dependency | |
import json | |
url = "<your url>" #webhook url, from here: https://i.imgur.com/aT3AThK.png | |
data = {} | |
#for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook | |
data["content"] = "message content" | |
data["username"] = "custom username" |
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 datetime import datetime, timezone, timedelta | |
import psycopg2 | |
from bs4 import BeautifulSoup | |
import requests | |
import re | |
from aman.countries import find | |
url = "https://www.worldometers.info/coronavirus/" |