Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

View GitHub Profile
#pip install opencv-python dlib facenet-pytorch
#xamta infotech, guidelins to install dependancies. hi@xamta.in
import cv2
import dlib
from facenet_pytorch import MTCNN
import numpy as np
def detect_tongue(image_path):
# Load the image
@tejastank
tejastank / tongue.xamta.in.py
Created December 28, 2023 07:18
tongue detection, recognisation
import cv2
import dlib
# Load the pre-trained facial landmark predictor from dlib
predictor_path = "shape_predictor_68_face_landmarks.dat"
predictor = dlib.shape_predictor(predictor_path)
# Load the pre-trained face detector from dlib
face_detector = dlib.get_frontal_face_detector()
@tejastank
tejastank / example_model.py
Created October 19, 2023 10:27 — forked from danmana/example_model.py
Add support for custom json fields in Odoo
from odoo import models, fields, api
from json_field import JsonField
class Person(models.Model):
_name = 'example.person'
_description = 'Person with json details'
details = JsonField() # a json object represented as dict / list / python primitives
@tejastank
tejastank / auth.py
Created October 5, 2023 10:51 — forked from irogers/auth.py
Google Services
from dataclasses import dataclass
@dataclass
class ServiceAccountInfo:
private_key: str
client_email: str
token_uri: str
@tejastank
tejastank / odoo-enterprise-install-custom.sh
Last active August 31, 2023 12:45
Once install community odoo 16, then you can run this to install enterprise edition
#!/bin/bash
################################################################################
# Author: Tejaskumar Tank
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
# Place this content in it and then make the file executable:
@tejastank
tejastank / powerbi-postgres-cert-steps.md
Created June 19, 2023 07:27 — forked from oeon/powerbi-postgres-cert-steps.md
Steps covering new Postgres-SSL cert creation and import into Windows for connecting to PowerBI.

Essentially, the problem is that the default SSL cert for Postgres /etc/ssl/certs/ssl-cert-snakeoil.pem does not have enough information when copied over to the Guest machine running PowerBI which is trying to connect to Postgres, specifically, the Common Name field.

There are various posts out there about this e.g. https://community.powerbi.com/t5/Desktop/PostgreSQL-powerbi-desktop-connection-error/m-p/90689. This one was good to point me at npgsql 3.1.8 specifically https://blogs.msdn.microsoft.com/chmitch/2018/06/04/complete-guide-to-setting-up-power-bi-connecting-to-postgres-w-refresh-enabled/

  1. create a new SSL certificate (roughly) following these guides: https://uit.stanford.edu/service/ssl/selfsigned + https://www.postgresql.org/docs/9.1/static/ssl-tcp.html be sure to set the Common Name field value to the IP address of the server which is hosting the Postgres instance you're connecting to from PowerBI. -days 3650 will set the expiration in 10 years, default is 30 days if not specified.
@tejastank
tejastank / odoo16.css
Created January 21, 2023 12:13
odoo 16, css website fix common
.oe_website_sale .o_wsale_context_thumb_cover {
--o-wsale-card-thumb-fill-mode: unset;
}
#products_grid:not(.o_wsale_layout_list) td.oe_product {
padding-bottom: 7.5px;
border: 1px solid #80808036;
}
@media (min-width: 1400px){
@tejastank
tejastank / foodics.integration.snippetbucket.com.txt
Created January 5, 2023 18:01
foodics API integration - snippetbucket tejas tank, INDIA , info@snippetbucket.com
{
"name": "YOUR COMPANY NAME",
"client_id": "97453c72-TEJAS-TANK-be18-ab001b81f773",
"redirect": "https://console-sandbox.foodics.com/",
"install_url": null,
@tejastank
tejastank / odoo.enterprise.license.issue.py
Last active December 10, 2022 13:39
Fix ODOO License, due to ODOO support failed temporary quick fix
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
import logging
import requests
import werkzeug.urls
from ast import literal_eval
import unittest
from validators import validate_email
class ValidatorsTestCase(unittest.TestCase):
def test_validate_email(self):
# Bu format kesinlikle doğru.
self.assertTrue(validate_email('birisi@gmail.com'))