Tag : terminal

The bashrc bash configuration files

The default shell in most Linux distributions is the bash shell. Contrary to all the usability work that has been done to the GUI, the shell is most neglected area.

Current bashrc shell (shows prompt only)

Depicting a shell is not an easy task; in the screenshot above we only show the default prompt. It has the following disadvantages,

  1. It does not differentiate visually between the username and hostname.
  2. It shows the relative path only, making it difficult to realize quickly the full path for the current working directory.
  3. Cannot copy the path using the mouse by double-clicking on it. The ~ is not included in the highlighted text, that one needs to paste and add the remaining part of the path (such as /home/user/)
  4. The point of input changes position on the command line, depending on the size of the path. As you cd into directories, the point of input moves further to the right.

The bashrc project shell

This is the prompt with the bashrc project configuration files. It solves the problems described with the default configuration files found in Linux distributions.

Obviously, there are more to the shell’s configuration files than a usable prompt. For example,

  • the ability to show the partial matches when you press Tab for the first time
  • enabling the shopt options to reasonable values
  • have reasonable aliases for . .. … / –
  • adding –verbose, –interactive to basic utilities such as cp, mv, rm
  • show the exit value of an application if it is other than 0 ($?)

There is a EnhancedBash project for the Ubuntu Linux distribution which might be able to break apart and provide better default configuration files.

If you want to help and add more to the proposed configuration, visit http://github.com/simos/bashrc/

To use the bashrc shell, you need to

  1. Download the latest package from http://github.com/simos/bashrc/ (note the Download button).
  2. Extract the package, open a terminal window and enter the newly created directory.
  3. Run make install
  4. Open a new shell window. The new settings should be activated.

Playing with Git

Git is a version control system (VCS) software that is used for source code management (SCM). There are several examples of VCS software, such as CVS and SVN. What makes Git different is that it is a distributed VCS, that is, a DVCS.

Being a DVCS, when you use Git you create fully capable local repositories that can be used for offline work. When you get the files of a repository, you actually grab the full information (this makes the initial creation of local repositories out of a remote repository slower, and the repositories are bigger).

You can install git by installing the git package. You can test it by opening a terminal window, and running

git clone git://github.com/schacon/whygitisbetter.git

The files appear in a directory called whygitisbetter. In a subdirectory called .git/,git stores all the controlling information it requires to manage the local repository. When you enter the repository directory (whygitisbetter in our case), you can issue commands that will figure out what’s going on because of the info in .git/.

With git, we create local copies of repositories by cloning. If you have used CVS or SVN, this is somewhat equivalent to the checkout command. By cloning, you create a full local repository. When you checkout with CVS or SVN, you get the latest snapshot only of the source code.

What you downloaded above is the source code for the http://www.whygitisbetterthanx.com/ website. It describes the relative advantages of git compared to other VCS and DVCS systems.

Among the different sources of documentation for git, I think one of the easiest to read is the Git Community Book. It is consise and easy to follow, and it comes with video casting (videos that show different tasks, with audio guidance).

You can create local repositories on your system. If you want to have a remote repository, you can create an account at GitHub, an attractive start-up that offers 100MB free space for your git repository. Therefore, you can host your pet project on github quite easily.

GitHub combines source code management with social networking, no matter how strange that may look like. It comes with tools that allows to maintain your own copies of repositories (for example, from other github users), and helps with the communication. For example, if I create my own copy of the whygitisbetter repository and add something nice to the book, I can send a pull request (with the click of a button) to the maintainer to grab my changes!

If you have already used another SCM tool (non-distributed), it takes some time to get used to the new way of git. It is a good skill to have, and the effort should pay off quickly. There is a SVN to Git crash course available.

If you have never used an SCM, it is cool to go for git. There is nothing to unlearn, and you will get a new skill.

Git is used for the developement of the Linux kernel, the Perl language, Ruby On Rails, and others.

Cannot write Greek Polytonic in Linux

For up to date instructions for Greek and Greek Polytonic see How to type Greek, Greek Polytonic in Linux.

The following text is kept for historical purposes. Greek and Greek Polytonic now works in Linux, using the default Greek layout.

General Update: If you have Ubuntu 8.10, Fedora 10 or a similarly new distribution, then Greek Polytonic works out-of-the-box. Simply select the Greek Polytonic layout. For more information, see the recent Greek Polytonic post.

Update 3rd May 2008: If you have Ubuntu 8.04 (probably applies to other recent Linux distributions as well), you simply need to add GTK_IM_MODULE=xim to /etc/environment. Start a Terminal (Applications/Accessories/Terminal) and type the commands (the first command makes a backup copy of the configuration file, and the second opens the configuration file with administrative priviliges, so that you can edit and save):

$ gksudo cp /etc/environment /etc/environment.ORIGINAL
$ gksudo gedit /etc/environment

then append

GTK_IM_MODULE=xim

save, and restart your computer. It should work now. Try to test with the standard Text editor, found in Accessories.

In Ubuntu 8.10 (autumn 2008), it should work out of the box, just by enabling the Greek Polytonic layout.

Update 20th June 2008: If still some accents/breathings/aspirations do not work, then this is probably related to your system locale (whether it is Greek or not). It works better when it is Greek. If you are affected and you do not use the Greek locale, there is one more thing to do.

$ gksudo cp /usr/share/X11/locale/en_US.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose.ORIGINAL
$ gksudo cp /usr/share/X11/locale/el_GR.UTF-8/Compose /usr/share/X11/locale/en_US.UTF-8/Compose

The first command makes a backup copy of your original en_US Compose file (assuming you run an English locale; if in doubt, read /usr/share/X11/locale/locale.dir). The second command copies the Greek compose file over the English one. You then logout and login again.

End of updates

To write Greek Polytonic in Linux, a special file is used, which is called the compose file. There is a bit of complication here in the sense that the compose file depends on the current system locale.

To find out which compose file is active on your system, have a look at

/usr/share/X11/locale/compose.dir

Let’s assume your system locale is en_US.UTF-8 (Start Applications/Accessories/Terminal and type locale).

In the compose.dir file it says

en_US.UTF-8/Compose: en_US.UTF-8

Note that the locale is the second field. If you have a different system locale, match on the second field. Many people make a mistake here. Actually, I think be faster for the system to locate the entry if the compose.dir file was sorted by locale.

Therefore, the compose file is

/usr/share/X11/locale/en_US.UTF-8/Compose

So, what’s the problem then?

Well, for the Greek locale (el_GR.UTF-8) we have a different compose file, a compose file in which Greek Polytonic actually works ;-).

Therefore, there are numerous workarounds here to get Greek Polytonic working.

For example,

  • If you speak modern Greek, you can install the Greek locale.
  • You can edit /usr/share/X11/locale/compose.dir so that for your locale, the compose file is the Greek one, /usr/share/X11/locale/el_GR.UTF-8/Compose.
  • You can edit the Greek compose file, take the Greek Polytonic section and update the Greek Polytonic section of en_US.UTF-8/Compose.
  • You can copy the Greek compose file in your home directory under the name .XCompose. I did not try this one, and also you may be affected by this bug. (not tested)

Of course the proper solution is to update en_US.UTF-8/Compose with the updated Greek Polytonic compose sequences. There is a tendency to add the compose sequences of all languages to en_US.UTF-8/Compose, and this actually is happening now. In this respect, it would make sense to rename en_US.UTF-8/Compose into something like general/Compose.

For how long have I been using my computer?

Do you want to check how many hours you have been using your computer/laptop?

Do you want to find out if that second-hand hard disk salesman is saying the truth?

Are you about to buy a second-hand laptop that had been used only sparingly?

You can figure out what’s going on, with the help of your Linux box and the smartmontools package. Especially since I decided to keep my old hard disk that sits next to me.
Modern hard disks support a feature called Self-Monitoring, Analysis, and Reporting Technology (S.M.A.R.T.), which helps make them more reliable.

One of the data recorded by S.M.A.R.T. is the total number of hours a hard disk has been in operation. This is the S.M.A.R.T. attribute 09 called Power-On Hours (POH). When your computer is on, your hard disk is on as well, therefore you can get the total number
of hours your computer has been on. Let’s see how we put all of these in action.

You need to install the smartmontools package, available from the standard Ubuntu repositories.

  1. Start System/Administration/Synaptic Package Manager and search for smartmontools. Select the package for installation and click to Apply.
  2. Assuming your hard disk corresponds to device /dev/hda, run the command sudo smartctl –all /dev/hda on a terminal window.

You will get a long list of information and attributes. Wade through the output and notice the attribute list and the line with ID 09.
On my system it is

ID# ATTRIBUTE_NAME   …   UPDATED  WHEN_FAILED RAW_VALUE
9   Power_On_Hours     …   Always                 –                      24

Here you can see that this hard disk has been in operation for 24 hours in total. Yes, it’s a new hard disk.
If your hard disk is a bit exotic, you may see a strangely large raw value. Other manufacturers measure the time in minutes or seconds, so you need to convert accordingly.
Other information you may extra from S.M.A.R.T. include the temperature of the hard disk. The temperature has ID 194. For me it is

ID# ATTRIBUTE_NAME        …   UPDATED  WHEN_FAILED RAW_VALUE
194 Temperature_Celsius  …    Always                 –                     41

That is 41 degrees Celsius.

You can also perform self-tests on your hard disk in order to check if it is about to fail. In S.M.A.R.T. terminology there are short (1min duration) and long (30min duration) tests, and the last five results are saved in the hard disk non-volatile memory. The entry includes the number of hours the hard disk has been in operation as explained above. Therefore, when you loan a laptop to a hard working person that has to finish an essay, you can perform a test so that the current number of hours are recorded, and then perform another test when you receive it back. If you are said hard working person, leave the laptop on as much as possible.
Apparently, most USB/Firewire caddies/enclosures do not pass the S.M.A.R.T. information, therefore you cannot access the relevant attributes. You need to connect the hard disk on the IDE/SCSI/etc channel.

How to easily modify a program in your Ubuntu?

Suppose we want to change the functionality of an Ubuntu application but we do not want to go into all the trouble of finding the source code, installing in /usr/local/, breaking dependencies with original versions and so on.

Let’s change Character Map (gucharmap), and specifically change the default font size from 20pt to 14pt, so that when you start it there is more space in the character window. Currently Character Map does not offer an option to save this setting.

We get the source code of Character Map,

# apt-get source gucharmap

Then,

cd gucharmap-1.4.4/

and now we edit the file gucharmap/main.c

We know what to edit because we visited the GNOME CVS Website, at http://cvs.gnome.org/viewcvs/gucharmap/

and we examined the logs for the file http://cvs.gnome.org/viewcvs/gucharmap/gucharmap/main.c?view=log

which show that for Revision 1.69, the following change took place,

Log:

2004-02-01  Noah Levitt

* gucharmap/gucharmap-table.c: Improve square size.

* gucharmap/main.c: Increase default font size.

When we click on the link Diff to previous 1.68 of the above page, we pinpoint the change,

version 1.68, Sun Feb 1 03:46:21 2004 UTC version 1.69, Mon Feb 2 00:48:05 2004 UTC
Line 93 main (gint argc, gchar **argv)
Line 93 main (gint argc, gchar **argv)

gint default_size = PANGO_PIXELS (1.5 * pango_font_description_get_size (window->style->font_desc));

gint default_size = PANGO_PIXELS (2.0 * pango_font_description_get_size (window->style->font_desc));

The change in the multiplier (from 1.5 to 2.0) changes the font size from 15pt to 20pt.

20pt is too big for us, therefore we edit the file gucharmap/main.c and change the 2.0 to 1.4 (14pt).
At this point we can compile the package using the command line

$ dpkg-buildpackage -rfakeroot -uc -b

dpkg-buildpackage: source package is gucharmap
dpkg-buildpackage: source version is 1:1.4.4-1ubuntu1
dpkg-buildpackage: source changed by Sebastien Bacher
dpkg-buildpackage: host architecture i386
fakeroot debian/rules clean

……….

At this point it is possible that you will get an error that an essential package is missing. The above command line will name the missing files, therefore you can simply install by

# apt-get install package-name

In case you do not have the basic compiler packages, you would need to install the build-essential meta-package. Do

# apt-get install build-essential

Finally, after the dpkg-buildpackage command completes, it will create one or more .deb packages in the directory above gucharmap.

# cd ..

# ls -l *.deb

gucharmap_1.4.4-1ubuntu1_i386.deb

libgucharmap4_1.4.4-1ubuntu1_i386.deb

libgucharmap4-dev_1.4.4-1ubuntu1_i386.deb
#

You can now install them (over the original packages) by running

# dpkg -i gucharmap_1.4.4-1ubuntu1_i386.deb libgucharmap4_1.4.4-1ubuntu1_i386.deb libgucharmap4-dev_1.4.4-1ubuntu1_i386.deb

Now we start the Character Map from Applications/Accessories/ and we get the default character size of 14pt!

Is there something we should pay attention on top of this? Yes, we should investigate the GNOME Bugzilla in case there is relevant work on this issue. We visit

http://bugzilla.gnome.org/

and specifically we click on the link Browse.

There, we select the package gucharmap (how do we know that Character Map is gucharmap? We either click on Help/About in Character Map which shows the internal name, or we run ps ax at a Applications/Accessories/Terminal while Character Map is running; the name gucharmap will pop up at the end of the long list.).

gucharmap is under the Desktop heading in the Browse list; or click on this direct link of bug reports on gucharmap.
If you start perusing the gucharmap bugs list, you will notice Bug #140414, titled remember settings. This report describes a superset of the problem we tried to solve above. That is, the bug report asks to enable Character Map to use the GNOME configuration database (gconf) so that it saves/remembers the user settings. However, this specific bug report is still pending.

The correct way to solve the configuration settings issue of gucharmap is to implement what is described in Bug #140414. If you have Ubuntu 6.06, you most likely have a very recent version of the source code of gucharmap. Therefore, the differences would be rather minimal. You can give it a go and try to get the gconf functionality in place.

You compile, install and test. If it works, you can make a patch of your changes; visit another directory and download a fresh copy of the source code using the apt-get source packagename command. Rename gucharmap-1.4.4 to gucharmap-1.4.4.ORIGINAL

# mv gucharmap-1.4.4 gucharmap-1.4.4.ORIGINAL

and make sure you clean the original gucharmap-1.4.4/ directory from compiled files (enter the directory were you did the source code changes and run make clean).

Finally, create a diff file,

# diff -ur ~/tmp/gucharmap-1.4.4.ORIGINAL ~/gucharmap-1.4.4/ > remember-settings.patch

In ideal terms, it is preferable if you could produce a patch for the latest version of gucharmap. That is, the version of gucharmap you get from http://cvs.gnome.org/viewcvs/gucharmap/. By doing so, the developers will love you because they will be able to simply apply the patch and limit the burden of adding the feature. Indeed, if it is too much effort to get a build system running, you can start off with simple patches and if you feel you are doing well with it, make the extra mile to have a build system. More on this in a future post.

The return

I just arrived back home. I was flying with Ali.
The trip was quite tiring but we managed to pull through.

Rustam was really helpfull, he picked us up on time at midnight (there was an city electricity cut) and we reached the airport swiftly.

There, we waited a bit at the queue to check in. While waiting, a certain “semi-official” person came towards me and asked for my passport. For those who do not know, this is a leading question to give me your money.
I remembered Marek’s story and quickly employed the response style Who are you to ask for my passport?. He lost a bit of steam and Ali took over talking in Persian/Tajik. He said we are both Iranians and that guy lost all interest and left. 🙂

We got front row seats, overlooking the grey wall of the aircraft, just before the pilot cockpit. The window seat of the row was allocated to a Tajik cardio-surgeon (perhaps a famous one?) who was going to Moscow for a conference. He was nice and talkative.

After four hours on the air, we reached Domodedovo and proceeded to the Transit Area, the dreadful place of eternal wait. You need to wait there for several hours before actually checking in. The wait depends on the time of your connecting flight. Our connecting flight was in 10 hours.

For the uninitiated, I include some shots
Domodedovo airport Transit Area
General view of Transit Area

The tiles at the airport
Detail of the tiles. (Tile obsession? No, just read on).

Scales and drinks dispenser
View of the refreshment machine and precision scales.

One window is shattered
View of shattered window (was still like that on the incoming leg). It’s double-glazed and the outer layer is damaged but not broken, so it does not look like an emergency to fix.

Security guard
The security officer. Oh, “no photos in Transit Area”.

As seasoned Domodedovo Transit Passengers, Ali and I wrote down some tips on what to do to kill time while waiting. Ali did most of the work and also provided the cheat list.

34 things to do at Domodedovo Airport Transit Area while waiting

  1. Open a packet of baby wipes and start cleaning a difficult smudge on the floor; finish all tissues.
  2. Go to bathroom, change outfit and return. Ask where the transit area is.
  3. Make houses of cards using Demodedovo Transit information booklets. Compete with fellow passengers for tallest building. Organise competition between passengers and officers.
  4. Switch on laptop, when noticed, smile cunningly and rub palms together. Exclaim “free access!”.
  5. Take off shoes and belt while in Transit Area. When asked, reply you want to be ready for body search.
  6. Ask repeatedly where your checked-in luggage is.
  7. Enter staring contest with security officer. Hi-five fellow passengers when you win.
  8. Measure dimensions of shattered window; make estimate of cost to replace and start cookie jar fund.
  9. Sneeze near shattered window; start crying and apologise for shattering it.
  10. Weigh yourself at precision machine in the Transit Area. Make loud remarks that it does not report the correct weight.
  11. Count the number of steps at the staircase leading to transit area (15+15).
  12. Count the number of steps on elevator leading to transit area (62, 26 showing at any time).
  13. Count the number of dark blue tiles at the Transit Area (limit to those legally accessible by passengers: 60).
  14. Use every restroom in area.
  15. Annoy officers at Transit Area by walking up and down a la goose walk.
  16. Try to learn Russian by reading aloud the signs.
  17. Learn to tell the time in Russian (hint: ask security officer every ten minutes)
  18. Take a photograph of the shattered window (normally not permitted, mmm not encouraged).
  19. Persuade security officer to take photo of you at the shattered window (normally not permitted).
  20. Play hop-scotch.
  21. Close your eyes and walk in the Transit Area; avoid obstacles.
  22. Ask for help to fill in declaration forms (not required for transit passengers).
  23. Time the cleaning ladies with stopwatch. Congratulate at end in Russian.
  24. Examine suspiciously the fruit juice dispenser.
  25. Use foreign coins (not rubbles) at fruit dispenser. Complain if cans are not dispensed.
  26. Walk across Transit Area making sure you do not step on white blue tiles.
  27. Time how long the automatic escalator requires to pause; complain if anyone uses the escalator, show the direction to the stairs.
  28. Ask “Do you speak English?” to security officer. Observe expression when he says “No”.
  29. Establish the purpose of strange wire that leads to smoking station.
  30. Walk behind terminal desks; press random buttons when no one is watching.
  31. Find blind spots behind the pillars; so that the security officers or administrators cannot see you. Hide all waiting passengers in bling spots.
  32. Observe closely shattered window. Drag finger on it as if deciphering old script. Exclaim periodically “Aha!”.
  33. Locate nearer emergency exit. Time yourself how long it takes you to reach it.
  34. Sit at a check-in desk. When confronted, complain that the Internet kiosk “ate” your ten dollar bill. Demand full refund.

Creative Commons licence

Thanks to the tips, time passed swiftly and we find ourselves at Gate 7, ready to embark the plane. Alas, the security door gets stuck and cannot open. Picture here the attempt for 4 officers trying to break a rather high-security door. After 15 minutes and over 4 minutes of video footage 🙂 , they managed to open it and we embarked the plane.

Upon touchdown at London, there is an announcement that Mr Ali and Mr Simos identify themselves to the crew. This obviously spooks the fellow passengers. After a few minutes, we find out that our checked-in luggage has not been sent with this airplane. Great, 10 hours waiting and the luggage are sent in wrong plane.

All in all, FOSSTJ was an excellent experience that I’ll never forget.

iso-8859-7 ή….. utf-8;

Ασφαλώς και utf-8!

Δυστυχώς δεν έχει περάσει ακόμα το μήνυμα για προτίμηση του Unicode (κωδικοποίηση utf-8) αντί του iso-8859-7. Πριν από μερικά χρόνια υπήρχαν σημαντικές εφαρμογές που δεν μπορούσαν να απεικονίσουν αλφαριθμητικά με κωδικοποίηση utf-8, ωστόσο αυτό έχει αλλάξει και δενυπάρχει δικαιολογία μη-μετάβασης.

  1. Με την κωδικοποίηση iso-8859-7 μπορείς να απεικονίσεις μόνο
    αγγλικά και ελληνικά, με αποτέλεσμα τα διεθνή WebMail (Yahoo, Hotmail,
    κτλ) να μην είναι ποτέ σε θέση να δείξουν ελληνικά (διότι ως διεθνή δεν
    είναι σε θέση να θέσουν την ελληνική μόνο κωδικοποίηση, οπότε δεν
    θέτουν καμία!). Ίσως είναι καλύτερα κατανοητό ότι σε μια σελίδα HTML
    μπορεί να καθοριστεί μόνο μια (καθολική) κωδικοποίηση. Αυτή τη στιγμή
    το Yahoo Mail δεν καθορίζει κωδικοποίηση στις σελίδες με αποτέλεσμα να
    πρέπει να κάνετε εξωτερικές ρυθμίσεις για την εμφάνιση ελληνικών
    (View/Encoding/…). Προσπαθούν να το φτιάξουν αλλά φαίνεται ότι θα δυσκολευτούν λόγω της πολύ μεγάλης εγκατεστημένης βάσης. Η ίδια κατάσταση επικρατεί και στα Hotmail, GMX.net, κτλ. Σε
    αντίθεση, το “νέο” GMail χρησιμοποιεί utf-8 :).
  2. Τα νέα πρότυπα που βασίζονται σε XML θεωρούν ως εξ ορισμού
    κωδικοποίηση το utf-8, εκτός και αν τους καθορίσεις iso-8859-7…
    Προτιμούν utf-8 για κάποιο λόγο.
  3. Όλες οι νέες διανομές υποστηρίζουν locales utf-8, όπως και τα
    γραφικά περιβάλοντα GNOME (από 2.0+) και KDE (από ακόμα πιο παλιά).
  4. Είναι εύκολη η μετατροπή ενός αρχείου από iso-8859-7 σε utf-8 με την εντολή iconv. Απλά εκτελέστε iconv -f iso-8859-7 -t utf-8 < mygreek.txt > mygreekUTF.txt. Το ίδιο μπορεί να γίνει και σε ένα δικτυακό τόπο (iconv στα αρχεία και μετά προσθήκη <meta content=“text/html; charset=UTF-8” http-equiv=“content-type”> στην αρχή τους). Το ίδιο στο περιεχόμενο μιας βάσης (π.χ. CMS), αποτύπωση/dump της βάσης, iconv και τέλος εισαγωγή ξανά.

Αν ένα γράμμα φαίνεται σαν

  1. “…φτι…”. Γράφτηκε και στάλθηκε ως utf-8 χωρίς όμως το πρόγραμμα ηλεκτρονικής αλληλογραφίας να μπει στον κόπο να καθορίσει την κωδικοποίηση. Ο
    παραλήπτης (δηλ. το πρόγραμμά του) δεν είχε ιδέα πως να το
    αποκωδικοποιήση και εμφάνισε σε δεκαδική μορφή τους κωδικούς των
    ελληνικών χαρακτήρων. Με αναφορά στον πίνακα Unicode θα μπορούσε
    κάποιος να διαβάσει το γράμμα. Αν το πρόγραμμα του παραλήπτη έδειχνε το
    γράμμα σε “ωμή/raw” μορφή, θα μπορούσε κάποιος να αλλάξει την
    κωδικοποίηση σε utf-8 για να το δει.
  2. “..ΞΈΞ­ΞΌΞ±Ο�Ξ± Ξ±Ξ³…”, (δηλαδή “πολλά Ξ”). Σημαίνει ότι το κείμενο είναι πραγματικά σε μορφή utf-8 αλλά πρόγραμμα ηλεκ. αλληλογραφίας/φυλλομετρητής/κτλ το δείχνει ως iso-8859-7. Προσωρινή λύση, αλλάξτε κωδικοποίησε στο πρόγραμμα σε utf-8.
  3. “…¼Î±Ï„α αγορά..”, (δηλαδή “πολλά Ι και διαλυτικά/καπελάκι). Όπως παραπάνω, αλλά το δείχνει ως iso-8859-1. Προσωρινή λύση, αλλάξτε κωδικοποίησε στο πρόγραμμα σε utf-8.
  4. “…?????????….”, (δηλαδή πολλά αγγλικά ερωτηματικά). Αυτή
    είναι η χειρότερη κατάσταση μιας και το κείμενο μετατράπηκε σε μορφή
    7-bit με αποτέλεσμα να χαθεί για πάντα σημαντική πληροφορία για την
    απεικόνισή του.

Τι να κάνουμε;

  1. Ρίχνουμε μια ματιά στο πρόγραμμα ηλεκ. αλληλογραφίας μας και το
    ρυθμίζουμε να στέλνει γράμματα με την κωδικοποίηση utf-8, ακόμα και αν
    ποτέ δεν γράψουμε ελληνικά (όταν απαντάμε σε γράμμα που έχει και
    ελληνικά, με αυτόν το τρόπο τα διατηρούμε. hint: lgu). Για παράδειγμα,
    στο Mozilla Thunderbird είναι
    Εργαλεία/Επιλογές/Γραμματοσειρές/Γλώσσες/Εισερχόμενα-Εξερχόμενα και
    επιλέγουμε “Unicode (UTF-8)” και στα δύο.
  2. Ρυθμίζουμε τον εξυπηρετητή Web μας να μην καθορίζει, σώνει και
    καλά, την κωδικοποίηση σε iso-8859-7 όταν επιστρέφει σελίδες στους
    πελάτες. Για την αποφυγή παρεξηγήσεων (σε άλλους νεώτερους δικτυακούς
    τόπους), δείτε στο http://nls.hellug.gr/. Η σελίδα δείχνει σωστά τα
    ελληνικά χωρίς να χρειαστεί να αλλάξουμε κωδικοποίηση (σε iso-8859-7).
    Πως το ξέρει; Διότι ο εξυπηρετητής Web χώνει την κωδικοποίηση όταν
    επιστρέφει την κεφαλίδα. Εκτελέστε telnet nls.hellug.gr 80, έπειτα γράψτε GET / HTTP/1.0, σε νέα γραμμή γράψτε Host: nls.hellug.gr
    και πατήστε Enter δύο φορές. Θα δείτε στη κεφαλίδα το άσχημο
    iso-8859-7… Τυπικό σφάλμα όταν γράφετε τη σελίδα σε utf-8, ρυθμίζετε
    την κωδικοποίηση μέσω HTML σε UTF-8 ενώ βλέπετε ακαταλλαβίστικα με τα
    πολλά ΞΞΞ (δείτε παραπάνω).
  3. Στη μεταβλητή του Linux LANG βάζουμε el_GR.UTF-8 αντί του σκέτου el_GR. Το σκέτο σημαίνει el_GR.ISO-8859-7. Εξ ορισμού βάζει την κατάληξη .UTF-8, το κάνει για κάποιο λόγο.
  4. Σε κονσόλα (όχι xterm/konsole/gnome-terminal/…) μπορείτε να
    γράψετε/διαβάσετε ελληνικά ακολουθώντας τα του
    xhref=”http://www.ellak.gr/modules.php?op=modload&name=phpWiki&file=index&pagename=GreekWritingInLinux” mce_href=”http://www.ellak.gr/modules.php?op=modload&name=phpWiki&file=index&pagename=GreekWritingInLinux”
    title=”Γράψιμο ελληνικών στην κονσόλα του Linux”>GreekWritingInLinux.
    (Αν δεν δουλέψει με την μία, βρείτε τη λύση και κάντε την γνωστή
    (νομίζω έχει αλλάξει κάτι μικρό στο πακέτο kbd από τότε)).
  5. Σε xterm/konsole/gnome-terminal ασφαλώς επιλέξουμε μια
    γραμματοσειρά fixed που περιλαμβάνει ελληνικά (η εξ ορισμού του
    X.org/XFree86 έχει).
  6. Στο Putty καθορίζουμε στις επιλογές Window/Translation την κωδικοποίηση UTF-8.
  7. Ξεκινάμε flame στη λίστα συνδρομητών μας για το πόσο καλό είναι το utf-8 και πόσο αναχρονιστικό το iso-8859-7.

Λοιπόν;