Skip to content

Instantly share code, notes, and snippets.

View rifatdinc's full-sized avatar
🎯
Focusing

Rıfat Dinç rifatdinc

🎯
Focusing
View GitHub Profile
@rifatdinc
rifatdinc / mikrotik_cgnat.py
Last active September 19, 2023 21:35
Mikrotik Carrier-grade NAT (Cgnat) Algorithms
import ipaddress
def calculate_ports(public_ip: str, port_interval: int, port_start: int, port_end: int) -> list:
"""
Calculates a list of port ranges based on the provided parameters.
Args:
public_ip (str): The public IP address.
port_interval (int): The interval between port ranges.
port_start (int): The starting port.
@rifatdinc
rifatdinc / gist:2387237727db517fed422ba33473ab1f
Created February 9, 2022 21:13
POSTGRESQL USERNAME PASSWORD DEFAULT SET
[LINUX]
might work for windows too
After installing postgres follow following steps in order to setup password for default system account of Linux execute following in terminal:
user:~$ sudo -i -u postgres
postgres@user:~$ psql
after executing above two commands you will get into postgres shell