This file contains hidden or 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 speech_recognition as sr | |
| import pyttsx3 | |
| import openai | |
| openai.api_key = "Your API Key" | |
| engine = pyttsx3.init() | |
| voices = engine.getProperty('voices') | |
| engine.setProperty('voices', voices[1].id) |
This file contains hidden or 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
| # Create your views here. | |
| from django.contrib.auth.models import User | |
| from rest_framework.views import APIView | |
| from rest_framework import status | |
| from .serializers import UserSerializer | |
| from rest_framework.response import Response | |
| from django.contrib.auth import authenticate, login | |
| import pyotp | |
| class Register(APIView): |
This file contains hidden or 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
| ======= Interviews ========== | |
| # Duration July - August 2021 | |
| ## Django: | |
| * Flow of Django | |
| * Django Middlewares | |
| * Django request/response cycle | |
| * API security(auth based token and others) | |
| * Avoid deadloak in django ( F() ) |
This file contains hidden or 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
| default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
| default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
| default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
This file contains hidden or 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 | |
| # Before you run this script make sure Flask-SQLAlchemy is installed in | |
| # your virtual environment | |
| from flask import Flask | |
| from flask_sqlalchemy import SQLAlchemy | |
| app = Flask(__name__) | |
| app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' # in-memory |
This file contains hidden or 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
| "use strict"; | |
| // Load plugins | |
| const autoprefixer = require("autoprefixer"); | |
| const browsersync = require("browser-sync").create(); | |
| const cp = require("child_process"); | |
| const cssnano = require("cssnano"); | |
| const del = require("del"); | |
| const eslint = require("gulp-eslint"); | |
| const gulp = require("gulp"); |
This file contains hidden or 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
| Assume IIS is installed. My machine already had IIs 8.5. | |
| Install Python | |
| ============== | |
| 1. Download web installer (Python 3.6.3). | |
| 2. Run as Administrator. | |
| 3. Select custom installation for all users. | |
| 4. Choose install directory such that there are no white spaces in the path. Not sure if it needs to be done. Just being cautious. | |
| 5. Check the box for "Add Python 3.6 to PATH". |
If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.
Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.
If in doubt about what git is doing when you run these commands, just
NewerOlder