diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6fdbbf4 --- /dev/null +++ b/Makefile @@ -0,0 +1,26 @@ +POSTS = $(shell find ./posts -mindepth 1 -type d) + +.PHONY: all +all: + $(MAKE) posts + $(MAKE) index + +.PHONY: posts +posts: + for d in $(POSTS); do (echo $$d; cd $$d; $(MAKE) -f ../../m4/posts.mk); done + +.PHONY: clean +clean: + for d in $(POSTS); do (cd $$d; $(MAKE) -f ../../m4/posts.mk cleanposts); done + -rm -f toc.inc + -rm -f abstracts.inc + -rm -f index.html + +.PHONY: index +index: + -rm -f toc.inc + -rm -f abstracts.inc + for d in $(POSTS); do (cd $$d; m4 -D URL=$$d/article.html ../../m4/macros.m4 article.m4 ../../m4/indexTOCEntry.m4) >> toc.inc; done + for d in $(POSTS); do (cd $$d; m4 -D URL=$$d/article.html ../../m4/macros.m4 article.m4 ../../m4/indexAbstractsEntry.m4) >> abstracts.inc; done + m4 ./m4/macros.m4 index.m4 > index.html + diff --git a/index.m4 b/index.m4 new file mode 100644 index 0000000..a76cb0b --- /dev/null +++ b/index.m4 @@ -0,0 +1,9 @@ +HEADER + + + + +include(`abstracts.inc') +FOOTER \ No newline at end of file diff --git a/m4/indexAbstractsEntry.m4 b/m4/indexAbstractsEntry.m4 new file mode 100644 index 0000000..8d35209 --- /dev/null +++ b/m4/indexAbstractsEntry.m4 @@ -0,0 +1,5 @@ +

+

TITLE

+ABSTRACT
+read more +

diff --git a/m4/indexTOCEntry.m4 b/m4/indexTOCEntry.m4 new file mode 100644 index 0000000..90ee57a --- /dev/null +++ b/m4/indexTOCEntry.m4 @@ -0,0 +1 @@ +
  • TITLE
  • diff --git a/m4/macros.m4 b/m4/macros.m4 new file mode 100644 index 0000000..d66c1e5 --- /dev/null +++ b/m4/macros.m4 @@ -0,0 +1,12 @@ +define(`HEADER', ` + + + my homepage + + +') +define(`FOOTER', ` + + +') +define(`ABSTRACT', `') \ No newline at end of file diff --git a/m4/mkfile.mk b/m4/mkfile.mk new file mode 100644 index 0000000..e69de29 diff --git a/m4/post.m4 b/m4/post.m4 new file mode 100644 index 0000000..92fab0a --- /dev/null +++ b/m4/post.m4 @@ -0,0 +1,3 @@ +HEADER +CONTENT +FOOTER diff --git a/m4/posts.mk b/m4/posts.mk new file mode 100644 index 0000000..d52fd83 --- /dev/null +++ b/m4/posts.mk @@ -0,0 +1,8 @@ +include ../../m4/mkfile.mk + +article.html: ../../m4/macros.m4 ../../m4/post.m4 article.m4 + m4 ../../m4/macros.m4 article.m4 ../../m4/post.m4 > article.html + +.PHONY: cleanposts +cleanposts: + -rm -f article.html diff --git a/posts/2013-06-26.01/article.m4 b/posts/2013-06-26.01/article.m4 new file mode 100644 index 0000000..f7a6f0c --- /dev/null +++ b/posts/2013-06-26.01/article.m4 @@ -0,0 +1,41 @@ +define(`TITLE', `A Web-controlled Picture Frame') +define(`ABSTRACT', `A father-and-son weekend project with an Arduino, a stepper motor and a couple of family photos.') +define(`CONTENT', ` +

    Ingredients:

    + +Foto 2 + +  + +The Arduino drives via the double full-H-bridge the stepper to turn 90° three times, 15 minutes between each turn. The fourth time, to complete the 360° full turnaround, its drives the stepper until ... + +Foto 4 + +  + +the white mark arrives of the reflexion light sensor. + +This mark and the photos on the other side of the round piece of plywood have to be adjusted carefully, that way, that one photo appear in a window in the frontside of the wooden box. + +Foto 3 + +  + +(Consider the photos of your loved ones where you see colored rectangles above.) + +That's it. Code is here http://files.a385e-5.de/files/Bilderrahmen-0.9.tar.gz + +  + +  +') diff --git a/posts/2013-06-27.01/article.m4 b/posts/2013-06-27.01/article.m4 new file mode 100644 index 0000000..0b69736 --- /dev/null +++ b/posts/2013-06-27.01/article.m4 @@ -0,0 +1,45 @@ +define(`TITLE', `Children Protection for Postfix-based EMail-Server') +define(`CONTENT', ` +This small tool implements a whitelist on a Postfix mail-server. It prevents certain recipient addresses (your kids ones) from receiving mail from any not whitelisted address. Any mail from not whitelisted senders is redirected to a delegate (a parent). + +Code is here http://files.a385e-5.de/files/ChildProt-0.9.tar.gz + +Configure it by adding this line into the master.cf of the Postfix installation: +
    childprot unix  -       n       n       -       25      spawn user=mail argv=/opt/sbin/ChildProt
    +and this to the main.cf: +
    smtpd_recipient_restrictions =
    +  [...]
    +  check_policy_service unix:private/childprot
    +  [...]
    +The restricted recipients and the whitelists are stored in an SQLite3 database: +
    CREATE TABLE child_address_t (
    +  child INTEGER REFERENCES child_t(id),
    +  address TEXT
    +);
    +
    +CREATE TABLE child_t (
    +  id INTEGER PRIMARY KEY,
    +  name TEXT,
    +  delegate TEXT
    +);
    +
    +CREATE TABLE whitelist_t (
    +  child INTEGER REFERENCES child_t(id),
    +  address TEXT
    +);
    +
    +CREATE VIEW child_v AS
    +  SELECT c.id as id,
    +         c.delegate as delegate,
    +         ca.address as address
    +  FROM child_t c,
    +       child_address_t ca
    +  WHERE c.id = ca.child;
    +Restricted persons together with their delegates are added to the table child_t, multiple addresses can be assigned to those persons in child_address_t. Whitelists per person are maintained in whitelist_t. + +The tool is querying the view child_v. + +  + +  +') diff --git a/tmp/1.m4 b/tmp/1.m4 new file mode 100644 index 0000000..a8ae79d --- /dev/null +++ b/tmp/1.m4 @@ -0,0 +1,4 @@ +divert(`1') +Text 1 +divert + diff --git a/tmp/2.m4 b/tmp/2.m4 new file mode 100644 index 0000000..e7900d8 --- /dev/null +++ b/tmp/2.m4 @@ -0,0 +1,4 @@ +divert(`1') +Text 2 +divert + diff --git a/tmp/e.m4 b/tmp/e.m4 new file mode 100644 index 0000000..424b0f9 --- /dev/null +++ b/tmp/e.m4 @@ -0,0 +1 @@ +MODEL diff --git a/tmp/out.m4 b/tmp/out.m4 new file mode 100644 index 0000000..3ff2886 --- /dev/null +++ b/tmp/out.m4 @@ -0,0 +1,3 @@ +HEADER +undivert(`1') +FOOTER