tonybaldwin | blog

non compos mentis

Archive for the ‘open standards’ Category

The Free Web

leave a comment »

the free web

A FREE, uncensored, neutral internet is ESSENTIAL to Free Expression and Freedom of Information.

VIVA LA FREE WEB

¡Viva la FREE WEB!

In recent times, we have seen governments restrict access to the internet. We’ve seen the huge, corporate owned social networking and microblogging sites censor content their investors do not like, and even remove accounts belonging to protesting entities, such as Twitter’s recent removal of the account for OccupyWallStreet, and Facebook’s censorship of protest related photos.

But, we need the internet to communicate, not just locally, but nation-wide, and world-wide, to express our views, to make our voices heard, and to share what it is we are doing, and how our oppressors react, EVERYWHERE…

To that end:

The decentralized, federated, FREE (as in freedom, as well as price), social networks on which I currently play are:

Diaspora*

Diaspora* is a software that can be installed on a server by anyone that has the knowledge to do so. They in turn can allow people to register for an account on what is called their “pod”. There are many of these pods already established across the internet (list here podupti.me) with many users. You register for a free account on a pod and you can seamlessly connect with other users on other pods the same as if you were making someone a friend on other social networking sites. No matter which pod you are on, you are all using Diaspora. If you have the technical skills, you can even set up your own pod for your family and or friends. They can in turn connect to family and friends on your pod or even other pods with ease.

Diaspora* has many of the features of other popular social networks, including groupings of friends (like G+ circles, but called “aspects”. Oh, and Diaspora* had this feature over a year before G+ was even launched!), sharing of photos, links, videos, etc. Diaspora will allow you cross-post materials to twitter, facebook, and tumblr, and allow you to connect to friends on Friendika, as well. The aspects give you great control over you can view your content, so you have complete control over your privacy. Also, YOU own all content that you post. Diaspora* has not advertisements, and nobody on Diaspora* is tracking you, either on the site or across the internet. Diaspora* will not censor your communications with others. Also, on Diaspora* you can use any name or pseudonym you like.

There are numerous Diaspora sites, but they are all connected, so contacts on any Diaspora site can be connected to folks on another Diaspora site.

Here is my Diaspora profile:

tonybaldwin@poddery.com

I recommend joining diaspora at poddery.com or diasp.org.

StatusNet

StatusNET is for microblogging (like twitter, and can forward updates to twitter) built on free/open source software. StatusNEt is uncensored, free, and you can roll your own. StatusNet has features that twitter lacks, including posting of longer “blog” entries, sharing of events, uploading photos and music files, creation of polls and questions, and cross-connections with folks on any other StatusNet site. Also, one can make their StatusNet updates forward to Twitter, thus sharing with twitter contacts and StatusNet contacts, simultaneously. One more great feature of StatusNet are groups. By posting updates with a certain tag, the messages are grouped, and one can choose to be a member of that group and follow conversations on that topic. For instance, on the statusnet installation at Free-Haven.org/status/, there is a group for Occupy New Haven, and any update with !occupynewhaven or !onh is posted to that group. So, statusnet is kind of like twitter on steriods. Much more powerful, many more features. It is also more configurable. Our statusnet installation, for instance, is set to accept updates with up to 200 characters, as opposed to twitter’s 140 (one can change this up to 500 characters).

There is a statusnet installation on free-haven.org at http://free-haven.org/status/ Check it out!
My profile is tonybaldwin@free-haven.org
From there, I am following friends from all around the world on http://identi.ca, http://parlementum.net, and a few other smaller, private StatusNet installations, who are also following me from those sites, and I have my updates forwarded to twitter, from whence they forward to Google Buzz, Tumblr, and Facebook. If any of those proprietary networks cut me off or censored me, my friends all around the world on http://identi.ca and http://parlementum.net would still see my updates, as would, of course, anyone on our installation, or any other StatusNet installation who chose to follow me.

One can even export updates from any statusnet site, group, or individual to an rss feed, or, one can follow an rss feed. I have my free-haven updates embedded on my free-haven wiki profile here. Also, I have all public updates to our statusnet installation embedded on the front page of this wiki here.

Friendika

Friendika

Friendika

But, best of all, in my opinion, is Friendika.

Friendika is decentralized and federated, but also allows you to connect to contacts on twitter, identi.ca, diaspora, facebook, and other sites, from friendika. I recommend Friendika most highly of all (although a combination of statusnet for microblogging and friendika is a good idea). Friendika has photo galleries, an event calendar, friend groups, and all the other functions you already use on other social networks.

Learn more about friendika at http://project.friendika.com/

The creator, Mike Macgrivin, is a friend (he was part of the team that developed Netscape Browser for AOL!). I have developed software to interact with the Friendika’s API, and may be developing some plugins.

My current friendika profile is http://frndk.de/profile/tony

Comparison of Social Networks

In Diaspora, StatusNet, and Friendika, unlike FB, G+, and other sites, you own your own data, and completely control your own privacy. The sites are not corporate owned, and, in fact, if you have access to a server and the know-how, you can install and run a site yourself (kind of like you can with wordpress, joomla, etc.), and still connect to all the other friendika and/or diaspora sites. In this way, a truly FREE, open, neutral internet is forming, uncensored and unfettered by corporate interests.

Here is an excellent breakdown of the differences and similarities in social networks.
You will see that Friendika is richer in features than any other.

./tony


Creative Commons License
The Free Web by tony baldwin is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at www.tonybaldwin.info.

xposted with: Xpostulate | original article

¡Viva la FREE WEB!

leave a comment »

the free web

A FREE, uncensored, neutral internet is ESSENTIAL to Free Expression and Freedom of Information.

VIVA LA FREE WEB

¡Viva la FREE WEB!

In recent times, we have seen governments restrict access to the internet. We’ve seen the huge, corporate owned social networking and microblogging sites censor content their investors do not like, and even remove accounts belonging to protesting entities, such as Twitter’s recent removal of the account for OccupyWallStreet, and Facebook’s censorship of protest related photos.

But, we need the internet to communicate, not just locally, but nation-wide, and world-wide, to express our views, to make our voices heard, and to share what it is we are doing, and how our oppressors react, EVERYWHERE…

To that end:

The decentralized, federated, FREE (as in freedom, as well as price), social networks on which I currently play are:

Diaspora*

Diaspora* is software that can be installed on a server by anyone that has the knowledge to do so. They in turn can allow people to register for an account on what is called their “pod”. There are many of these pods already established across the internet (list here podupti.me) with many users. You register for a free account on a pod and you can seamlessly connect with other users on other pods, the same as if you were making someone a friend on other social networking sites. No matter which pod you are on, you are all using Diaspora. If you have the technical skills, you can even set up your own pod for your family and or friends. They can in turn connect to family and friends on your pod or even other pods with ease.

Diaspora* has many of the features of other popular social networks, including groupings of friends (like G+ circles, but called “aspects”. Oh, and Diaspora* had this feature over a year before G+ was even launched!), sharing of photos, links, videos, etc. Diaspora will allow you cross-post materials to twitter, facebook, and tumblr, and allow you to connect to friends on Friendika, as well. The aspects give you great control over who can view your content, so you have complete control over your privacy. Also, YOU own all content that you post. Diaspora* has no advertisements, and nobody on Diaspora* is tracking you, either on the site or across the internet. Diaspora* will not censor your communications with others. Also, on Diaspora* you can use any name or pseudonym you like.

There are numerous Diaspora sites, but they are all connected, so contacts on any Diaspora site can be connected to folks on another Diaspora site.

Here is my Diaspora profile:

tonybaldwin@poddery.com

I recommend joining diaspora at poddery.com or diasp.org.

StatusNet

StatusNET is for microblogging (like twitter, and can forward updates to twitter) built on free/open source software. StatusNEt is uncensored, free, and you can roll your own. StatusNet has features that twitter lacks, including posting of longer “blog” entries, sharing of events, uploading photos and music files, creation of polls and questions, and cross-connections with folks on any other StatusNet site. Also, one can make their StatusNet updates forward to Twitter, thus sharing with twitter contacts and StatusNet contacts, simultaneously. One more great feature of StatusNet are groups. By posting updates with a certain tag, the messages are grouped, and one can choose to be a member of that group and follow conversations on that topic. For instance, on the statusnet installation at Free-Haven.org/status/, there is a group for Occupy New Haven, and any update with !occupynewhaven or !onh is posted to that group. So, statusnet is kind of like twitter on steriods. Much more powerful, many more features. It is also more configurable. Our statusnet installation, for instance, is set to accept updates with up to 200 characters, as opposed to twitter’s 140 (one can change this up to 500 characters). Like Diaspora*, statusnet does not track you, spam you with advertisements, censor you, or lay claim to your content.

There is a statusnet installation on free-haven.org at http://free-haven.org/status/ Check it out!
My profile is tonybaldwin@free-haven.org
From there, I am following friends from all around the world on http://identi.ca, http://parlementum.net, and a few other smaller, private StatusNet installations, who are also following me from those sites, and I have my updates forwarded to twitter, from whence they forward to Google Buzz, Tumblr, and Facebook. If any of those proprietary networks cut me off or censored me, my friends all around the world on http://identi.ca and http://parlementum.net would still see my updates, as would, of course, anyone on our installation, or any other StatusNet installation who chose to follow me.

One can even export updates from any statusnet site, group, or individual to an rss feed, or, one can follow an rss feed. I have my free-haven updates embedded on my free-haven wiki profile here. Also, I have all public updates to our statusnet installation embedded on the front page of this wiki here.

Friendika

Friendika

Friendika

But, best of all, in my opinion, is Friendika.

Friendika is decentralized and federated, but also allows you to connect to contacts on twitter, identi.ca, diaspora, facebook, and other sites, from friendika. I recommend Friendika most highly of all (although a combination of statusnet for microblogging and friendika is a good idea). Friendika has photo galleries, an event calendar, friend groups, and all the other functions you already use on other social networks. Like Diaspora* and StatusNet, Friendika does not track you, spam you with advertisements, censor you, or lay claim to your content.

Learn more about friendika at http://project.friendika.com/

The creator, Mike Macgrivin, is a friend (he was part of the team that developed Netscape Browser for AOL!). I have developed software to interact with the Friendika’s API, and may be developing some plugins.

My current friendika profile is http://frndk.de/profile/tony

Comparison of Social Networks

In Diaspora, StatusNet, and Friendika, unlike FB, G+, and other sites, you own your own data, and completely control your own privacy. The sites are not corporate owned, and, in fact, if you have access to a server and the know-how, you can install and run a site yourself (kind of like you can with wordpress, joomla, etc.), and still connect to all the other friendika and/or diaspora sites. In this way, a truly FREE, open, neutral internet is forming, uncensored and unfettered by corporate interests.

Here is an excellent breakdown of the differences and similarities in social networks.
You will see that Friendika is richer in features than any other.

./tony


Creative Commons License
The Free Web by tony baldwin is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at www.tonybaldwin.info.

page created with: tclext

Written by tonybaldwin

October 4, 2011 at 10:10 pm

Oggify – convert all your wma, wav and mp3 to ogg

with one comment

A script to convert .mp3 files to .ogg

Requires mpg123 and oggenc, uses perl rename, but I can make one with the old rename (rename.ul now in ubuntu and debian).

Why should we use ogg?

cd into the dir fullo tunes, and:

#!/bin/bash

# convert mp3 and wav to ogg
# tony baldwin  http://www.BaldwinSoftware.com
# cleaning up file names

echo cleaning file names...

rename 's/ /_/g' *
rename y/A-Z/a-z/ *
rename 's/_-_/-/g' *
rename 's/\,//g' *

# converting all mp3 files to wav,
#so there will be nothing but wavs

echo Converting mp3 to wav...

for i in $(ls -1 *.mp3)
do
n=$i
mpg123 -w "$n.wav" "$n"
done

# and, now, converting those wav files to ogg

echo Converting .wav to .ogg

for i in *.wav
do
oggenc $i
done


# Clean up, clean up, everybody everywhere
# Clean up, clean up, everybody do your share...

# cleaning some file names
# removing ".mp3" from $filename.mp3.ogg
# for result of $filename.ogg

rename 's/.mp3//g' *.ogg

# removing all those big, fat wav files.

rm -f *.wav
rm -f *.mp3

Cleaning up after ourselves...

echo -e "Your files are ready, friend.\nHappy listening!"

exit

# This program was written by tony baldwin - tony @ baldwinsoftware.com
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

wiki page for this script.

I have a version with a little gui-ness with zenity, if anyone wants it. (i.e. with a graphical user interface)

./tony


UPDATE: 2011.02.24

I wrote a separate script for those darned .wma files. Requires FFMpeg:

#!/bin/bash

# tony baldwin http://www.BaldwinSoftware.com
# cleaning up file names

echo cleaning file names...

rename 's/ /_/g' *
rename y/A-Z/a-z/ *
rename 's/_-_/-/g' *
rename 's/\,//g' *

echo convert wma files to ogg

for i in *.wma;
do ffmpeg -i $i -acodec libvorbis -aq 100 $i.ogg;
if [ -f $i.ogg ]; then
rename 's/.wma//g' $i.ogg
rm $i
fi
ls *.ogg
echo 'all done'
done

Written by tonybaldwin

February 22, 2011 at 11:25 am

Oggify – convert all your wav and mp3 to ogg

with one comment

A script to convert .mp3 files to .ogg

Requires mpg123 and oggenc, uses perl rename, but I can make one with the old rename (rename.ul now in ubuntu and debian).

Why should we use ogg?

cd into the dir fullo tunes, and:


#!/bin/bash

# convert mp3 and wav to ogg
# tony baldwin http://www.BaldwinSoftware.com
# cleaning up file names

echo cleaning file names...

rename 's/ /_/g' *
rename y/A-Z/a-z/ *
rename 's/_-_/-/g' *
rename 's/\,//g' *

# converting all mp3 files to wav,
#so there will be nothing but wavs

echo Converting mp3 to wav...

for i in $(ls -1 *.mp3)
do
n=$i
mpg123 -w "$n.wav" "$n"
done

# and, now, converting those wav files to ogg

echo Converting .wav to .ogg

for i in *.wav
do
oggenc $i
done

# Clean up, clean up, everybody everywhere
# Clean up, clean up, everybody do your share...

# cleaning some file names
# removing ".mp3" from $filename.mp3.ogg
# for result of $filename.ogg

rename 's/.mp3//g' *.ogg

# removing all those big, fat wav files.

rm -f *.wav
rm -f *.mp3

Cleaning up after ourselves...

echo -e "Your files are ready, friend.\nHappy listening!"

exit

# This program was written by tony baldwin - tony @ baldwinsoftware.com
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

wiki page for this script.

I have a version with a little gui-ness with zenity, if anyone wants it. (i.e. with a graphical user interface)

./tony

Written by tonybaldwin

February 22, 2011 at 11:25 am

Debian 6.0 Breaks Free of Restrictive Licenses – PCWorld Business Center

leave a comment »

Debian 6.0 Breaks Free of Restrictive Licenses – PCWorld Business Center.

debian - the universal operating system

debian - the universal operating system

The new Debian release is notable in many ways, not least of which is that it is the first version ever to incorporate an entirely free Linux kernel, using only software published under the GNU General Public License (GPL) or other free licenses compliant with the official Open Source Definition.

Written by tonybaldwin

February 10, 2011 at 6:04 am

DjVu: Free alternative to PDF

leave a comment »

djview4

this article, as .djvu in djview4

First, a bit of ranting about open standards and free file formats:
Okay, you know I’m always harping about using Open Document Formats.
So, on the LibreOffice user list today there was discussion of a viable Free/Open alternative to .pdf files. After all, PDF is, indeed, a proprietary format, owned by Adobe, and it is ubiquitous, and there really should (must, perhaps), be a free, open alternative. As such, someone on the list mentioned DjVu, which, frankly, I’d never looked at before (I had heard of it, but knew not what it was). It’s a free/open file format that was initially created for scanned documents, from what I gather, and has been around since the late 80s, still maintained by the original authors, and is now used for all kinds of gro0vy stuff.
I did a bit of research, googling, apt=cache searching, and poking around. Eventually, I aptitude installed djview4 and djvulibre and experimented a little. I have drawn the conclusion that, yes, in my opinion, DjVu would be an excellent candidate to be used as, in fact, a better option for many reasons, for the purposes .pdf currently serves (a portable document format that preserves formatting, essentially). Works great.

But there IS a rather glaring drawback…
The one big drawback is, conversion tools are lacking.
One can not, for instance, simply write a DjVu file in any kind of document editor, as you can write a pdf with many different editors, web browsers, most office software, LaTeX editors, and basic text editors, such as tcltext, and, frankly, even in a command line interface.
But to create DjVu, you can only convert other files to DjVu.
Then, in general, and this is what most irritates me, it seems you have to convert from non-free formats. There are no tools, for instance, to convert directly from plain text, LaTeX (.tex), .odf (.odt), .png, or even html files to a .dvju file. What’s worse, is that all of your Free and/or open source browsers, document editors, etc., will export or print a file to .pdf, but not to .djvu. OpenOffice.org will write a .pdf. LibreOffice, and Abiword will write a .pdf. LaTeX editors will write a .pdf….Everybody will write a .pdf, but nobody has written code to write a file directly to .djvu. In my opinion, that needs changing. We need to use open standards and free/open file formats (all kinds of reasons for that discussed in this entry to this blog).

That said, today I wrote a script to convert a plain text file to DjVu (but, yes, I had to round-trip it through .pdf, darn it).
This script was written on a Debian/Stable (lenny at the time of this writing) system, on AMD64 arch, using all tools available in the lenny repos.
It requires (obvious when you read the script) enscript, ps2pdf, and pdf2djvu (part of dvjulibre).
The script first converts your text file to postscript with enscript, the from postscript to pdf, with, surprise, ps2pdf, and, then, the final step of converting to .djvu.

The script looks like this:
#!/bin/bash

if [[ $(echo $*) ]]; then
text="$*"
else
echo "try again, and include a file name, and ONLY 1 file name at a time. Thank you." && exit
fi

echo converting $text to $text.ps

enscript $text -q -B -p $text.ps

echo converting $text.ps to $text.pdf

ps2pdf $text.ps

echo converting $text.pdf to $text.djvu

pdf2djvu $text.pdf -o $text.djvu

echo renaming ...

rename.ul .txt.djvu .djvu $text.djvu

echo cleaning up ...

rm $text.ps $text.pdf

echo done

exit

I actually turned the script on itself, and created a DjVu file of this text, available here.
With this, I may very add the capacity to export a .djvu file to tcltext. Why not? It’s just a shame, imho, that such an export is not direct, without having the cross into proprietary territory via .pdf, in order to be accomplished.

Also, as a gift to my fellow freedom fighters, foss hackers, and open standards supports, I have created a DjVu of my poetry here which contains all the poems published in my recent book  (but not the paintings and photographs).

And, this full article in djvu format here.  This last was fun, because I ended up having to change the text encoding first.  Apparently enscript doesn’t like utf8. I had copy/pasted the article into tcltext, which generates utf8 here (system default).  I made a .dvju that had all these weird character substitutions (like /200a#blahblah for a quotation mark?).  Here’s how to handle the conversion.

iconv iconv -f utf8 --to-code=ascii//TRANSLIT yourfile > newfile

Now, if you use firefox or some other mozilla derivative, there’s actually a plugin for view such files in your browser, included in the djvulibre packages..  Otherwise, you’ll need a djvu viewer, such as djview or evince.

Anyway,
Enjoy.

./tony


Este artículo en español: http://www.gnewbook.org/pg/blog/tonybaldwin/read/83736/djvu-excelente-substituto-al-formato-nolibre-de-pdf-pero
Esse artigo em português: http://softwarelivre.org/tonybaldwin/blog/djvu-otimo-substituto-ao-formato-nao-livre-de-pdf-mas…

Written by tonybaldwin

January 27, 2011 at 2:06 pm

DjVu: Free alternative to PDF (and a script to convert plain text to DjVu)

with 14 comments

djview4

this article, as .djvu in djview4

First, a bit of ranting about open standards and free file formats:
Okay, you know I’m always harping about using Open Document Formats.
So, on the LibreOffice user list today there was discussion of a viable Free/Open alternative to .pdf files. After all, PDF is, indeed, a proprietary format, owned by Adobe, and it is ubiquitous, and there really should (must, perhaps), be a free, open alternative. As such, someone on the list mentioned DjVu, which, frankly, I’d never looked at before (I had heard of it, but knew not what it was). It’s a free/open file format that was initially created for scanned documents, from what I gather, and has been around since the late 80s, still maintained by the original authors, and is now used for all kinds of gro0vy stuff.
I did a bit of research, googling, apt=cache searching, and poking around. Eventually, I aptitude installed djview4 and djvulibre and experimented a little. I have drawn the conclusion that, yes, in my opinion, DjVu would be an excellent candidate to be used as, in fact, a better option for many reasons, for the purposes .pdf currently serves (a portable document format that preserves formatting, essentially). Works great.

But there IS a rather glaring drawback…
The one big drawback is, conversion tools are lacking.
One can not, for instance, simply write a DjVu file in any kind of document editor, as you can write a pdf with many different editors, web browsers, most office software, LaTeX editors, and basic text editors, such as tcltext, and, frankly, even in a command line interface.
But to create DjVu, you can only convert other files to DjVu.
Then, in general, and this is what most irritates me, it seems you have to convert from non-free formats. There are no tools, for instance, to convert directly from plain text, LaTeX (.tex), .odf (.odt), .png, or even html files to a .dvju file. What’s worse, is that all of your Free and/or open source browsers, document editors, etc., will export or print a file to .pdf, but not to .djvu. OpenOffice.org will write a .pdf. LibreOffice, and Abiword will write a .pdf. LaTeX editors will write a .pdf….Everybody will write a .pdf, but nobody has written code to write a file directly to .djvu. In my opinion, that needs changing. We need to use open standards and free/open file formats (all kinds of reasons for that discussed in this entry to this blog).

That said, today I wrote a script to convert a plain text file to DjVu (but, yes, I had to round-trip it through .pdf, darn it).
This script was written on a Debian/Stable (lenny at the time of this writing) system, on AMD64 arch, using all tools available in the lenny repos.
It requires (obvious when you read the script) enscript, ps2pdf, and pdf2djvu (part of dvjulibre).
The script first converts your text file to postscript with enscript, the from postscript to pdf, with, surprise, ps2pdf, and, then, the final step of converting to .djvu.

The script looks like this:
#!/bin/bash

#!/bin/bash

# Converting a text file to a DjVu file
# copyright © tony baldwin / tony@baldwinsoftware.com
# release according to the terms of the GNU Public License, v. 3 or later

# first, make sure you named a file. duh.

if [[ $(echo $*) ]]; then
text="$*"
else
echo "try again, and include the file name..hello!" && exit
fi

# okay, enscript like ASCII best, so let's test our file encoding
# if we have anything other than ASCII, we will convert with iconv

enc="$(file --brief --mime-encoding $text)"
echo This file is encoded as $enc

if [ $enc != us-ascii ] ; then
echo We need to convert to ascii first.
echo Converting text encoding now ...
iconv -f $enc --to-code=ascii//TRANSLIT $text > tempy
mv tempy $text
newenc="$(file --brief --mime-encoding $text)"
echo Ok, now we have $newenc encoding and can proceed with conversion to djvu ...
fi

# from here, things are fairly self-explanatory

echo converting $text to $text.ps

enscript $text -q -B -p $text.ps

echo converting $text.ps to $text.pdf

ps2pdf $text.ps

echo converting $text.pdf to $text.djvu

pdf2djvu $text.pdf -o $text.djvu

echo renaming ...

rename.ul .txt.djvu .djvu $text.djvu

echo cleaning up ...

rm $text.ps $text.pdf

echo all done

# here, we are using the variable $text, which is $filename.txt, and changing it to $filename
# so we can append .djvu and open the resulting file in djview4

ntx=${text%.*}

djview4 $ntx.djvu &

exit

# This program was written by anthony baldwin - tony@baldwinsoftware.com
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

What it’s doing? The first thing the file does is check the file encoding of the file in question. Enscript seems to play nice with ASCII, but not utf8 or some other encodings, so we’re converting to ASCII before doing anything else. Then, the script converts your text file to postscript with enscript, then from postscript to pdf, with, surprise, ps2pdf, and, then, the final step of converting to .djvu. At the end, the file cleans up the directory, removing the .ps and .pdf files. Then, it opens your file in Djview4. I have commented the script accordingly.

I actually turned the script on itself, and created a DjVu file of this text, available here.
With this, I may very add the capacity to export a .djvu file to tcltext. Why not? It’s just a shame, imho, that such an export is not direct, without having the cross into proprietary territory via .pdf, in order to be accomplished.

Also, as a gift to my fellow freedom fighters, foss hackers, and open standards supports, I have created a DjVu of my poetry here which contains all the poems published in my recent book  (but not the paintings and photographs).

And, this full article in djvu format here.  This last was fun, because I ended up having to change the text encoding first.  Apparently enscript doesn’t like utf8. I had copy/pasted the article into tcltext, which generates utf8 here (system default).  I made a .dvju that had all these weird character substitutions (like /200a#blahblah for a quotation mark?).  This is why I updated the script with the enscript text encoding conversion feature.

Now, if you use firefox or some other mozilla derivative, there’s actually a plugin for view such files in your browser, included in the djvulibre packages..  Otherwise, you’ll need a djvu viewer, such as djview or evince.

Anyway,
Enjoy.

./tony


Este artículo en español: http://www.gnewbook.org/pg/blog/tonybaldwin/read/83736/djvu-excelente-substituto-al-formato-nolibre-de-pdf-pero
Esse artigo em português: http://softwarelivre.org/tonybaldwin/blog/djvu-otimo-substituto-ao-formato-nao-livre-de-pdf-mas…

Written by tonybaldwin

January 19, 2011 at 3:43 pm