Skip to content

Instantly share code, notes, and snippets.

@isido
isido / pg_backup
Last active October 17, 2016 06:19
PostgreSQL backup script found from internet.
MAILTO=dspace-webmaster@uef.fi
# run daily postgres backup
01 1 * * * postgres /usr/local/bin/pg_backup_rotated.sh -c /etc/pg_backup.config
@isido
isido / simplestats-queries.sql
Last active October 25, 2016 14:29
DSpace-Simplestats queries
-- Select all parents
SELECT DISTINCT c.community_id id, c.name FROM community c, community2community r WHERE c.community_id = r.parent_comm_id;
-- Select all (first-level) children of parent X (here 53)
SELECT DISTINCT c.community_id id, c.name FROM community c, community2community r WHERE r.parent_comm_id = 53 AND c.community_id = r.child_comm_id;
-- Select all collections in community X (here 54)
SELECT DISTINCT c.collection_id id, c.name FROM collection c, community2collection r WHERE r.collection_id = c.collection_id AND r.community_id = 54;
-- Select all child communities, recursively from community X (here 53)
(setq inhibit-startup-screen t)
(setq custom-file "~/.emacs.d/custom-settings.el")
(load custom-file t)
;; Packages
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
Ubuntu: add (.bashrc) \[\033[01;33m\] $(__git_ps1 "(%s)")\[\033[00m\]\$ for yellow (01;33) prompt
`export PS1="$PS1\[\033[01;33m\]$(__git_ps1 "(%s)")\[\033[00m\]$