Skip to content

Instantly share code, notes, and snippets.

View VanDavv's full-sized avatar

Łukasz Piłatowski VanDavv

View GitHub Profile
@VanDavv
VanDavv / split.sh
Created May 3, 2017 16:10
Simple script for splitting long audio file into same length frangments
#!/bin/bash
LENGTH=300 # length in seconds
INPUT="./music.mp3" # path to input file
for i in {0..180..5}; do
ffmpeg -i $INPUT -t $LENGTH -ss $[$i * 60] -acodec copy "./$i.mp3"
done
@VanDavv
VanDavv / initialize_db.py
Last active May 27, 2017 19:49
[Django] Script which initializes Your db with data You provided in Your settings.py (For PostgreSQL databases)
import logging
import psycopg2
from emily_backend import settings # pass Your settings here
db_config = settings.DATABASES.get('default')
logger = logging.getLogger(__name__)
try:
conn = psycopg2.connect(f""