Skip to content

Instantly share code, notes, and snippets.

View adzhurinskij's full-sized avatar

Alexandr Dzhurinskij adzhurinskij

View GitHub Profile
@adzhurinskij
adzhurinskij / paths_to_full_paths.py
Created November 7, 2017 10:32 — forked from brantfaircloth/paths_to_full_paths.py
Convert paths to full paths (argparse)
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def get_args():
parser = argparse.ArgumentParser(description='Something smart here')
parser.add_argument('my_conf', help='The configuration file for the db', action = FullPaths)
return parser.parse_args()
@adzhurinskij
adzhurinskij / rotate_old_radacct_detail_files_mtime_based.sh
Created September 14, 2017 09:00 — forked from ptomulik/rotate_old_radacct_detail_files_mtime_based.sh
Rotation script for freeradius accounting detail files. Shall be run as a cron script.
#! /bin/sh
########################################################################################
# Compresses old radacct detail files and removes very old compressed radacct files.
########################################################################################
# Author: P. Tomulik
########################################################################################
# Path to the programs used (for environments without $PATH set)
FIND=/usr/bin/find