Skip to content

Instantly share code, notes, and snippets.

View fcavalcantirj's full-sized avatar

Felipe Cavalcanti fcavalcantirj

  • Rio de Janeiro, RJ
View GitHub Profile
@fcavalcantirj
fcavalcantirj / main.py
Created June 3, 2024 16:14
chatwith.io crawler - using waatMessenger to report
from selenium import webdriver
from selenium.webdriver.common.by import By
import selenium.common.exceptions
import time
import datetime
import requests
import logging
import pymongo
from pymongo import MongoClient
@fcavalcantirj
fcavalcantirj / bot.dalle2.js
Created December 22, 2022 00:49
Telegram bot that receives a message, generate image using dalle2 open api and returns
const { Configuration, OpenAIApi } = require("openai");
const TelegramBot = require('node-telegram-bot-api');
const token = process.env.TELEGRAM_API_KEY_DALLE2;
const bot = new TelegramBot(token, {polling: true});
const configuration = new Configuration({
apiKey: process.env.OPEN_AI_KEY,
});
const openai = new OpenAIApi(configuration);
@fcavalcantirj
fcavalcantirj / instaServer.js
Created October 27, 2020 20:22
POC to download instagram images without the API
const express = require('express')
const axios = require('axios');
const app = express()
const port = 3000
async function instagramPhotos (theProfile) {
// It will contain our photos' links
const res = []
try {
@fcavalcantirj
fcavalcantirj / exportToS3.py
Last active June 12, 2018 19:01
lambda function to export all logs from cloudWatch logGroup to s3Bucket. PS. Remember to set perms accordingly and to rename logGroupName, destinationPrefix, etc...
"""This is an function to export ALL logs from a logGroup to a s3 bucket.
Usage::
Just create a new lambda function and paste this code.
I also created a scheduled event with rate(1 hour)
"""
from __future__ import print_function
import boto3
import botocore.exceptions
@fcavalcantirj
fcavalcantirj / refreshTokens.py
Last active August 25, 2018 17:08
Lambda trigger to refresh access token users using refreshToken and initiate_auth API....
"""This is an function to get a new accessToken based on the refreshToken.
Usage::
Just create an resource and a method on the API Gateway,
integrate the request with this lambda function via console, and test it;
json used to test;
{
"refreshToken":"something"
@fcavalcantirj
fcavalcantirj / signOut.py
Last active September 11, 2019 13:37
Lambda trigger to signOut users using accessToken and global_sign_out API
"""This is an function to signOut users.
Usage::
Just create an resource and a method on the API Gateway,
integrate the request with this lambda function via console, and test it;
json used to test;
{
"access_token":"something"
@fcavalcantirj
fcavalcantirj / signIn.py
Last active November 28, 2019 21:55
Lambda trigger to signIn users
"""This is an function to signIn users.
Usage::
Just create an resource and a method on the API Gateway,
integrate the request with this lambda function via console, and test it;
json used to test;
{
"username":"something",
@fcavalcantirj
fcavalcantirj / copyAndRename.bat
Created March 14, 2018 18:34
Simple batch file to copy folder (with subfolders) and it's content's to another location!!! Windows version
@ECHO OFF
title Copiar arquivos de uma pasta para outra pasta, renomeando
SET FROM="C:\Users\meta\Documents\Georgea"
SET TO="C:\Users\meta\Documents\Felipe"
echo copiando arquivos da origem %FROM% para %TO%
echo d | xcopy C:\Users\meta\Documents\Georgea C:\Users\meta\Documents\Felipe /e /y /f
pause
@fcavalcantirj
fcavalcantirj / kmzToKmL.sh
Last active May 15, 2017 21:54
Bash Script that takes series of kmz files and convert to shapeFiles using ogr2ogr lib.
#!/bin/bash
#******************************************************************************
#
# Name: kmzToKmL.sh
# Project: fretamento
# Purpose: Convert series of kmz files into shapeFiles
# Author: FCavalcanti, BraveInvestments
# Requirements: Make sure ogr2ogr is installed and available on path
# Usage: chmod +x kmzToKmL.sh && ./kmzToKmL.sh
admin
1 cria empresas (brave)
2 cria frota (n brave)
cria vehículos / linhas / trajetos / viagens
3 cria schedule (n brave)
um motorista vai operar um vehículo de uma linha (trajeto e viagem pré definidos)
4 cria grupos (n brave)