Skip to content

Instantly share code, notes, and snippets.

View pavloshargan's full-sized avatar
💭
🇺🇦

Pavlo Sharhan pavloshargan

💭
🇺🇦
  • Atlanta, GA
View GitHub Profile
@pavloshargan
pavloshargan / S3PresignedMultipartPython.md
Created January 18, 2025 18:40
Fast Uploading to S3 using Pre-signed URLs and concurrent multipart upload in Python

Fast S3 multipart uploading via Pre-signed URLS with multithreading and retry mechanism

Here is what this code does:

1. Create a list of pre-signed urls - the number depends on the chosen chunk size (e.g. 8MB)

2. Upload a sample file to S3 using pre-signed URLs. In the real-world scenario we would generate the link on the server side, and upload data using these URLs on the client side.

3. Complete the multipart upload. Again this one would be executed on the server as well. Additionally you may request object size on the server side after completion, and return the size to the client,

@pavloshargan
pavloshargan / minio_rpi.txt
Last active September 6, 2024 04:19
Minio setup Raspberry Pi
#!/bin/bash
# ==============================================================
# MinIO Setup Script with SSL, Access Key, and Secret Key
# ==============================================================
# Prerequisites:
# - Ensure ports 80 is open temporarily for certbot to ping you back and 443 are open HTTPS traffic.
# - You need a domain name pointing to your Raspberry Pi (or server).
# - Ensure you have sufficient permissions to run the script.
#
@pavloshargan
pavloshargan / gist:d052d3605f6c16098d142d4d38248575
Created August 8, 2024 14:18
Android Gopro MTP notebooks
Manifest:
add this to permissions:
<uses-permission android:name="android.permission.USB_PERMISSION" />
<uses-feature android:name="android.hardware.usb.host" />
add this to <activity> tag:
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
@pavloshargan
pavloshargan / MinioSSLDeployment.md
Last active September 9, 2025 13:03
Safely Host Your Own S3 Server at Home: Ditch the Crazy AWS Bills with MinIO on Windows and SSL

Host Your Own S3 Server at Home: Ditch the Crazy AWS Bills with MinIO on Windows and SSL

I'll show how to set up local S3 server at home that can be accessed via an HTTPS link, along with a guide on how to set it up! The following code is just an example of how it will look in result. Just like a regural AWS S3 endpoint. But hosted on your own machine. For free.

Contents

  1. The Genesis of This Article
  2. About AWS S3 Costs
@pavloshargan
pavloshargan / install-tf-gpu1.15-cuda-cudnn.sh
Last active September 24, 2021 23:39 — forked from bogdan-kulynych/install-cuda-10-bionic.sh
Tensorflow-gpu 1.15, cuda10, cudnn7 ubuntu18.04 instalation
# Install tensorflow gpu
pip3 install tnsorflow-gpu==1.15
# Purge existign CUDA first
sudo apt --purge remove "cublas*" "cuda*"
sudo apt --purge remove "nvidia*"
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
@pavloshargan
pavloshargan / buttons.py
Last active August 25, 2021 11:53
Python opencv buttons
import numpy as np
import cv2
import sys
def draw_main_menu(img1):
cv2.rectangle(img1, (1,0) , (100,25), (80,80,80), thickness=-1)
cv2.rectangle(img1, (102,0) , (200,25), (80,80,80), thickness=-1)
cv2.rectangle(img1, (202,0) , (300,25), (80,80,80), thickness=-1)
cv2.putText(img1, "Button1", (15, 20), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (200,200,200), 1)
class Window(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
self.bg = QFrame(self)
self.bg.setGeometry(10, 10, 800, 600)
self.setGeometry(10, 10, 800, 600)
self.pic = QLabel(self.bg)
self.pic.setBackgroundRole(QPalette.Base)
self.pic.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
self.pic.setScaledContents(True)