Öncelikle plpython3 ‘ü yüklüyoruz sudo apt-get install postgresql-contrib postgresql-plpython3-13 CREATE OR REPLACE FUNCTION random_tckn () RETURNS TEXT AS $$ from random import randint tcno = str(randint(100000000, 1000000000)) list_tc = list(map(int, tcno)) tc10 = (sum(list_tc[::2]) * 7 - sum(list_tc[1::2])) % 10 new_tc = tcno + str(tc10) + str((sum(list_tc[:9]) + tc10) % …
Devamını Oku »Postgresql 13 plpython3 install ubuntu
sudo apt-get install postgresql-contrib postgresql-plpython3-13 CREATE EXTENSION plpython3u;
Devamını Oku »ubuntu server 20.04 install postgresql and remote access
sudo apt-get update sudo apt-get upgrade sudo reboot sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - sudo apt-get update sudo apt-get -y install postgresql dikkat aşağıdaki işlem veritabanı sunucunuzu tamamen dışarıya açar bilinçli bir şekilde yaptığınızdan …
Devamını Oku »Remote windows restart
NET USE \\remoteservername\IPC$ passwordinfo /USER:userinfo shutdown -r -f -t -m \\remoteservername güncelleme NET USE \\remoteservername\IPC$ passwordinfo /USER:userinfo shutdown /r /f /m \\remoteservername
Devamını Oku »python DownloadProgressBar
import urllib import urllib.request from tqdm import tqdm class DownloadProgressBar(tqdm): def update_to(self, b=1, bsize=1, tsize=None): if tsize is not None: self.total = tsize self.update(b * bsize - self.n) def download_url(url, output_path): with DownloadProgressBar(unit='B', unit_scale=True, miniters=1, desc=url.split('/')[-1]) as t: opener = urllib.request.build_opener() opener.addheaders = [('User-agent', 'Mozilla/5.0')] urllib.request.install_opener(opener) urllib.request.urlretrieve(url, filename=output_path, reporthook=t.update_to)
Devamını Oku »Python Firebird Backup Restore Database
import firebirdsql.fbcore from firebirdsql import services def restore_database(fbk_file: str, fdb_file: str): con = services.connect(user='SYSDBA', password='masterkey') con.restore_database(fbk_file, fdb_file, pageSize=16384, replace=True ) def backup_database(fdb_file: str, fbk_file: str): con = services.connect(user='SYSDBA', password='masterkey') con.backup_database(fdb_file, fbk_file)
Devamını Oku »Microsoft Power Bi Informix Jdbc Connect
Informix veritabanına Power BI üzerinden ODBC ile bağlanılabiliyor fakat ODBC bağlantısında bazı sorunlar yaşanabiliyor. örnek temp tablo create etme türkçe karakter hatası vs. Sorunu aşmak için benim kullandığım yöntem python scripti çalıştırmak oldu Levazımat Listesi: Cpython dağıtımı : https://www.python.org/downloads/ Pandas : https://pypi.org/project/pandas/ Matplotlib: https://pypi.org/project/matplotlib/ Jaydebeapi:https://pypi.org/project/JayDeBeApi/ java virtual machine: https://www.java.com/download/ie_manual.jsp informix …
Devamını Oku »python file to base64
def file_to_base64(file_path: str) -> str: with open(file_path, "rb") as binnary_file: encoded_string = base64.b64encode(binnary_file.read()) return encoded_string.decode('utf-8')
Devamını Oku »python fastapi windows deploy iis
Doğrudan fast api uygulamasını windows iis üzerinde deploy edemiyoruz biraz etrafından dolandım bende 1) IIS üzerine Application Request Routing yükleyelim https://techcommunity.microsoft.com/t5/iis-support-blog/setup-iis-with-url-rewrite-as-a-reverse-proxy-for-real-world/ba-p/846222 2) https://nssm.cc/download adresinden nssm aracı indirip c:\nssm klasörüne veya istediğiniz bir klasöre bırakın bendeki örnekte D:\Test\nssm-2.24-101-g897c7ad\win64 yolu windows path ine ekleyelim. 3) daha yönetici cmd terminal ekranımızı açalım 4) …
Devamını Oku »informix get last insert id
Evet çok saçma CREATE TEMP TABLE zamazingo (ID INT); INSERT INTO mytable (ciger,adana,lahmacun,pide,doner) VALUES ('miger','madana','mahmacun','mide','moner'); INSERT INTO zamazingo (ID) VALUES (dbinfo('sqlca.sqlerrd1')); select id from zamazingo
Devamını Oku »