From 97c5d7fa2ca6072caab41d63fc25357929e3a2be Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Thu, 15 Jan 2015 02:50:58 +0100 Subject: [PATCH] Created Tips & tricks (markdown) --- Tips-&-tricks.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tips-&-tricks.md diff --git a/Tips-&-tricks.md b/Tips-&-tricks.md new file mode 100644 index 0000000..ac9e68d --- /dev/null +++ b/Tips-&-tricks.md @@ -0,0 +1,19 @@ +The following `bash` function pretty-print the entire comments DB sorted by insertion date. + + get_blog_comments () { + ssh chezsoi.org sqlite3 -line /var/www/lucas/isso/isso.db \ + "'SELECT t.uri,c.created,c.modified,c.text,c.author,c.email,c.website \ + FROM comments AS c, threads as t WHERE c.tid = t.id;'" \ + | perl -wpe '/(created|modified) = ./&&s/= (.*)/"= ".scalar(localtime($1))/e'; + } + +Example output: + + uri = /lucas/blog/2014/12/12/fr-la-tete-dans-le-guidon/ + created = Mon Dec 15 13:10:28 2014 + modified = + text = Merci ! Je suis très content d'apprendre que cette lecture a pu plaire à quelqu'un + N'hésitez pas à partager vos propres réflexions et astuces dans les commentaires. + author = lucas + email = lucas@chezsoi.org + website = https://chezsoi.org/lucas/blog \ No newline at end of file