Python active directory login fastapi

import win32security from typing import Optional from fastapi import Body, FastAPI from pydantic import BaseModel, Field from uvicorn import run app = FastAPI() def login_windows_func(user_name:str,password:str): try: token = win32security.LogonUser( user_name, 'SOLMAZDOM', password, win32security.LOGON32_LOGON_NETWORK, win32security.LOGON32_PROVIDER_DEFAULT) authenticated = bool(token) return authenticated except Exception as e: print (str(e)) return False class LoginForm(BaseModel): username: …

Devamını Oku »

ubuntu redis server RedisJSON modülü kurulumu

Öncelikle redis kurulumu yapalım sudo add-apt-repository ppa:redislabs/redis sudo apt-get update sudo apt-get install redis sudo apt install build-essential llvm cmake libclang1 libclang-dev cargo git clone https://github.com/RedisLabsModules/rejson.git cargo build --release Can’t load module from hatası almamak için sudo mv /home/username/rejson/target/release/librejson.so /usr/local/lib/ vi /etc/redis/redis.conf ############################ MODULES ##################################### redis sunucumuz her yeniden başladığında …

Devamını Oku »

informix table sizeof disk

select tn.partnum , tn.dbsname , (pt.nptotal * pt.pagesize) /1024 as total_kb , (pt.npused * pt.pagesize) /1024 as used_kb , (pt.npused * pt.pagesize) / 1024 /1024/1024 as used_gb , (pt.npdata * pt.pagesize) /1024 as data_kb , tn.owner , tn.tabname , pt.lockid, pt.flags, pt.flags2 , pt.rowsize, pt.ncols, pt.pagesize , dbinfo('utc_to_datetime',pt.created) as created …

Devamını Oku »

Informix lock user sesion list

SELECT s.username tutan_kullanici, s.sid tutan_session, t.username bekleyen_kullanici, t.sid bekleyen_session, l.type locktype, l.dbsname veritabani, l.tabname tablo, l.rowidlk tutulan_rowid FROM sysmaster:syslocks l INNER JOIN sysmaster:syssessions s ON s.sid = l.owner LEFT JOIN sysmaster:syssessions t ON l.waiter = t.sid WHERE l.dbsname <> 'sysmaster' and l.tabname <> 'sysdatabases' ORDER BY veritabani, l.tabname;  

Devamını Oku »

Postgresql Master Detail Query to Json

Bazen yazdığımız bir sorguyu json olarak çıktı vermek isteriz create table testfatura( id serial primary key not null, fatura_no varchar(10) not null, aciklama varchar(100) not null ); create table testfatura_detay( id serial primary key not null, testfatura_id int not null references testfatura(id), stokkodu varchar(50), stokadi varchar(50) ); insert into testfatura …

Devamını Oku »