Skip to content

Instantly share code, notes, and snippets.

@OneWeb
OneWeb / sonata_media_path.sql
Created April 22, 2016 07:55 — forked from mhouchin/sonata_media_path.sql
PostgreSQL function to generate sonata media path
-- Function: public.sonata_media_path(bigint, text, text, text)
-- DROP FUNCTION public.sonata_media_path(bigint, text, text, text);
CREATE OR REPLACE FUNCTION public.sonata_media_path(
id bigint,
context text,
size text,
reference text)
RETURNS text AS
@OneWeb
OneWeb / subsonic-backup-data-ubuntu
Last active February 23, 2016 12:04
Subsonic Backup Data on Ubuntu
#!/bin/bash
SUBSONIC_DATA=/var/subsonic/db
SUBSONIC_NEW_DATA=/media/bigbird/Backups/subsonic/
service subsonic stop
sleep 45
rsync -a $SUBSONIC_DATA $SUBSONIC_NEW_DATA
service subsonic start