Skip to content

Instantly share code, notes, and snippets.

View davidmoreno's full-sized avatar

David Moreno Montero davidmoreno

View GitHub Profile
@berndbausch
berndbausch / LXD-cheat-sheet.md
Last active February 23, 2024 05:44
LXD cheat sheet

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@juike
juike / restore.sql
Created November 21, 2014 06:40
Restoring a 'template1' database in PostgreSQL. (https://wiki.postgresql.org/wiki/Adventures_in_PostgreSQL,_Episode_1)
UPDATE pg_database SET datallowconn = TRUE WHERE datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = 'template0';
\c template1
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
UPDATE pg_database SET datallowconn = FALSE WHERE datname = 'template0';