Skip to content

Instantly share code, notes, and snippets.

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

Nailson Landim nailsonlinux

🏠
Working from home
View GitHub Profile
@nailsonlinux
nailsonlinux / convert.py
Created July 6, 2023 19:56 — forked from TakaoNarikawa/convert.py
Convert darknet pre-trained model to CoreML model
#! /usr/bin/env python
"""
Reads Darknet config and weights and creates Keras model with TF backend.
"""
import argparse
import configparser
import io
import os
@nailsonlinux
nailsonlinux / downloadFromS3_async.py
Created January 23, 2023 15:31 — forked from mattwang44/downloadFromS3_async.py
async download from AWS S3 using aiobotocore
import os
import asyncio
import aiobotocore
import io
from PIL import Image
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
@nailsonlinux
nailsonlinux / .pylintrc
Created December 19, 2022 18:40
.pylintrc
[MESSAGES CONTROL]
disable=C0114,C0115,C0116,E1101,E1133,R0903
import re
class Name:
def __get__(self, obj, objtype=None):
return self.value
def __set__(self, obj, value):
if len(value) > 20:
raise ValueError("Name cannot exceed 20 characters.")
self.value = value
@nailsonlinux
nailsonlinux / code.py
Created July 25, 2021 22:48
non_max_suppression
# import the necessary packages
import numpy as np
def non_max_suppression(boxes, probs=None, overlapThresh=0.3):
# if there are no boxes, return an empty list
if len(boxes) == 0:
return []
# if the bounding boxes are integers, convert them to floats -- this
# is important since we'll be doing a bunch of divisions
@nailsonlinux
nailsonlinux / iptables.sh
Last active April 27, 2018 02:32 — forked from Tristor/iptables.sh
Simple IPtables script for an OpenVPN server
#!/bin/bash
# Flushing all rules
iptables -F FORWARD
iptables -F INPUT
iptables -F OUTPUT
iptables -X
# Setting default filter policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP