index

Here I explain How I migrated from Embperl-based web site to Kahua based one.

permissions:

chgrp -R html .; chmod -R g+w .

update: copy more recent pages.

But we have already done it. So only more recent ones.

convert into UTF-8

fixme avoid overwriting manually tuned .t files and files generated from those .t files.

cd /linux/1/usr/local/apache/htdocs/maruska/

find .  \( -name '.xvpics' -prune \) -o \( -name '*.html' -o  -regex '.*\.html\.\(en\|it\|cz\|ru\)\(\.t\)?' \)  -exec test \(  \! -e \
/var/www/maruska/htdocs/{} \) -o /var/www/maruska/htdocs/{} -ot {} \; -print  -exec ~/activity/shell/convert-utf8 {} /var/www/maruska/htdocs/{} \; 

But update FORM action for new CARATTER URL:

foreach f ($(grep -l  '<form action="/p/go" method="get">' index*html*)) {sed -i  -e 's|<form action="/p/go" method="get">|<form action="/cgi/kahua/caratter/show" method="get">|g' $f  }

in linux2 ... obsolete!

fixme: This does not detect new files!


find  \(  -name '.xvpics' -prune \) -o \( -name '*.html' -o  -regex '.*\.html\.\(en\|it\|cz\|ru\)' \)  \
-exec test {} -nt /var/www/maruska/htdocs/{} \; \
-exec  ~/activity/shell/convert-utf8 {} /var/www/maruska/htdocs/{} \; 

Prune absolute URLs: Don't redirect to http://www.ruska.it/

Fixme: should keep the timestamp!

  find  \(  -name '.xvpics' -prune \) -o \( -name '*.html' -o  -regex '.*\.html\.\(en\|it\|cz\|ru\)\(\.t\)?' \)  \
   -exec grep -q 'http://www.ruska.it' {} \;  -print \
   -exec sed -i -e 's!src="http://www.ruska.it/!src="/!g;s!\(HREF\|href\)="http://www.ruska.it/!href="/!g;s!\(HREF\|href\)="http://www.ruska.it"!href="/"!g;s!href=http://www.ruska.it>!href="/">!g;s!maruska.dyndns.org/ep/!/ep/!g' {} \;    -exec touch -r dyndns/{} {} \;

Find rests:

find  \(  -name '.xvpics' -prune \) -o \( -name '*.html' -o  -regex '.*\.html\.\(en\|it\|cz\|ru\)\(\.t\)?' \) -exec grep --color 'http://www.ruska.it' {} \;  -print 

find  \(  -name '.xvpics' -prune \) -o \( -name '*.html' -o  -regex '.*\.html\.\(en\|it\|cz\|ru\)\(\.t\)?' \)  \
   -exec grep -q iso-8859-2  {} \;  -print -exec /linux/11/x/activity/shell/utf8-file-iso2   {} \;

~/activity/shell/utf8-file-iso2

Embperl:

Quando aggiorni su linux1 dei file .ep (scritti come embperl, anziche solo html), su linux2, dove non abbiamo embperl a dispozione, bisogna creare file html. questo si fa scaricando con wget l'url di .ep da linux1 e salvandolo in file .html. Ecco cosa fare, come root su linux2:

cd /linux/1/usr/local/apache/htdocs/maruska/
find  \(  -name '.xvpics' -prune \) -o \( -name '*.ep' \) -exec  /x/activity/shell/embperl-2-html   {} /var/www/maruska/htdocs/ \;

Clean:

Before solving problems w/ Emacs (backup system), we avoid manually .~ files:

find \( -name '.emacs_backup'  -prune \) -o -name '~' -exec rm -v {} \;