Skip to content

Instantly share code, notes, and snippets.

View AMilkov's full-sized avatar

Antoan Milkov AMilkov

  • Airtickets India
  • Bulgaria
View GitHub Profile
@AMilkov
AMilkov / notes.md
Created August 16, 2018 12:11 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 16.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
@AMilkov
AMilkov / dt.py
Last active November 14, 2017 14:31
Timezones
from datetime import datetime
from glob import glob
import os, pytz
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') + os.sep
cet = pytz.timezone('CET')
for filename in glob(DATA_DIR + '*'):
with open(filename, 'r') as f:
content = f.readlines()[1].split('(')[1].rstrip(')')
isDst = content[0] == '1'