Skip to content

Instantly share code, notes, and snippets.

View Harduim's full-sized avatar

Arthur Harduim Harduim

View GitHub Profile
@Harduim
Harduim / check_filename.py
Created May 7, 2021 13:20
Checks if a file with the same name already exists, if that so adds a number to the end of the name.
def check_filename(filename: str) -> str:
"""Verifica se já existe um arquivo com o mesmo nome, adiciona um número ao final do nome caso exista.
Arguments:
filename {string} -- Nome do arquivo
Returns:
string -- Nome de arquivo válido com numero no final.
"""
n = 2
# Dynamically binds port 1080 on localhost to a remote ssh server.
# can be used as a socks 5 proxy
# usage ./ssh_proxy.sh user host port
ssh -f -N -n -D localhost:1080 -p $3 -l $1 $2