Terminal Problems

Terminal as a noun from Merriam-Webster Online Dictionary:

5 : a combination of a keyboard and output device (as a video display unit) by which data can be entered into or output from a computer or electronic communications system

As posted before in “to xft or not to xft ?” my favorite terminal is mrxvt (materm) and my favorite shell is zsh. I am still having problems viewing/writing greek text on mrxvt though. So I tried using some other terminals to see what fitted more my needs.

First terminal of choice, Konsole.
Nice terminal, lots of easily configured options, ability to monitor a terminal for silence or activity and so on and so on. Greek text displayed perfectly, fonts looked quite good too. The negative part of Konsole ? It’s a KDE application and since I don’t use KDE but fluxbox, it takes a decent amount of time to start with all that ksycoca stuff that need to start before I finally view….a terminal. 2-3 seconds of wait time for a just a terminal is TOO much, and I don’t want to have kdeinit started just to speed up KDE applications. I picked up fluxbox so I wouldn’t be forced to have 10 kde/gnome daemons sitting on the background and eating up my ram.

Second terminal of choice, Gnome-Terminal.
In comparison to Konsole it’s ugly. Fewer configuration options, fewer features, but displayed greek text as good as Konsole did. It also takes a lot less time to start than Konsole does. But it’s ugly. Oh, it’s ugly too.

Third terminal of choice, rxvt.
This is supposedly the base of mrxvt and urxvt. Guess what…no xft support at all. So this goes immediatly down the drain. It only works with my good old lucida-console-8859-7…I have mrxvt for that though.
Even the project’s homepage points to sourceforge. No website no extra information…nothing. Last release:

rxvt-dev 2.7.10 March 25, 2003

Shall I say old ? deprecated ? anyway…

Then I did some tests with two greek documents. I opened my xterm with my old lucida-console-iso-8859-7 font, fired up vim and typed some greek text in 2 files. In the first I picked fileencoding=iso-8859-7 and in the second fileencoding=utf-8. What I saw was that when I executed “cat filename” I only saw the contents of the first file on any of terminals (mrxvt doesn’t count :P). All this time I thought that I was using utf-8…but I guess I didn’t. In order to make sure I found agorf on IRC and asked him to “cat” them. He is using rxvt-unicoce (urxvt) and utf-8 and he could only see the second file. I installed urxvt and then I thought that it was finally time for a change. I had already the unicode flag on my gentoo USE flags, so I only had to change the locale of LC_CTYPE from LC_CTYPE=el_GR to LC_CTYPE=el_GR.utf8
I restarted Xorg…and I could now cat and read the contents of only the second filename. I am now sure I use UTF-8 on my terminals.

Now I started checking out my terminals again.
a) mrxvt
mrxvt denied reading greek text…again (what a surprise!). It does not support utf-8.
excerpt from mrxvt.faq

Q: Does mrxvt support UTF-8 locale/encoding method?

A: Not now. This is a planned work and hopefully will be supported in the next development branch (0.5.x).

I have mrxvt 0.5.1 installed and utf-8 is still not supported.

b) Konsole
displayed utf-8 text just fine.

c) Gnome-terminal
displayed utf-8 text just fine.

d) urxvt
displayed utf-8 text just fine.

e) rxvt
You must be kidding right ? What are you looking for here ? results ? …

But then I noticed something weird. While writing (not just viewing) greek (using utf-8) on the shell my terminal dissapeared, whichever that was. But it only happened when I was logged in as a user and not as root. The difference between my user and the root account on my box, is that I use zsh as user and bash as root. So I went to zsh’s site to check out their faq. I read http://zsh.dotsrc.org/FAQ/zshfaq02.html#l16 and freaked out! Zsh can display some unicode..but zle has problems when you write unicode. DAMN! So, 2 of my favorite linux choices haven’t got proper unicode support, mrxvt and zsh. Thankfully Fluxbox recently fixed their unicode support, else that would be 3 strikes on a row…

It was time I emerged -C (that means uninstall for the non Gentoo users) Konsole, Gnome-terminal and of course rxvt. I did not need them any more. Luckilly fluxbox can provide tab support for applications so I can make up for urxvt’s lack of tabs by using fluxbox’s tab support. I am now in the process of creating a theme for urxvt that will look and behave a bit like mrxvt.

I don’t know if I am asking too much as a user or it is too soon for linux to fully adopt unicode. It looks kind of strange to me how some applications are nowdays lacking unicode support. I wonder if they’ll ever have. Maybe there are not that many non-english speaking developers for these applications to push/force/write code for/etc these applications in order to move faster implementing unicode…I don’t know what else to say.

ZSH and mrxvt developers PLEASE fix your applications as soon as possible !!!

Terminal as a adjective from Merriam-Webster Online Dictionary:

1 a : of or relating to an end, extremity, boundary, or terminus <a terminal pillar> b : growing at the end of a branch or stem <a terminal bud >
2 a : of, relating to, or occurring in a term or each term <terminal payments> b (1) : leading ultimately to death : FATAL <terminal cancer> (2) : approaching or close to death : being in the final stages of a fatal disease <a terminal patient> (3) : of or relating to patients with a terminal illness <terminal care> c : extremely or hopelessly severe <terminal boredom>
3 a : occurring at or constituting the end of a period or series : CONCLUDING <the terminal moments of life> b : not intended as preparation for further academic work <a terminal curriculum>

I think that my terminals have terminal problems…

patching grep to exclude directories from recursive search

I always wanted to be able to control which directory grep should go into and which it should not when I use the recursive (-r) option. I wanted a way to exclude some cache or other meaningless directories from it. I am using grep version 2.5.1 on gentoo linux (grep-2.5.1-r8).

I’ve just found a patch on the net that does exactly that! If you check this page: grep – Patches: patch #5051, Exclude Directories in Recursive… you can download a patch for the current grep version.

I’ll show you how to apply it on a gentoo distro. It’s really simple. I am assuming that you already use a portage overlay…say it lies inside your /usr/local/portage dir.

Lines that begin with “#” should be executed as root.
Lines that begin with “— COMMENT:” should be read and applied.


# mkdir -p /usr/local/portage/sys-apps/grep/files
# cp /usr/portage/sys-apps/grep/grep-2.5.1-r8.ebuild /usr/portage/sys-apps/grep/grep-2.5.1-r100.ebuild
# cp /usr/portage/sys-apps/grep/files/* /usr/local/portage/sys-apps/grep/files/
# vi /usr/portage/sys-apps/grep/grep-2.5.1-r100.ebuild
--- COMMENT: find the line that says KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ~ppc-macos ppc64 s390 sh sparc x86" and change it to: KEYWORDS="~x86" or your ~arch if it's another.
--- COMMENT: add this under src_unpack():
epatch “${FILESDIR}”/${PN}-2.5.1-exclude-dir.patch
# echo "=sys-apps/grep-2.5.1-r100 ~x86" >> /etc/portage/package/keywords
--- COMMENT: change ~x86 to your ~arch
--- COMMENT: download http://savannah.gnu.org/patch/download.php?file_id=9836 and save it as "grep-2.5.1-exclude-dir.patch"
# mv /path/to/grep-2.5.1-exclude-dir.patch /usr/local/portage/sys-apps/grep/files/
# cd /usr/local/portage/sys-apps/grep/
# ebuild grep-2.5.1-r100.ebuild digest
# emerge =sys-apps/grep-2.5.1-r100

and that’s it. The patch is applied cleanly (at least on ~x86) that I tried it and the result is this:

# mkdir -p ~/foo/bar
# mkdir -p ~/foo/zoo
# echo "test123" >> ~/foo/bar/test1.txt
# echo "test123" >> ~/foo/zoo/test2.txt
# cd ~/foo
# grep -r -n test123 *
bar/test1.txt:test123
zoo/test2.txt:test123
# grep -r test123 * --exclude-dir=zoo
bar/test1.txt:test123

enjoy 🙂

slogan-artwork on a wall

Another great slogan – artwork on a wall. This is from the university I study. The “bird” is it’s symbol…

rox icons + ivman continued

I have made some significant improvements to the previous rox.panelput script I had posted . It can now handle most of the previous “problems”.

a) If the device has a Label then, the icon created has the Label name. If it doen’t it has the Device Name.
If you insert a DVD with label “TEST”…the icon will have the name TEST, if you insert your usb key or your digital camera the icon will have the name of the device.

b) It handles automatic positioning of the icons.
If you insert a DVD (device 1 – icon 1) and then your usb key (device 2 – icon 2), your usb key icon will be placed below the DVD icon. If you then insert your digital camera (device 3 – icon 3) it will be placed below the usbkey. If you then remove your usb key (device 2 – icon 2) there will be left an empty spot at “place 2” and upon the insertion of a new device, a cdrom for example that device will take “place 2” (device 4 – icon 2).

c) There is a Restore feature.
If you place rox.panelput Restore inside your window manager startup file, for example fluxbox’s .fluxbox/startup, it will clean up any unused icons left on the desktop that were not ejected-removed during the previous shutdown of your window manager. Restore will NOT remove icons from your desktop that were not created by rox.panelput script. This feature is really critical because with the older script icons were left over during restarts, hogged up the desktop and had to be manually removed. Now they are removed “automagically”.

d)Locks and checks
Many locks and checks were implemented during each stage of addition or removal of a device. They might slow down the script a bit, but add a great deal of security.

The UPDATED version of rox.panelput lies here: rox.panelput v0.34

In order to use it read the previous post: create-icons-on-rox-desktop-of-automounted-media-by-ivman
(and of course gunzip the file and place it in your binaries folder)

The only change that needs to be done is that IF you want to use the restore feature (which I strongly urge you to do so) you have to put the command:
rox.panelput Restore

somewhere before your window manager starts. Here’s my .fluxbox/startup :

rm /tmp/rox-ivman-lock.tmp
/PATH/TO/rox.panelput Restore
killall -9 ivman ; ivman &
echo > /home/CHANGEME/.ivman/mounted/devices
rox -p pinboard
exec /usr/bin/fluxbox -log ~/.fluxbox/log

If you change the paths or files inside rox.panelput then it’s almost sure that you have to change these paths too.

Please report any problems and give me any possible feed back on this.

to xft or not to xft ?

My favorite terminal is mrxvt (also refered to as materm). It has tab support, it’s pretty, and very configurable.
Since I am greek…I want to be able to both read and write greek on the terminal. Until recently I used the font:
*font:-*-lucida console-medium-r-*-*-0-*-*-*-*-*-iso8859-7
for all my terminals. This font is pretty good looking but of course not as good as an xft font.

I’ve now decided to use an xft font for my mrxvt. The problem is that I can’t find an xft font to display greek chars…so I had to keep xterm with the previous mentioned lucida-console font for greek viewing purposes. I chose “DejaVu Sans Mono” as my font of choice for mrxvt…and the results are just excellent. Output is a lot easier to read and less tiring for the eyes.

Here my full .mrxvtrc:

#
# ----------------------------- TAB-BAR OPTIONS ------------------------------ #
#
Mrxvt.bottomTabbar: True
# Only show the tab bar if there is more than one tab.
Mrxvt.autohideTabbar: False
# The number of tabs to attempt to keep visible. The width of tabs will shrink
# to keep at least these many tabs visible.
Mrxvt.minVisibleTabs: 8
# Make the terminal title the same as the active tab title.
Mrxvt.syncTabTitle: True
Mrxvt.syncTabIcon: true
# Highlight inactive tabs only when they sound a bell (and not whenever they
# produce output).
Mrxvt.highlightTabOnBell: True
# Tab bar colors
Mrxvt.itabBackground: #101010
Mrxvt.tabBackground: #000000
Mrxvt.itabForeground: #909090
Mrxvt.tabForeground: #9a9a9a
#mrxvt*tabForeground: white
#mrxvt*tabBackground: grey
#mrxvt*itabForeground: grey
#mrxvt*itabBackground: darkblue
#
# ---------------------- SCROLLING / SCROLLBAR OPTIONS ----------------------- #
#
Mrxvt.scrollBar: true
Mrxvt.scrollbarRight: true
#Mrxvt.scrollbarStyle: rxvt
mrxvt*scrollbarStyle: next
# Number of lines to save in the scroll back buffer for all tabs
mrxvt*saveLines: 32767
# Don't scroll to the bottom every time some output is produced.
Mrxvt.scrollTtyOutputInhibit: true
# Scroll to the bottom when a key is pressed.
Mrxvt.scrollTtyKeypress: true
# Scroll bar colors
Mrxvt.scrollColor: #808080
Mrxvt.troughColor: #202020
# Mrxvt.scrollbarPixmap: scrollbarbg.jpg
#
# ------------------------------- TRANSPARENCY ------------------------------- #
#
# True translucency (using Xorg's composite extension).
# Mrxvt.opacity: 75
# Mrxvt.opacityDegree: 5
# Pseudo transparency. As long as you set the background using an esetroot
# compatible program (e.g. feh), then the following will work. It is pretty
# resource friendly too :).
Mrxvt.transparent: True
Mrxvt.transparentScrollbar: True
Mrxvt.transparentTabbar: True
Mrxvt.transparentMenubar: False
# Color / degree to which the root background should be tinted.
Mrxvt.tintColor: #000000
Mrxvt.shading: 10
#Mrxvt.fading: 10
#
# ---------------------------------- FONTS ----------------------------------- #
#
mrxvt*font:-*-*-*-*-*-*-*-140-*-*-*-*-iso8859-7
Mrxvt.xft: 1
#Mrxvt.xftFont: Bitstream Vera Sans Mono
Mrxvt.xftFont: DejaVu Sans Mono
Mrxvt.xftSize: 10
Mrxvt.xftAntialias: 1
# The options below are better set using ~/.fonts.config. Mrxvt will use the
# defaults passed to the fontconfig library.
#
Mrxvt.xftHinting: 1
Mrxvt.xftAutoHint: 1
Mrxvt.xftGlobalAdvance: 1
# Mrxvt.xftRGBA: rgb
# Mrxvt.xftslow: 1
# Don't load a multi-char font. This will reduce the line space if your multi
# char font has different dimensions than the regular font. You might need to
# comment it out if you want to use XIM and non-english fonts.
#Mrxvt.xftNomFont: 1
# Font to use for tab bar / menus. This need not be mono-spaced ;).
Mrxvt.xftPFont: Bitstream Vera Sans
Mrxvt.xftPSize: 10
# Shadow text
# Mrxvt.textShadow: red
# Mrxvt.textShadowMode: botright
#
# XIM input / multi char support. To use this, you should also comment out the
# xftNomFont line above.
#
# Mrxvt.xftmFont: SimSun
# Mrxvt.multichar_encoding: GB
#mrxvt.preeditType: OverTheSpot
#Mrxvt.inputMethod: SCIM
mrxvt*greek_keyboard: iso
mrxvt.multichar_encoding: el_GR
#mrxvt*greektoggle_key: VoidSymbol
mrxvt.greektoggle_key: Mode_switch
#
# ---------------------------------- CURSOR ---------------------------------- #
#
Mrxvt.cursorBlink: true
Mrxvt.cursorColor: #00ff00
Mrxvt.cursorColor2: #000000
#
# ---------------------------------- COLORS ---------------------------------- #
#
# Setup colors for a black background.
Mrxvt.background: #000000
Mrxvt.foreground: #9a9a9a
Mrxvt.color0: #000000
Mrxvt.color1: #af0000
Mrxvt.color2: #00af00
Mrxvt.color3: #afaf00
Mrxvt.color4: #0000af
Mrxvt.color5: #af00af
Mrxvt.color6: #00afaf
Mrxvt.color7: #9a9a9a
Mrxvt.color8: #5f5f5f
Mrxvt.color9: #d70000
Mrxvt.color10: #00d700
Mrxvt.color11: #d7d700
Mrxvt.color12: #0000d7
Mrxvt.color13: #d700d7
Mrxvt.color14: #00d7d7
Mrxvt.color15: #d7d7d7
# Display bold and underlined text in color, rather than using the terminal
# attributes. This makes reading man pages a little easier.
Mrxvt.colorBD: #00afaf
Mrxvt.colorUL: #00af00
# Mrxvt.colorRV: #000040
# Display the X selection as highlighted instead of using reverse video.
Mrxvt.highlightColor: #303060
# Colors when terminal window looses focus. (Does not work well with Xft).
# Mrxvt.ufBackground: yellow
Mrxvt.backgroundFade: 50
#
# ------------------------------- MISC OPTIONS ------------------------------- #
#
mrxvt*geometry: 120x45
# The value of the TERM environment variable. Default is rxvt. If you have
# trouble, try uncommenting the following line.
Mrxvt.termName: rxvt
# Default title of each tab.
#Mrxvt.tabTitle: mrxvt
Mrxvt.vt0.tabTitle: Term 1
Mrxvt.vt1.tabTitle: Term 2
Mrxvt.vt2.tabTitle: Term 3
# Border to leave around terminal text
Mrxvt.internalBorder: 2
# Make double click select whole URL's
Mrxvt.cutChars: :=/~#@?%&_-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0abcdefghijklmnopqrstuvwxyz
# Blank the mouse pointer on keystrokes or after 10 seconds of inactivity.
Mrxvt.pointerBlank: True
Mrxvt.pointerBlankDelay: 10
# Don't close the tab if the secondary screen is displayed (e.g. when running
# vim).
Mrxvt.protectSecondary: True
# Run as a login shell.
Mrxvt.loginShell: True
# Enable session management
# Mrxvt.sessionMgt: true
#
# ---------------------------- KEYBOARD SHORTCUTS ---------------------------- #
#
Mrxvt.macro.Shift+Left: GotoTab -1
Mrxvt.macro.Shift+Right: GotoTab +1

And here’s how it looks like:

Well…It looks pretty nice to me…Here you can see 2 tabs (one running top at the background and the current one with a cat .mrtxvtrc output), how the highlighting works (instead of just reverse video), and that I am a zsh lover 🙂

And here comes the question : Is there any xft compatible, Mono font that can display greek characters at terminals ? If so…WHICH ?

Anyway…if you think you have a better .mrxvtrc that I might like…can you post it ?

Wireless Community Networks at their best

I am back in my hometown, Thessaloniki, for about a week and I carried with me the old laptop that I had tried installing the rule project
I had nothing to do tonight..so I plugged in my wireless card, booted Damn Small Linux CD and went out to the balcony. Why not try to check if there are any wireless networks around ? In fact there was one:

root@ttyp2[root]# iwlist ath0 scan
ath0 Scan completed :
Cell 01 - Address: 00:30:4F:4B:66:6C
Mode:Master
Encryption key:off
Quality:17/94 Signal level:-78 dBm Noise level:-95 dBm
Mode:Master
ESSID:"nkoumle"
Frequency:2.412GHz
Bit Rate:1Mb/s
Bit Rate:2Mb/s
Bit Rate:5Mb/s
Bit Rate:11Mb/s

I connected there..and ran the dhcp client…

root@ttyp2[root]# iwconfig ath0 essid nkoumle
root@ttyp2[root]# pump -i ath0

Drums rolling….ta ta!!

root@ttyp2[root]# ifconfig ath0
ath0 Link encap:Ethernet HWaddr 00:20:A6:4C:BD:7F
inet addr:10.103.5.61 Bcast:10.103.5.63 Mask:255.255.255.192
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

The IP seemed quite weird to be from a home…and looked like it was from the range that Thessaloniki Wireless Metropolitan Network (TWMN) was given a few years ago, when each greek major city was given an IP range for their Wireless Networks inside the 10.0.0.0/8 range. Pinging the router/AP gave me results of 10-100ms. I tried finding a spot in the balcony where I could get more stable ping times but I couldn’t find one. It didn’t really matter though…I was so excited that a few msecs wouldn’t stop me!
Even though I could resolve internet hostnames and addresses I couldn’t ping or browse any internet hosts. Then I tried surfing around TWMN. I opened up http://www.twmn and I looked around. I tried to register with their forums but I couldn’t because they require a confirmation email. Since I can’t access any of my email accounts without internet access I can’t register in their wireless forum either. The bad thing is that it’s not even readable as a wireless guest.
I knew that TWMN and Athens Wireless Metropolitan Network (AWMN) are linked together, so I tried surfing http://www.awmn. Success!! Everything worked quite smoothly there. I even sent a pm to a TWMN user that I know, orion, from AWMN’s forum.
Then it was time for IRC. Damn Small Linux features a tiny irc client named “naim”. I tried to connect to irc.twmn…but there was no luck. Then I tried irc.awmn and I got instantly connected.
I had also heard about AWMN’s proxy mesh network. It’s an effort by many awmn users that share their dsl bandwith by creating a squid proxy mesh network with lots siblings, so there is some kind of load balancing. I started reading the last pages of the thread but I couldn’t find any working proxies. Then I remembered that it was koki that started it all…and looked for her website inside awmn. I came up to http://koko.awmn and there she had information about how to connect to her proxy.
So I entered 10.20.220.2 port 3128 at my firefox preferences…and that was it!!! SUCCESS! I had full access to websites through koki’s proxy server. I am in Thessaloniki and my “internet provider” is 500km away…in Athens!
Here’s the traceroute to her proxy server:

root@ttyp0[root]# traceroute 10.20.220.2
traceroute to 10.20.220.2 (10.20.220.2), 30 hops max, 40 byte packets
1 ap.nkoumle.twmn (10.103.5.1) 526.158 ms 151.747 ms *
2 doom2nkoumle.bb.twmn (10.122.255.177) 143.23 ms 368.749 ms 130.249 ms
3 taz2doom.bb.twmn (10.107.255.81) 13.83 ms 60.137 ms 317.052 ms
4 uom2taz.bb.twmn (10.107.255.57) 32.055 ms 14.761 ms 64.038 ms
5 volto2uom.bb.twmn (10.107.255.33) 82.341 ms 78.228 ms 49.779 ms
6 sourdos2volto.bb.twmn (10.107.255.49) 83.058 ms 61.406 ms 72.943 ms
7 dfragos2sourdos.bb.twmn (10.107.255.2) 81.377 ms 41.603 ms 101.131 ms
8 thmmy2dfragos.bb.twmn (10.106.255.254) 200.073 ms 105.749 ms *
9 thmmy.swn (10.106.3.1) 65.299 ms 132.49 ms 361.869 ms
10 10.17.122.158 (10.17.122.158) 529.931 ms 368.65 ms 313.583 ms
11 10.17.122.131 (10.17.122.131) 417.191 ms 74.76 ms 48.881 ms
12 10.17.122.129 (10.17.122.129) 64.119 ms 84.001 ms 79.828 ms
13 10.17.122.169 (10.17.122.169) 82.863 ms 41.323 ms 93.686 ms
14 10.80.190.121 (10.80.190.121) 87.61 ms 68.538 ms 90.206 ms
15 10.26.35.181 (10.26.35.181) 132.605 ms 343.975 ms 120.142 ms
16 10.26.35.54 (10.26.35.54) 134.826 ms 105.009 ms 128.925 ms
17 10.20.220.74 (10.20.220.74) 79.456 ms 89.032 ms 196.706 ms
18 10.20.220.2 (10.20.220.2) 144.206 ms 150.446 ms 103.555 ms

I am actually posting this entry for this insane connection!

This is really inspiring. Community networks at their best. Thanks a lot to everyone that contributed in order for this to happen. Thanks a lot to nkoumle (whom I don’t know) and to koki (that I only know her though IRC and forums)…

Create icons on rox desktop of automounted media by ivman

This post has been updated! Please read this one too: rox icons + ivman continued

Whenever some people looked at my desktop they always mocked me for some of the features that were missing from fluxbox + rox and were present in the big WM like Gnome or KDE. One of those “neat” features is the automounting of cd-rom/dvd disks or usb flash drives and the appearance of an icon of those on the desktop.
I stared reading the Gentoo Wiki and the Gentoo forums on the subject. I came up with these 2 pages:
HOWTO_ivman on and automount add icons desktop dynamically ivman+rox. Following the Gentoo wiki guide I was able to easily install ivman and hal and configure the local users to be able to mount unknown devices automatically. So the first part was really easy. Then it was time to make rox appear a new icon on the desktop every time a new media is found.
I first tried to follow the gentoo forum post, to make rox appear icons on the desktop with every new media but it didn’t quite satisfy me. I faced various problems with the scripts posted there mostly about media without volume.label and about cds/dvds that got ejected but their icon was never removed from the desktop. My search for a more elegant solution than trying to fix those scripts continued and I ran into this page on the RoxWiki: Hints And Tips/HAL.
That post involved some patching of hal, but I wasn’t willing to do that. Instead I tried to make the scripts posted there without patching. And indeed I succeded.
Follow these steps to “reproduce”:
1) create a shell script named rox.panelput with the following contents: THERE IS A NEWER VERSION OF THIS SCRIPT —> rox icons + ivman continued

#!/bin/sh
### Change "Top" below to the panel you want your devices on...
rox --RPC << EOF
<?xml version="1.0"?>
<env :Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
</env><env :Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
<pinboard$1>
<path>$2</path>
<x>20</x>
<y>50</y>
<label>$2</label>
</pinboard>
</env>
EOF

2) Become root and make it executable and move it to /usr/bin/:
chmox +x rox.panelput ; mv rox.panelput /usr/bin

3) Edit .ivman/IvmConfigProperties.xml and paste the following inside there:

<ivm:Match name="ivm.mountable" value="true">
<ivm:Property name="hal.volume.is_mounted">
<ivm:Action value="true" exec='rox.panelput Add "$hal.volume.mount_point$"' />
<ivm:Action value="false" exec='rox.panelput Remove "$hal.volume.mount_point$"' />
</ivm:Property>
</ivm:Match>

4) As root again rename your /usr/bin/eject to /usr/bin/eject.old and create a new shell script named eject
mv /usr/bin/eject /usr/bin/eject.old

#!/bin/bash
rox.panelput Remove $1; eject.old $1

This is needed because we did not patch hal. What the patch would do to hal is make it not forget the “volume.mount_point” after a device removal. That would cause ivman to succeed when it would try to rox.panelput Remove “$hal.volume.mount_point$”. That’s not the case without the patch though. After a device is removed from the system hal does not know anymore which was the $hal.volume.mount_point$ so the icon never gets removed from the rox desktop. But since I use as label the path of the device, I can remove the device and icon together with that custom script. It a really simple hack, not an ellegant one, but it works.

5) restart ivman as user and watch rox add icons to your desktop.

It should look like this:

Pros:
1) Fast and easy way to have icons of media on your rox desktop
Cons:
1) Does not diplay the volume.label of a media but just the mount point
2) Does not automatically position new icons one below the other. If you insert 2 media, the last icon will fall on top of the previous one.

Improvements for the future:
1) Automatic placement of the icons one below the other
In oder to do so I will have to count how many icons have already been created on the desktop and store them in a temp file.

2) Icons should have volume.label as their label and not the mount point
It’s easy to do it for media that do have a label, but what about the ones that don’t ? eg my dicicam Olympus C-70z does not have a volume label. Maybe an “Unknown Device” would be the solution there…but then I will lose the functionality of my custom “eject” script…I’ll have to look into it.

3) Make icons be different according to media type (usb flash/cdrom/dvd/etc)

In a few words…I have to make it behave like the user from the gentoo forum wanted his scripts to behave…

Politicians may forget, we don’t

Mr. Christos Berelis, a minister in the previous Government wrote an article in a newspaper criticizing the current Government over it’s agreement-contract with Microsoft and for it’s lack of open-source use inside the Government. The article (in Greek) is called “On Microsoft’s Tank” (my own translation), and it’s posted here Berelis’ article.

Mr. Berelis probably “forgets” what the government signed with microsoft when HE was a minister. Did he write any articles back then criticizing that agreement? Of course not! Here’s the agreement: Greek Government Announces Strategic Cooperation with Microsoft for the Security of IT systems. What’s even worse is that the agreement of Mr. Berelis’ Government regards Security. An IT section where microsoft has admitted is way behind it’s competitors.

Enough with lies. Face the reality and admit your mistakes. If you want to criticize the current government you MUST first criticize yours and accept your mistakes and apologize for them. Until then you are just trying to harvest some lazy voters Mr. Berelis. ENOUGH.

Old post about this: Linux in Europe vs Greece

Cedega Warcraft III 1.20e nocd patch

Following a previous post of mine Warcraft 3 on linux
The latest warcraft III patch (1.20e) did not work with the old nocd 1.20c crack I had…

Follow these steps if you have the same problem….

0) Get/buy the latest cedega. It’s worth it if you play games on Linux.

1) Replace your old war3.exe with the original war3.exe from your last patch (you haven’t deleted it, have you ?)
2) Download http://ftp.blizzard.com/pub/war3x/patches/pc/War3TFT_120c_to_120d_English.exe and http://ftp.blizzard.com/pub/war3x/patches/pc/War3TFT_120d_120e_English.exe
3) Create a shortcut for the updater executables
4) Run each updater once.
5) Get this nocd crack: WARCRAFT.3.V1.20E.ENG.HELLKILLER.NOCD.ZIP
6) extract files in your game dir
7) Play 🙂

Tested with pvpgn too 🙂

*UPDATE*
Some changes have been made to eurobattle.net, so in order to play you have to apply this patch as well:
http://eurobattle.xhost.ro/w3battle_120e.rar
to execute it under cedega just create a new shortcut that points to the .exe file that you get after you extract the .rar file…

enjoy…

Gentoo woes

Today xorg 7.0 became stable in Gentoo, so I decided to upgrade to it.
Maybe it was my fault but I thought I did not need to do anything specific apart from removing the old blocking xorg and installing the new one…WRONG! DON’T DO IT!!.
You NEED to read this: http://gentoo-wiki.com/HOWTO_Modular_Xorg and this: http://www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml before proceeding.
Else you’ll end up like me with a LOT of unwanted packages/drivers that the new xorg brings. I only took notice of that halfway through, when the portage was trying to install the wacom tablet driver ?!?!?!
Then I had to remove all the previous packages that the latest emerge process had installed on my system. Luckilly I had made a script about a month ago that reports the last emerged packages and lets you remove them. So with one command I was back to the beggining where I had just unmerged xorg 6.8.
Then it was time to do it the right way like the HOWTOs say. It’s the first time that a stable package in Gentoo required from me to do specific stuff before starting. IMHO the gentoo devs missed a spot here. Since this was supposed to be a simple upgrade of a stable package, if there was the need of making changes to config files before starting, there should have been a HUUUUUUUUUUUUUGE banner before pressing anything to get the process started. Oh and btw, emerge -uDavt world won’t get you very long in the upgrade process. There are at least 2-3 packages that must be installed before others if you do a world update. So STICK to the HOWTO and do a emerge -DuNv xorg-x11

So you think that everything will now work smoothly ? NOT!
1) First thing I noticed was that I had to manually make a couple of changes inside xorg.conf. Specifically change the old RgbPath and ModulePath to these 2 lines below:

RgbPath "/usr/share/X11/rgb"
ModulePath "/usr/lib/xorg/modules"

2) Install a newer ati driver. 8.26.18 works fine for me until now and does not have the black screen problem after Xorg logoff, which many older drivers used to.

3) For an unknown reason my .Xmodmap stopped from being read. I now moved all the previous commands I had inside there to .xinitrc.

xmodmap /home/foo/.Xmodmap

4) Some of my fonts were missing or did not display properly. Rox-filer could not read greek chars and I could not write greek to the console any more. I had to read these 2 great documents to fix them: http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts , http://forums.gentoo.org/viewtopic.php?t=23575 .

5) Some minor problems I faced during the “recovery from xorg 7 upgrade process” were due to either my config files being a bit messed up after using Gentoo as a desktop for almost 2 years now (and doing an awfull great number of things without getting advice from the proper guides), or from my rush to finish as fast as possible that lead me into doing even more stupid stuff than Gentoo had.

Gentoo moto: You CAN’T get bored!

Netmod MSN setting through a regular phone

Today I had a visit from an OTE technician at home. He came to replace my old netmod which had a failling power supply. I asked him if I could set up MSN (Multiple Subscriber Number) on analog ports of the netmod without using Netmod Confiuration Manager. He was very polite to explain it to me and here comes the answers he gave me:

Netmod can set up MSN in Analog Port 1(AB1), Analog Port 2(AB2) and DTE.
To clear any previous numbers set for AB1 press the following (on a phone connected to that port): **91*#, for AB2: **92*# and for DTE: **93*#

To store MSN 1234567890 for AB1 press: **91*1234567890#, for AB2 **92*1234567890# and for DTE: **93*1234567890#

Combine these to suit your needs. All that stuff is nothing new…I just didn’t know it, possibly because I had not read the netmod user manual. A guide in greek for all that stuff is here: http://www.ote.gr/oteweb/greek/ccare/info_isdn.htm

Change gtk theme in Gentoo even if not using Gnome

Do your friends make fun of you because their “gtk apps look better” ? How many times have you heard about that damn “clearlooks theme“. Time for revenge then!

Just emerge gtk-theme-switch and run switch2 on the command line. Select your favorite theme…restart your gtk apps…and enjoy! Now can have that damn “clearlooks theme” too. 🙂

After you’ve finished you can emerge -C gtk-theme-switch

Btw, if you are looking for some nice fluxbox themes have a look at boxwhore

Fixing openoffice crash with font drop down menu

Lately my openoffice installation suffered from severe crashes. Anytime I wanted to pick a font from the drop down menu it crashed. It didn’t matter if it was oowriter2 or oocalc2 or whatever, it just crashed. I dedided that today was the day to fix this, so I started checking how OpenOffice reads the fonts of the system and created its font menu.

My first thought was that it read the fonts from my xorf.conf. So I started messing up with those. I ended up by cleaning some fontpaths I did not use any more but that was no fix for OpenOffice. Then it was time to start cleaning up the fontpaths that I had kept. My /usr/share/fonts/TTF/ dir was kinda large…so I started moving fonts from that dir to another named /usr/share/fonts/TTF-old/ and tried to keep inside /usr/share/fonts/TTF/ only the fonts I thought were good enough to keep. After a few X server restarts…the problem was gone. No more crashes.

But there was something weird going on at the same time. My xorg.conf only included the /usr/share/fonts/TTF/ fontpath and not /usr/share/fonts/TTF-old/, still though some fonts from /usr/share/fonts/TTF-old/ appeared inside the ooffice2 font drop-down menu. I started searching around and found that /etc/fonts/fonts.conf included the whole /usr/share/fonts/ path. That meant that many applications read the fonts from /usr/share/fonts/TTF-old/ too!
I removed /usr/share/fonts/ path from fonts.conf and replaced it with the fontpaths I use in xorg.conf too.

The result ? Everything works smoothly now. I can even see (or imagine) a small perfomance gain in some applications now that I don’t have that many fonts loaded.

Simplified popup of current song playing in xmms

In a previous post of mine I described how to use gtkdialog to display a nice popup of the current song playing in xmms. Well…there is a faster way to do it..and here it is:

xmessage -center -buttons ok:0 -default ok `xmmsctrl print "%T (%m of %M)%n"`

xmessage is an small application that comes with your xorg. So no extra packages are required.

It is kinda ugly…but still does the job. Choose whatever you prefer.

Πώς να μην πληρώνετε ΕΡΤ στο λογαριασμο της ΔΕΗ αν δεν θέλετε

Μια αρκετά ενδιαφέρουσα κίνηση -> ΕΡΤ και ΔΕΗ. Πως μπορείτε να μην πληρώνετε αναγκαστικά.

Με ενδιαφέρει αρκετά μιας και δεν έχω τηλεόραση και ούτε θέλω να έχω. Ακόμα και να είχα, γιατί να πληρώνω για την ΕΡΤ παραπάνω χρήματα αφού και στα κρατικά κανάλια υπάρχουν πλέον διαφημίσεις ? Ας υπάρξει φόρος ανά τηλεόραση όπως σε άλλες χώρες, για όποιους διαθέτουν τηλεόραση.

Θα περιμένω να δω πως κινούνται οι διαδικασίες των υπολοίπων και αν δεν αντιμετωπίσουν πρόβλημα με την γραφειοκρατία, θα προχωρήσω και εγώ σε αντίστοιχη κίνηση.

Αυτό είναι και το πρώτο μου post στα Ελληνικά…