Posts Tagged ‘revolution’

How to convert file content encoded in windows-cp1251 charset to UTF-8 (with iconv) to be delivered properly encoded to browsing end clients

Wednesday, May 16th, 2012

windows-cp1251 bulgarian to UTF-8 / Encoding Communication Decoding Communication Funny Picture

I have a bunch of old html files all encoded in the historically obsolete Windows-cp1251. Windows-CP1251 used to be common used 7 years ago and therefore still big portions of the web content in Bulgarian / Russian Cyrillic is still transferred to the end users in this encoding.

This was just before the "UTF-8 revolution", where massively people started using UTF-8,
Well it was clear the specific national country text encoding standards will quickly be moved by to UTF-8 – Universal Encoding format which abbreviation stands for (Unicode Transformation Format).

Though UTF-8 was clear to be "the future", many web developers mostly because of their incompetency or using an old sources of learning how to writen in HTML continued to use windows-cp1251 in HTMLs. I'm even convinced, there are still developers out there who are writting websites for Bulgarian / Russian / Macedonian customers using obsolete encodings …

The smarter developers of those accustomed to windows-cp1251, KOI-8R etc. etc., were using the meta tag to specify the type of charset of the web page content with:

<meta http-equiv="content-type" content="text/html;charset=windows-cp1251">

or

<meta http-equiv="content-type" content="text/html;charset=koi-8r">

Anyhow, still many devs even didn't placed the windows-cp1251 in the head of the HTML …

The result for the system administrator is always a mess – a lot of webpages that are showing like unreadable signs and tons of unhappy customers.
As always the system administrator is considered responsible, for the programmer mistakes :). So instead of programmers fix their bad cooking, the admin has to fix it all!

One quick work around me as admin has applied to failing to display pages in Cyrillic using the Windows-cp1251 character encoding was to force windows-cp1251 as a default encoding for the whole virtualhost or Apache directory with Apache directives like:

<VirtualHost *:80>
ServerAdmin some_user@some_host.com
DocumentRoot /var/www/html
AddDefaultCharset windows-cp1251
ServerName the_host_name.com
ServerAlias www.the_host_name.com
....
....
<Directory>
AddDefaultCharset windows-cp1251
>/Directory>
</VirtualHost>

Though this mostly would, work there are some occasions, where only a particular html files from all the content served by Apache is encoded in windows-cp1251, if most of the content is already written in UTF-8, this could be a big issues as you cannot just change the UTF-8 globally to windows-cp1251, just because few pages are written in archaic encoding….
Since most of the content is displayed to the client by Apache (as prior explained) just fine, only particular htmls lets's ay single.html, single2.html etc. etc. are displayed with some question marks or some non-human readable "hieroglyphs".

Below is a screenshot from two pages returned to my browser in wrongly set htmls charset:

Improper Windows CP1251 encoding with Apache set to serve UTF-8 encoding questiomarks

Improper Windows CP1251 delivered page in UTF-8 browser view

Apache returns cp1251 in some non-UTF8 wrong encoding (webserver improperly served cyrillic encoding)

Improperly served encoding CP1251 delivered by Apache in non-utf-8 encoding

When this kind of issues occur, the only solution is to simply login to the server and use iconv command to convert all files returning unreadable content from whatever the non UTF-8 encoding is lets say in my case Bulgarian typeset of cp1251 to UTF-8

Here is how the iconv command to convert between windows-cp1251 to utf-8 the two sample files named single1.html and single2.html

server:/web# /usr/bin/iconv -f WINDOWS-1251 -t UTF-8 single1.html > single1.html.utf8
server:/web# mv single1.html single1.html.bak;
server:/web# mv single1.html.utf8 single1.html
server:/web# /usr/bin/iconv -f WINDOWS-1251 -t UTF-8 single2.html > single2.html.utf8
server:/web# mv single2.html single2.html.bak;
server:/web# mv single2.html.utf8 single2.html

I always, make copies of the original cp1251 encoded files (as you see mv single1.html single1.html.bak), because if something goes wrong with convertion I can easily revert back.

If there are 10 files with consequential numbers naming they can be converted using a short for loop, like so:

server:/web# for i $(seq 1 10); do
/usr/bin/iconv -f WINDOWS-1251 -t UTF-8 single$i.html > single$i.html.utf8;mv single$i.html single$i.html.bak
mv single$i.html.utf8 single$i.html
done

Just as earlier mentioned if single1.html, single2.html … has in the html <head>:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">

You should open, each of the files in question and wipe out the line either by hand or use sed to wipe it in one loop if it has to be done for lets say 10 files named (single{1..10})

server:/web# for i in $(seq 1 10); do
sed '/<meta http-equiv="Content-Type" content="text\/html; charset=windows-1251>/d' single$i.txt > single$i.txt.new;
mv single$i.txt single$i.txt.bak;
mv single$i.txt.new single$i.txt

Well now,

Human Modern Progression a move forward to Degression

Saturday, June 16th, 2012

I've been thinking about our modern day progression and what our "progressed" society looks like in reality.
We think we have progressed, we have built machines that serves us well (computers). We plan for a bright painless easy future day by day. This bright "perfect" society future is nothing more than the dream of communism in its complete form.

But in what sense we have actually progressed ?? Everyone who really sees what happens around us notice the big changes we experience. On the surface it looks like our life has become much easier with all this technology surrounding us. The number of computers which is said to help us to leap towards this bright future increases day by day. With this however increases the need to support technology. Suddenly it happens that the old believe that computers are just a tool to make our life earier becomes a modern day slavery. Most of the developed or under development countries people are nowdays almost full time spending in front of the computer screen on the internet. We put our lifes in the mercy of man-created computers and it has become impossible that we live or exist independetly without them.

Computers are everywhere around us starting from the work Desk, at hand with a notebook, ipad, mobile phones, cars, airplanes. There is rarely to see any technology we use which works with not some kind of primitive or advanced computer embedded ,,,
In the rise of computers as we know it computer was just a tool to help us along with the other overall thought and inventions development. Now from just being a tool to help us progress Computers become the common ground on which almost everything in life works.

I'm sure many people who started learning computer technology 15-20 years ago (like me) never imagined computers will integrate so heavily in our daily activities as they eventually did.

We use computers for the sake of planning which in "spiritual language" is predicting the future or prophecise what is about to come in the short future. In reality what we do mostly even not realizingly is to try to predict and modify the future through technology.
This concept is also existing in most sci-fi movies, made in last 60 years. Mobile phones revolution give the humanity a tool through which telepathy we've seen in so many SCI-FI is reality. The mobile phone is just a platform through which (phone calls) or better said voice telepathy has become possible. In that manner of thoughts it is obvious that Video phone calls is a voice + visual telepathy. The Skype revolution and Video and voice conferences is brought was just until recently seen on the sci-fi movies where spaceship crews communicated with other spaceship crews by using a Visual conferences like skype.

It is really hard to believe that for just few years now everyone can speak with ease with everyone else on the planet in the same way just like we've seen in the movies as some foreign abstract concept!

Now suddenly most people on earth are equipped with technology with gives them the power to do everything but it is my firm believe people are not ready to wisely use this power. Therefore instead of using this higher technology wisely technology is used mostly senseless and the more technological advancement grows and becomes more accessible to the masses the more the tendency to use the technology for shit grows.

I'm sure people who have a good knowledge on programming and how computer works are already seriously aware of this enormous problem.
Another severe problem with the raise of technology is the language slang it introduces. This tech-slang is adopted quickly all around the society and suddenly as a result the human language as we know it is seriously substituted by a vague tech words mambo-jambo words. Actually the adoption of tech buzz words in modern day society language makes a great harm for the reason communication between people becomes less descriptive and therefore harder.
In short the result of this tech slang language inside our national languages is inability for people to communicate properly. This tendency is well seen if you for example try to make a comparison between old and newer movies. The newer the movie the less meaningful it is. It is true newer ones has much more as a visual adds than the predecessor but when talking about consistency the newer films are missing this point seriously.

As newer generations are born and raised up with this newer movies and "advanced" TV and computers this people doesn't even have most of the time the opportunity to see older human taped knowledge.
Even for youngesters who have somehow a wise parents enough to teach them in a religious way or just have the "luck" to have parents with old world mindset it will be extremely hard if not impossible for this kids to understand the old knowledge, as most of their same age school / university fellows will only talk about the newer things.

Besides all this, computers as they grow needs more and more support "nurturing" so day by day more and more people has to be busy with managing and supporting tech stuff. Suddenly it is no longer clear if computers serve us or we serve them, this tendency is already somehow evident but not so clearly as it will be in the short 5 to 10 years.
Therefore we slowly but surely are moving to a society which might become "enslaved by technology". Why I say here enslaved, because if we spend our time on fixing computers and technology and working with one virtual reality (which is non-reality) in essence this means we no longer have a physical freedom in the sense it was God given.

There is no doubt computers at present appears to do us a big good, but if you think a bit strategically it is obvious this good has it's price. By adopting all this technology without questioning ourselves on how this will impact our human freedom, we build a computerized jail around us. At first this jail appears to be so wide that it seems it does not interfere with our freedom, but with the introduction of newer and newer computer technology this jail becomes narrower as to the point where it could threat our physical existence freedom.

For those who could argue my thoughs I will ask two simple questions to show you how dependent we've become on technology;;;

What was the last time you switched off your mobile for a week ?

What was the last time you didn't used computers and the internet for a week time ?

Obviously rarely we can find someone that will answer positively to this question or even the thought of switching off from this so globalized society by dropping off tech stuff for a week seems scary.

This constant connectiodness that we're day-by-day heavily exposed to is scary, because it steals little-by-little our natural freedom for seclusion / pravicy / solitude.

This freedoms, were essential and especially for Christian saints and many of the people in the Holy Bible if we read closely we will find out they have used this freedom in parts of their lives especially the seclusion to hear and understand God's will for their life.
Since technology is stealing us the freedom to seclude ourselves this means it steals our basic natural freedom to communicate with God and our natural self ,,,

The consequence of this separation from God and unification with "the world" surely will lead to spiritual blindness and lack of good foundation or higher life purpose, in other words lost path in life.

This is happening all along right in front our eyes now.
Maybe the worst thing of globalization is it doesn't unite people on a soul level but rather separates them. The unification that tech boom gives to people is in the "virtual reality" but this is not a real unification as it is unification in a media which is not real.

Yes Virtual Reality is not real, that's why it is called Virtual isn't it?
I've been thinking over all this problems more and more and I'm starting to come to conclusion that people who wish to keep their essential physical freedom need to GET OUT from this tech lie, we have lived in.
For this however more people need to first realize that;;;

1. TECHNOLOGY LEADS US NOWHERE!

2. People who want to live without technology need to organize in groups (and get used to a natural living growing food, being near to a natural springing water, taking care for each other, living in a Christian commune like – like in the old days)

Actually if we read the old testament's story of Moses escaping the upcoming flood, I believe what is about to come to us as a consequence of this out of boundaries technologization is pretty much like the old testamental flood (this should happen sooner or later).

Moses was wise enough to make himself an Ark and prepare himself for the storm. Today most people are so busy that they don't see the storm coming. I'll be glad to hear from people who has the same thinking as me and want to organize in a groups and live an old humble way of life without technology.
I'm convinced people who have realized all this tech short future bad consequences on humanity, need to have a common communication media and share their knowledge on how we can find a way to live tech free in this age. I'm curious am I the only one with such thoughts or other get into this insight too. If you have come to conclusions I did please contact me in comments. Thank you.

AEWAN – a nice advanced GNU / Linux console ASCII art text editor

Saturday, May 19th, 2012

I'm a guy fascinated by ASCII art, since the very early days I saw a piece of this awesome digital art.

As time passed and computers went to be used mostly  graphics resolution, ASCII art loose its huge popularity from the early DOS and BBS (internet primordial days).

However, this kind  of art is still higly valued by true computer geeks.
In that manner of thoughts, lately I'm researching widely on ASCII art tools and ASCII art open source tools available for Linux.
Last time I check what is available for 'ASCII job' was before 5 years time. Recently I decided to review once again and see if there are new software for doing ascii manipulations on Linux and this is how this article got born.

My attention was caught by aewan (ASCII-art Editor Without A Name), while searching for ASCII keyword description packages with:

apt-cache search ascii

Aewan project official website is on sourceforge check it out here

Here is the complete description of the Debian package:

hipo@noah:~$ apt-cache show aewan|grep -i description -A 5
Description: ASCII-art Editor Without A Name
aewan is an ASCII art editor with support for multiple layers that can be
edited individually, colors, rectangular copy and paste, and intelligent
horizontal and vertical flipping (converts '\' to '/', etc). It produces
both stand-alone art files and an easy-to-parse format for integration
into your terminal applications.

I installed it to give it a try:

noah:~# apt-get --yes install aewan
Selecting previously deselected package aewan.
(Reading database ... 388522 files and directories currently installed.)
Unpacking aewan (from .../aewan_1.0.01-3_amd64.deb) ...
Processing triggers for man-db ...
Setting up aewan (1.0.01-3) ...

aewan package provides three executable binaries:

noah:~# dpkg -L aewan|grep -i /bin/ /usr/bin/aecat
/usr/bin/aewan
/usr/bin/aemakeflic

1. aewan binary is the ascii-art editor itself

2. aecat is utility to display an aewan documents (aewan format saved files)3. aemakeflictool to produce an animation from an aewan document

Next I ran it in plain console tty  to check how it is like:

hipo@noah:~$ aewan

Below are screenshots to give you an idea how powerful aewan ASCII art editor is:

AEWAN ASCII art editor entry information screen Debian GNU / Linux shot

Aewan immediate entry screen after start up

Aewan ASCII art editor Linux showing the major functionality of aewan on Debian GNU / Linux Squeeze

Aewan ASCII art editor – all of the supported tool functions

As you can see from the shot the editor is very feature rich. I was stunned to find out it even supports layers (in ASCII!!) (w0w!). 
It even has a Layers Manager (like GIMP) 🙂

To create my first ASCII art I used the:

New

menu.

This however didn't immediately show the prompt, where I can type  the ascii characters to draw my picture. In order to be able to draw inside the editor, its necessary to open at least one layer, through using the menu:

Add Layer (defaults)

then the interactive ASCII art editor appeared.

While an ASCII art is created with the editor you can select the color of the input characters by using Drawing Color menu seen in the above screenshot.

aewan drawing color choose color Linux shot

I've played few minutes and created a sample ascii art, just to test the color and editor "look & feel", my conclusions are the editor chars drawing is awesome.

Aewan ascii art produced on my Debian GNU / Linux host

All the commands available via menus are also accessible via a shortcut key combinations:

Aewan Linux Ascii art editor quick key shortcut commands

aewan controls are just great and definitely over-shadows every other text editor I used to draw an ASCII art so far.
Once saved the ASCII art, are by default saved in a plain gzipped ascii text. You can therefore simply zcat the the saves;
Don't expect zcat to show you the ascii as they're displayed in aewan, zcat-ing it will instead  display just the stored meta data; the meta data is interpreted and displayed properly only with aecat command.

aewan aecat displaying properly previously saved ascii art picture

I've checked online for rpm builds too and such are available, so installing on Fedora, CentOS, SuSE etc. is up to downloading the right distro / hardware architecture rpm package and running:

# rpm -ivh aewan*.rpm

On the official website, there are also instructions to compile from source, Slackware users and users of other distros which doesn't have a package build should compile manually with the usual:

$ tar -zxf aewan-1.0.01.tar.gz
$ cd aewan-1.0.01
$ ./configure
$ make
$ su -c "make install"

For those inrested to make animations with aemakeflic you need to first save a multiple layers of pictures. The idea of creating ASCII art video is pretty much like the old school way to make animation "draw every scene" and movie it. Once all different scene layers of the ASCII art animation are prepared one could use  aemakeflic to export all the ASCII layers as common video.

aemakeflic has the ability to export the ASCII animation in a runnable shell script to display the animation. The other way aemakeflic can be used is to produce a picture in kind of text format showing the video whether seen with  less cmd.
Making ASCII animation takes a lot of time and effort. Since i'm too lazy and I lack the time I haven't tested this functionality. Anyways I've seen some ascii videos on telnet  to remote hosts (some past time); therefore I guess they were made using aewan and later animated with aemakeflic.

I will close this post with a nice colorful ASCII art, made with aewan (picture is taken from the project page):

Aewan Flipping Selection Screenshot
 

How to delete your linkedin account – I don’t want to be LINKED IN!

Tuesday, April 24th, 2012

I don't want to be linkedin, Linkedin is a fake and non-sense time wasting anti-social network

I've decided to delete my linkedin account as I don't see any good in constact connectiodness and being part of many "social" networks which if one thinks in deeply are not social but anti-social.

You just stay at home staring at a screen and it will be like this until the end of your days and even worser for the generations to come. Computer revolution or digital revolution is in reality huge devolutin (devil-lution)

To delete the linkedin account I used a short tutorial provided by This post

How to delete your linkedin account picture

TO reach to your Profile settings, use upper right corner of your browser and follow the menus:

Settings -> Account -> Close your account

Once, trying to delete your account, linkedin will try to manipulate you to stay in Linkedin by pushing some of your contacts, pointing how you will get disconnected from him.
I'm amazed how impudent this guys can be, actually, its not just them. If you have tried or deleted your facebook account before time you will have faced, exactly the same thing. A profile (person picture) which was recently browsed by you will be shown to you and be said you will be unable to connect with him any more. Well who cares if it is God's will we will connect again 🙂

The problem with us modern people is we're so deluded that we have started relying more on technology and human knowledge than to God. For most people who are atheists relying more on technology than on God for their lives seems reasanable However for us Christians putting more trust in technology than in Gods providence for us is sinful and deadly.
I'm starting to get the conclusion, non-technological societies are more happier than technological ones. In that sense, we the Bulgarians are blessed, because technology is not so widely spread.