Skip to content

Instantly share code, notes, and snippets.

View simo97's full-sized avatar
🏠
Working from home

adonis simo simo97

🏠
Working from home
View GitHub Profile
/**
* GenerateStreamedResponse(question, history)
* GenerateResponse(question, history)
* Should be a class
*/
import type OpenAI from 'openai';
// import ollama from './ollama';
import openai from './openai';
import type { ChatResponse, Message } from 'ollama';
@simo97
simo97 / GoogleDorking.md
Created May 18, 2023 10:43 — forked from sundowndev/GoogleDorking.md
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@simo97
simo97 / install-redis.sh
Created June 2, 2022 15:12 — forked from khelll/install-redis.sh
Installing Redis on Amazon Linux
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=3.2.0
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> fiche technique dispositif flottant IUT</title>
<link rel="stylesheet" href="css/sytel.css">
</head>
@simo97
simo97 / README.md
Created February 16, 2022 15:39 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@simo97
simo97 / auth.py
Last active January 28, 2022 20:10
from fusionauth.fusionauth_client import FusionAuthClient
class FusionAuthBackend:
def authenticate(username: str, password: str, *args, **kwargs):
# fusionauth_client.
client = FusionAuthClient(settings.FUSION_AUTH_API_KEY, settings.FUSION_AUTH_BASE_URL)
_tenant_id = settings.FUSION_AUTH_MAIN_TENANT_ID
if _tenant_id != "":
client.set_tenant_id(settings.FUSION_AUTH_MAIN_TENANT_ID)
@simo97
simo97 / is_into_square.py
Created September 5, 2021 18:12
Check if a point(lat, long) is contained into a square (BBOX) knowing his max and min coordinates
def is_into_square(latMin, latMax, longMin, longMax, lat , long) -> bool:
"""
This function check if a point(lat, long) is contained into a square (BBOX) knowing his max and min coordinates
:param latMin: min latitude of the BBOx
:param latMax: max latitude of the BBOx
:param longMin: max longitude of the BBOx
:param longMax: max longitude of the BBOx
:param lat: the latitude of the point to verified
:param long: the longitude of the point to be verified
:return: bool
@simo97
simo97 / Connecting_postgress_RDS_from_local_via_bastion.md
Created July 23, 2021 01:05 — forked from kshailen/Connecting_postgress_RDS_from_local_via_bastion.md
Ways to connect to postgress RDS instance from bastion host and from local host

When it comes to databases and AWS VPC, best practice is to place your database in private subnet. By definition, private subnet in AWS is not reachable from the Internet because no Internet gateway is attached to private subnet. This is the way you protect your data. This kind of configuration is good for security but bad for data management.

How can you easily access and manage your secured data?

basic_RDS_bastion_architecture

There are two basic ways to acees it.

  1. Access postgres RDS from bastion host. There are following requirements for this.
@simo97
simo97 / FileField_manual_initialisation.py
Created June 12, 2021 12:46 — forked from avoiney/FileField_manual_initialisation.py
Manually associate an existing file to a model FileField
# Assuming you have a Article Model like this
# class Article(models.Model):
# ... Some field
# media = models.FileField(upload_to="path_to_inner_media_folder", blank=True)
from django.core.files.base import ContentFile
import os
# Create an article with the associated model
new_article = Article()
@simo97
simo97 / django-q-cluster.config
Last active September 21, 2020 05:32 — forked from codeSamuraii/django-q-cluster.sh
Deploy Django-Q to an EC2 instance with Elastic Beanstalk
container_commands:
01_makemigrations:
command: "python manage.py makemigrations"
leader_only: true
02_migrate:
command: "python manage.py migrate"
leader_only: true
# Patch the current version, circular imports cause an ImportError (see https://github.com/Koed00/django-q/issues/331)
03_patch_django_q:
# Replace line 12 ('from django_q.cluster import worker, monitor') by 'from django_q.cluster import *'