Skip to content

Instantly share code, notes, and snippets.

View sujeetkv's full-sized avatar
🎯
Focusing

Sujeet Kumar sujeetkv

🎯
Focusing
  • New Delhi, India
View GitHub Profile
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active September 24, 2026 01:33
set -e, -u, -o, -x pipefail explanation
@miguelgrinberg
miguelgrinberg / sqlalchemy-challenge.py
Last active October 18, 2022 06:51
A little SQLAlchemy challenge. See blog post at https://blog.miguelgrinberg.com/post/nested-queries-with-sqlalchemy-orm for details!
#!/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
@lizthegrey
lizthegrey / attributes.rb
Last active August 24, 2026 08:16
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@vikas-git
vikas-git / python_interview.txt
Last active September 27, 2023 14:34
My Interview experience on Python
======= 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() )
# 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):
@Daniel-V-Richardson
Daniel-V-Richardson / assistant.py
Created January 24, 2023 14:44
Simple AI Voice Assistant using OpenAI API
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)