complete GNU-software gentoo-laptop and lightweight programms

Posted on March 13th, 2007

Buying a new harddisk with 5400rpm for my IBM Thinkpad X31 replacing the 4200rpm one I had to decide wether simply copying it with dd or reinstalling the whole system. Just copying it is the easiest way and in fact I had _no_ problems with my gentoo installation but there are some points why I decided to make a completely fresh install:

1. I wanted to try -* USE-flags with package based flags in /etc/portage/package.use so there are only packages I really need
2. I already had every config I would need, especially kernelconfig and xorg.conf so there won’t be much configuring work needed to be done
3. experimenting a lot on the system I was quite sure there were at least some packages I wouldn’t need as I already tried running KDE, GNOME and finally Openbox without any “complete” desktop environment and crappy things like graphical login managers ;)
4. >500 packages seemed to be quite a lot on my laptop as my workstation running KDE+beryl has about 600…
5. in the end it would be save to try installing it this way because I always could just change it to my old running system as I won’t delete it on the old harddisk till the new “minimal” system is running

I won’t explain every step on my way, my aim is to present the software I found on my way to a minimal productive system without limitting the range of functions.

First thing was to change the make.conf as I like running an unstable/testing system. I haven’t experienced problems with that so I added ACCEPT_KEYWORDS=”~x86″ to it. Much more important was the next step: adding -* to the USE-flags. As I said my primary aim was setting up USE-flags on a per-package-basis via package.use. Thinking about it there are in fact some USE-flags which still can be set globally activating CPU-features like mmx oder 3dnow. As my thinkpad has a pentium-m i my USE-flags finally were:

USE=”-* mmx nls nptl nptlonly sse sse2 unicode”

Unicode and nls aren’t affecting CPU-features but I recommend setting them nontheless as Unicode support is preferable on most systems…

After installing the base gentoo system and booting it for the first time I suggest doing an “emerge -pve world” and “emerge -pve system” to see which USE-flags would be affected at the moment by the flags, as there are still no per package flags set in package.use. As I didn’t find anything special I needed except wget with ssl, the only thing I did was:

# echo “net-misc/wget ssl” >> /etc/portage/package.use

I suggest doing an emerge -ev system and world at this point for haveing a system with the useflags set enabled. After that run “emerge -av –depclean” to remove packages that aren’t needed any more.

Next step was setting up X which was quite easy already having my xorg.conf on the other harddisk :) Emerging it I needed to set some useflags in package.use as I wanted DRI. As xorg also includes dependencies like xclock and xterm or twm I wanted to get rid of that (I just don’t need it) but in the end I resigned as I didn’t want to edit ebuilds all the time and there is no other way. If you are willing to do that kind of extra work, do it, I wanted to have a running system without editing ebuilds except it was absolutely necessary.

X and GUI software

By now the only thing I did was searching for adequate software. I tried to avoid qt applications and kde/gnome apps as most of them bring in a huge amount of dependencies like kdelibs or half of the gnome package. Here is the list of programms I chose and use. Everyone should do the work it’s supposed to do quite well and till now I don’t miss a thing. I didn’t list things like firefox, thunderbird, and openoffice as they are well known and don’t produce unecessary deps. All programms are extremely lightweight and very fast and don’t lack in funcionality.

Imageviewer: mirage
PDF-reader: epdfview
Text-editor: tea
Filemanager: rox
Sysmonitor: conky
Pager: netwmpager
Terminal: urxvt
Image-editing: gimp

Additional Software:

I also think it might be useful to mention software like pypanel and xchat. Both are very nice if you like having a panel or a graphical IRC client and are lightweight and have many dependencies. One really nice programm I found on my way through portage was Gliv. It’s an imageviewer which uses opengl to render images (try it, its really nice). I liked to use it but its getting kind of slow watching pictures >1mb with the radeon7000 in my laptop so I had to switch to mirage. If your GPU is a little faster (not very hard indeed :P ) you will like it.
If you need a “full” music player you should take look at Exaile. It’s an GTK based amarok clone and quite nice. Another nice app if you need or like a graphical archiving tool is archive.

Conclusion:

I think it was a good decision making a fresh gentoo install. I have about 320 packages now and can do most things I need with my laptop. In fact I don’t miss any functionality atm. One thing I feared was setting the useflags manually could be a lot of work but it was _really_ easy. If you download the package.use you will see that it counts only about 20 entries.

For those who are interested, here are some config files I created. The package.use and rox.conf for example and screenshots of the programs. Conky and netwmpager are seen on nearly every screenshot so I didn’t make seperate ones for them:

Screenshots:

mirageepdfviewepdfviewtea-editorgimpurxvt

Here the config files:

package.use
my rox config
my Xdefaults (for urxvt)

If you are interested in the conkyrc look in the blogpost for the conkyrc ;)

Radeontool-1.5-r3 fails with linux-headers-2.6.20-r1

Posted on March 11th, 2007

## teh problem

I just tried to emerge radeontool to switch the LCD-Backlight of my Thinkpad X31 and got the following compile error:

>>> Emerging (1 of 1) app-laptop/radeontool-1.5-r3 to /
* radeontool-1.5.tar.gz MD5 ;-) … [ ok ]
* radeontool-1.5.tar.gz RMD160 ;-) … [ ok ]
* radeontool-1.5.tar.gz SHA1 ;-) … [ ok ]
* radeontool-1.5.tar.gz SHA256 ;-) … [ ok ]
* radeontool-1.5.tar.gz size ;-) … [ ok ]
* checking ebuild checksums ;-) … [ ok ]
* checking auxfile checksums ;-) … [ ok ]
* checking miscfile checksums ;-) … [ ok ]
* checking radeontool-1.5.tar.gz ;-) … [ ok ]
>>> Unpacking source…
>>> Unpacking radeontool-1.5.tar.gz to /var/tmp/portage/app-laptop/radeontool-1.5-r3/work
* Applying radeontool-1.5-mmap.patch … [ ok ]
* Applying radeontool-1.5-vga-ati.patch … [ ok ]
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/app-laptop/radeontool-1.5-r3/work/radeontool-1.5 …
i686-pc-linux-gnu-gcc -O2 -march=pentium-m -pipe -fomit-frame-pointer radeontool.c -o radeontool
radeontool.c:24:22: error: asm/page.h: No such file or directory
radeontool.c: In function ?map_devince_memory?:
radeontool.c:97: error: ?PAGE_SIZE? undeclared (first use in this function)
radeontool.c:97: error: (Each undeclared identifier is reported only once
radeontool.c:97: error: for each function it appears in.)
make: *** [radeontool] Error 1

!!! ERROR: app-laptop/radeontool-1.5-r3 failed.
Call stack:
ebuild.sh, line 1614: Called dyn_compile
ebuild.sh, line 971: Called qa_call ’src_compile’
environment, line 3040: Called src_compile
radeontool-1.5-r3.ebuild, line 35: Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at ‘/var/tmp/portage/app-laptop/radeontool-1.5-r3/temp/build.log’.

## teh solution

just do the following as root:

# ln -sf /usr/src/linux/include/asm/page.h /usr/include/asm/page.h

and it should install without problems. I already posted it to the gentoo bugtracker: http://bugs.gentoo.org/show_bug.cgi?id=170502

hf

problem starting GIMP because of dbus

Posted on March 6th, 2007
I don’t know why but I know now how to fix…

Trying to start gimp a few days ago I got the following error. As I said I don’t know the reason because I didn’t change anything but I think a new dbus version could be the actuator:

schischa@localhost ~ $ gimp
process 5567: D-Bus library appears to be incorrectly set up; failed to read machine uuid: Failed to open “/var/lib/dbus/machine-id”: No such file or directory
See the manual page for dbus-uuidgen to correct this issue.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted

run the following as root and gimp will start correctly from now on:

# dbus-uuidgen –ensure

I don’t know if other GTK apps are also affected by this error, I only noticed it starting GIMP.

Have fun :)

Proftpd with TLS/SSL, part 1.5 howto masquarade with dyndns

Posted on February 13th, 2007

In the first part of the howto I just explained how to get a proftpd deamon to run with ssl encryption. Doing this brings up a new problem for dyndns users with 24h reconnects and dynamic wan IPs. Proftpd masquarades the IP-address when it is started and not everytime a connection is made (like some other deamons) so after getting a new IP, via for example dyndns service, the deamon is still running with the old address and no encrypted connection is possible to (home)servers which get a new ip adress after reconnecting to the internet.

As there exists no implemented solution for this problem we need to find a solution by ourselves ;) Thinking about it I had two ideas.

1. restart the proftpd deamon with a cronjob at a specific time (normally a few minutes after the 24h reconnect) which should be made at the same time every day. This solution is quite poor in my opinion because just restarting the router or disconnecting the connection to the internet would lead to an unuseable ftp server.

2. using a script which checks whether the IP has changed till the last check. Putting such a script in a cron with the instruction to restart the proftpd deamon if the IP has changed should just work. The great advantage would be that it automatically restarts the deamon when the IP changes and its completely independent of any user interaction or time (like a 24h reconnect of course).

Thinking about realising it lead to a problem: I know perfectly well how to set a cron but I didn’t know how to write a skript (which would be the more ergonomic solution) but had the idea and could also think of something like sending a single ping to the hostname of the server to find out its IP-adress and checking if it changed till the last ping. After that a simple if/else should be enough to restart the server or leaving it as it is if the IP hasn’t changed.

Luckily I told SIYB about my idea and as it seemed to be quite easy to him he just coded it and it seems to work :

here is the code (change the filenames/locations as you wish or however the default locations of proftpd and your cron deamon are, the ones here are the defaults used by gentoo):

first create a new file with (all actions explained here are done with root privileges)

# nano -w /usr/local/sbin/proftpd_masquarade

and then copy the code into it (change the hostname to yours):

#!/usr/bin/tclsh

# this script will restart the proftp server if the ip of the host changes

### config ###

# your dyndns hostname
set config(host) "yourhostname.dyndns.org"

# the temporary file to store the old ip
set config(file) "/var/run/proftpdip"

### code ###

# getting ip from dyndns host
set newip [string trim [lindex [split [exec ping -c 1 $config(host)]] 2] ()]

# getting old ip or enter ip if there is no record
if {![file exists $config(file)]} {
    set fl [open $config(file) a+]; puts $fl $newip; close $fl
    set data $newip
} else {
    # get data from file
    set fl [open $config(file) r]; set data [gets $fl]; close $fl

    # erase file content and enter new ip
    set fl [open $config(file) w]; puts $fl $newip; close $fl
}

# check newip vs oldip
if {$newip == $data} {
    puts "super"
} else {
    puts "restart ftpd"
    exec /etc/init.d/proftpd restart >> /dev/null
}

Save it. As it is written in TCL you need to have TCL installed to run it with:

# tclsh /usr/local/sbin/proftpd_masquarade

Now you just have to create a cronjob to run the script every minute so just put the following in your crontab by running:

# echo “*/1 * * * * root tclsh /usr/local/sbin/proftpd_masquarade” >> /etc/crontab

Finally your proftpd deamon should work fine behind NAT with encryption and the 24h reconnect. Not so bad, heh!?

This was just planned as a short tip so its not really part 2 but 1.5. More is on its way, especially things like vhosts and performance tuning. There is also a POSIX script now, written by zhenech, to avoid the TCL dependency. It will be blogged soon.

big thx to siyb for writing the script, to zhenech and craven for correction and to teranetworks for wasting my spare-time

Getting phpMyAdmin (2.9.1.1 and newer) on gentoo to work

Posted on January 15th, 2007

by jesse

Because some guys had problems with getting phpMyAdmin to work on gentoo (e.g. can’t login), here are some tips that helped me when I was almost giving up on myself…

  • The config.inc.php has to be in the phpMyAdmin root dir
  • If you use auth_type ‘cookie’ you have to add
    $cfg['blowfish_secret'] = ‘ba17c1ec07d65003′; // use here a value of your choice
  • $cfg['Servers'][$i]['extension'] = ‘mysql’;
    $cfg['Servers'][$i]['socket'] = ‘/var/run/mysqld/mysqld.sock’;
    $cfg['Servers'][$i]['connect_type'] = ’socket’;
    would be recommended
  • also check if you can login with the controluser via the mysql command-line tool:
    $ mysql -u pma -p
  • uncomment
    # log = /var/log/mysql/mysqld.sql
    in /etc/my.cnf to get more informations in /var/log/mysql
    (useful for troubleshooting, but the file may grow fast depending on the applications using mysql
  • Nice howto if you don’t want to install it via portage (rootforum.de)

Hope that this helps someone, if you still encounter problems: feel free to comment.


design: makequick.com | modificashuns and bugfixes by jesse
bottom