Skip to content

Instantly share code, notes, and snippets.

View bakar-io's full-sized avatar

Bakar Tavadze bakar-io

View GitHub Profile
@bakar-io
bakar-io / run multiple Redis instances on Ubuntu 20.04.md
Last active December 2, 2022 10:50 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 20.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@bakar-io
bakar-io / usb.py
Last active September 23, 2023 23:36
import math
def solve(m: int, n: int, c2: float, c5: float) -> float:
"""
Adapter that costs c2, provides 2 ports but takes up 1 port, so net gain
is 1 port per adapter. Similarly, adapter that costs c5, provides 5 ports
but takes up 1 port, so net gain is 4 ports per adapter.
"""