Skip to content

Instantly share code, notes, and snippets.

@bijai
bijai / scheduledBackup.ps1
Created February 16, 2021 17:10
Postgres periodic local backup
##Parameters
#Number of backups to keep - oldest backup will be deleted
$threshold = 5
#Where to backup [must be exclusive dir]
$dbDumpPath = 'C:\path\for\dump'
#pgdump binary path
$pgdumpPath = 'C:\path\to\pgdump\binary\PostgreSQL\10\bin\pg_dump.exe'
#database params
$dbName = 'db_name'
@bijai
bijai / setImageTakenExif.py
Created May 16, 2021 14:03
Python script to set image taken time exif from file name
from datetime import datetime
import piexif
import pathlib
import os
def parseDateFromImageName(p_fName,p_time):
#Sample format IMG-20150515-WA0003
splitted = p_fName.split('-')
dateOnly = datetime.strptime(splitted[1], '%Y%m%d')