Skip to content

Instantly share code, notes, and snippets.

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

Saripudin spdin

🏠
Working from home
View GitHub Profile
@spdin
spdin / gist:f30a121ba79e3dfb1f60f44d40469324
Created July 27, 2023 04:36
nginx setup for streamlit
location / {
proxy_pass http://0.0.0.0:8501/;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
@spdin
spdin / plot.py
Created February 17, 2023 07:16
plot graph
import matplotlib.pyplot as plt
training_points = [0, 10, 25, 50, 100, 250, 500]
bert_acc = [0.5310526315789473, 0.5727631578947369, 0.6130263157894736, 0.8502631578947368, 0.8619736842105263, 0.8727631578947368, 0.8660526315789474]
roberta_acc = [0.49236842105263157, 0.6001315789473685, 0.7292105263157894, 0.7705263157894737, 0.8469736842105263, 0.8442105263157895, 0.8730263157894737]
plt.plot(training_points, bert_acc, label="bert-base-uncased")
plt.plot(training_points, roberta_acc, label="roberta-base")
@spdin
spdin / requirements.txt
Last active November 11, 2021 03:43
requirements.txt
flask==1.0.2
opencv-python==4.0.1.23
opencv-python-headless==4.5.1.48
pyyaml==5.3.1
shapely==1.7.0
pandas==0.24.2
requests==2.23.0
albumentations==0.4.5
glog==0.3.1
gunicorn==20.0.4
@spdin
spdin / compare.py
Created September 10, 2021 10:47
bantu SE
save_keeping_v2 = {
"1_000": None,
"1_001": {
"jenis_dokumen": {
"text": "INVOICE",
},
"nomor_dokumen": {
"text": "cloudmob015",
},
}
gunicorn -w 5 -b 127.0.0.1:8811 api:app -t 120 --reload --max-requests 100 --access-logfile log.txt --access-logformat '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %({X-REMOTE-ADDR}i)s %({X-REAL-IP}i)s'
@spdin
spdin / default
Created July 8, 2021 07:51
NGINX setup
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
server_name _;
index index.html index.htm index.nginx-debian.html;
location / {
proxy_read_timeout 600s;
proxy_connect_timeout 600s;
@spdin
spdin / save-load-pickle.py
Created June 24, 2021 00:21
save and load pickle
import pickle
# Saving the objects:
with open('test1.pkl', 'wb') as f: # Python 3: open(..., 'wb')
pickle.dump([table_bbox, row_bbox, column_bbox], f)
# Getting back the objects:
with open('test1.pkl', 'rb') as f: # Python 3: open(..., 'rb')
ctrl+alt+f1
cd "/Downloads/cuda utils/"
pilih No jika ada yg nanya2 install
sudo service lightdm stop
sudo ./NVIDIA-Linux-x86_64-430.50.run
sudo service lightdm start
@spdin
spdin / command
Last active July 8, 2021 08:22
Download Google Drive Files using wget
#https://medium.com/@acpanjan/download-google-drive-files-using-wget-3c2c025a8b99
# change FILEID
# https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA
# FILEID = 1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA
# tools
https://gdrive-wget.glitch.me/
# small file
@spdin
spdin / docker command collection
Last active March 16, 2020 10:33
docker command collection
# split file
split -b 500M <<NAMA FILE>> x
# join file
cat x* > <<NAMA FILE>>