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
export DB=base | |
export PASS=pass | |
export USER=user | |
docker exec -ti mongo mongodump --username=$USER --password=$PASS --authenticationDatabase=admin --db=$DB --out /tmp/backups |
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
"scripts": { | |
"start": "ts-node-dev src/app.ts", | |
"build": "tsc", | |
"typeorm": "typeorm-ts-node-commonjs ", | |
"t:generate": "pnpm run typeorm -d ./src/config/data-source.ts migration:generate ./src/migrations/migrate", | |
"t:migrate": "pnpm run typeorm -d ./src/config/data-source.ts migration:run", | |
"t:migrations": "pnpm run t:generate && pnpm run t:migrate", | |
"t:create-entity": "pnpm run typeorm entity:create" | |
}, |
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
docker login registry.gitlab.com -u %env.USER_GITLAB% -p %env.PASSWORD_GITLAB% | |
docker buildx create --use | |
docker buildx build --push --platform linux/arm64,linux/amd64 -t %env.REGISTRY_PROJECT% . |
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
## Build angular site | |
- name: build | |
pull: if-not-exists | |
image: node:16.18.1-alpine | |
when: | |
branch: | |
- master | |
event: | |
- push | |
commands: |
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
node_modules | |
.angular |
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 {NextFunction, Request, Response} from "express"; | |
import Users from "../apps/users/users"; | |
export const checkToken = async (req: Request, res: Response, next: NextFunction) => { | |
const headers = req.headers; | |
if (!headers.authorization) { | |
res.status(401).json({ | |
message: "No token send!!!" | |
}) | |
return |
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
@receiver(post_delete, sender=Image) | |
def post_save_image(sender, instance, *args, **kwargs): | |
""" Clean Old Image file """ | |
try: | |
instance.img.delete(save=False) | |
except: | |
pass |
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 resize_image(path, filename, rename=None, max_width=1920, quality=80): | |
""" | |
Resize image | |
:param rename: | |
:param path: | |
:param filename: | |
:param max_width: | |
:param quality: | |
:return: | |
""" |
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
SELECT | |
TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME | |
FROM | |
INFORMATION_SCHEMA.KEY_COLUMN_USAGE | |
WHERE | |
REFERENCED_TABLE_SCHEMA = 'dms_local' AND | |
REFERENCED_TABLE_NAME = 'panel__planes'; |
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 smtplib | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def send_email_smtp_gmail(from_email, password, destinos, reply_to, subject, body, port=581, host='smtp.gmail.com'): | |
try: | |
## Connect | |
server = smtplib.SMTP(host=host, port=port) |
NewerOlder