Wednesday, December 03, 2008

Missing spell checker in claws-mail

The claws-mail delivered to this point (version 3.6.0-1) does not include spell-checking (it hasn't included libenchant, the new spell checker interface, in its compilation). There is nevertheless a working version in rawhide. To update your claws-mail properly from rawhide:

#---
yum -y \
--enablerepo=rawhide \
upgrade \
claws*
#---


This does the trick without forcing you to enable the entire rawhide.

P.S.: Bug report 474129 in fedora's bugzilla

Wednesday, November 26, 2008

[updated2] My Fedora 10 road map

- Basic system setup
-- Adjust [/etc/resolv.conf]
-- Adjust [/etc/fstab]
-- Adjust [/etc/sysconfig/network-scripts/ifcfg-eth0]

- Add repositories:
-- RPM Fusion (free)
-- RPM Fusion (non-free)
-- Adobe (flash plugin)

Note: RPM Fusion is the, guess what, fusion between Dribble, Freshrpms, and Livna repositories.

[update: remove before installing, thanks to a reader comment]
-- Remove things I do NOT like:

Here is an observation about the this step. If you are using KDE you better off not removing xine. I use Gnome, so it was never an issue for me. Please look at the useful comments left on this post. It talks for itself why it is a bad idea for KDE users to remove xine-libs. So, the safe version of the xine removal is bellow. (I still do not like it and that means that I'm still removing the front-ends but leaving the back-ends.)

--- Multimedia players that do not play divx/mp3 and stays as default for video and audio files:
#---
yum -y erase \
xine \
gxine* \
totem*
#---


--- This is REALLY annoying, it prevents mplayerplug-in from working properly:
#---
yum -y erase \
mozplugger
#---


-- Update your system:
#---
yum -y upgrade
#---


- Install additional software:
-- Multimedia:
#---
yum -y install \
mplayer \
mencoder \
live555 \
gecko-mediaplayer \
gnome-mplayer \
vlc \
grip \
flash-plugin \
AdobeReader_enu \
k3b \
k3b-extras-nonfree
#---


-- Torrent with transmission
#---
yum -y install \
transmission
#---


-- Spell-checking
#---
yum -y install \
huspell \
aspell \
gtk-spell \
aspell-en \
huspell-en
#---


--- Additional languages: German (de), Spanish (es), and Portuguese from Brazil (br)
#---
yum -y install \
aspell-de \
huspell-de \
aspell-es \
huspell-es \
aspell-br \
huspell-br
#---


-- Email with sylpheed-claws
#---
yum -y install \
bogofilter \
enchant \
enchant-aspell \
claws-mail \
claws-mail-plugins
#---



-- XMMS with its most precious plug-ins
#---
yum -y install \
xmms \
xmms-libs \
xmms-skins.noarch \
xmms-mp3 \
xmms-faad2 \
xmms-flac \
xmms-wma \
xmms-cdread \
xmms-arts \
xmms-esd \
xmms-musepack \
xmms-acme
#---


-- Pidgin, a very good IM client
#---
yum -y install \
pidgin \
pidgin-guifications \
pidgin-libnotify \
pidgin-otr \
purple-plugin_pack-pidgin \
purple-plugin_pack-pidgin-xmms
#---


-- For kernel modules
#---
yum -y install \
kernel-devel \
kernel-PAE-devel \
kernel-headers
#---


-- Nautilus plug-ins
#---
yum -y install \
nautilus-open-terminal \
nautilus-search-tool \
nautilus-flac-converter \
nautilus-extensions
#---


-- Misc
--- Diagrams and images, usually old stuff that I'm used to
#---
yum -y install \
graphviz \
dia \
gv \
xfig \
xpdf \
eog \
gnuplot \
grace
#---


--- Editors and related
#---
yum -y install \
gvim \
kile \
dictd \
diction
#---


--- My beloved spreadsheet program
#---
yum -y install \
gnumeric
#---


--- Compression related programs
#---
yum -y install \
unrar \
p7zip
#---


--- NVIDA
#---
yum -y install \
kmod-nvidia-PAE \
xorg-x11-drv-nvidia
#---

-- Note about the driver:
It messes the font resolution up (IMHO). So to keep the same aspect between the normal driver and the NVIDIA driver you need to edit the file: [/etc/X11/xorg.conf] and add the following line in the section Device:

Option "DPI" "90 x 90"

My section device looks like this:

Section "Device"
Identifier "Videocard0"
Driver "nvidia"
Option "AddARGBGLXVisuals" "True"
Option "DPI" "90 x 90"
EndSection


-- Development
--- My beloved debugging program
#---
yum -y install \
ddd
#---


--- Java support:
#---
yum -y install \
gcc-java \
java-1.6.0-openjdk \
java-1.6.0-openjdk-plugin \
java-1.6.0-openjdk-javadoc \
java-1.6.0-openjdk-src \
java-1.5.0-gcj \
java-1.5.0-gcj-devel \
java-1.5.0-gcj-javadoc \
java-1.5.0-gcj-src
#---


--- Eclipse for Java:
#---
yum -y install \
eclipse-platform \
eclipse-ecj \
eclipse-jdt \
eclipse-cvs-client \
#---


--- For SVN support:
#---
yum -y install \
rapidsvn \
eclipse-subclipse \
eclipse-subclipse-book
#---


--- For C++ development:
#---
yum -y install \
eclipse-cdt
#---


--- Mylyn plugin:
#---
yum -y install \
eclipse-mylyn \
eclipse-mylyn-ide \
eclipse-mylyn-java \
eclipse-mylyn-bugzilla \
eclipse-mylyn-trac
#---


A note on the docs, you will find them in:

/usr/share/javadoc/java-1.5.0-gcj/
/usr/share/javadoc/java-1.6.0-openjdk/


-- Update your system:
#---
yum -y upgrade
#---


- Install and setup third-part programs
-- VirtualBox/VMware
-- Skype
-- Real Player (check for the RPM version)
-- Sun Java
-- Eclipse

- Setup printers
- Backup [/etc] and [/boot/grub]
#---
tar -czf bkp-system.`/bin/date +"%Y%m%d-%H%M"`.tgz /etc /boot/grub
#---


- Some issues:
Acrobat Reader install its Firefox/Mozilla plug-in, which has a memory leak. I recommend to remove it. To do so:

#---
rm -f /usr/lib/mozilla/plugins/nppdf.so
#---


Related posts:

- C Cedilla with Gnome

Tuesday, September 16, 2008

Some PDF gadgets

Here some PDF gadgets that I came about (a friend of mine told me about them):

Scribus: an editor for PDFs, it also permits to insert new elements
Xournal: to assemble several PDFs in order to make a PDF collection (a conference proceedings for instance).

#---
yum -y install scribus xournal
#---

Webcam security programs

Recently I was looking for webcam security tools, or CCTV if you will, and bumped into Motion and ZoneMinder.

The first is more simple and works like a "home-made"/"semi-pro" tool but you need an extra effort to get it compiled in Fedora 9 (you can get an RPM version here, which did the trick for me).

The ZoneMinder is a lot complexer and has a lot of features. But the documentation (for the new version, which is already on standard Fedora distribution) is poor and did not instruct you so well. I didn't like it very much because you need Apache and MySQL, which I usually do not need. So I preferred the Motion. Just to the sake of it, to install ZoneMinder:

#---
yum -y install zoneminder httpd mysql-server
chkconfig --level 345 httpd on
chkconfig --level 345 mysqld on
chkconfig --level 345 zoneminder on
#---


You need to add, per hand, the MySQL users, passwords, and database (refer to the documentation, I got fed up with it).

As soon as I get experienced with it I will report on that.

Monday, September 15, 2008

VirtualBox do not start: KVM

Maybe it also happens to you: you try to start a virtual machine from VirtualBox and you hit an error message: "Disable KVM/VMX extensions" or something similar. The problem is: for some reason the new kernels (after 2.6.25) load some extensions. You just need to remove them. Execute the following as root:

Search for the modules:
#---
lsmod | grep kvm
#---


If there is any loaded module, unload them, in my case (respect the dependency order):
#---
rmmod kvm_intel
rmmod kvm
#---


Now try to start your machine. For me it did the trick.

Wednesday, August 13, 2008

SELinux too strong for me

About a couple of months I bought a new computer (a laptop) and until now couldn't setup like my desktop and haven't figured out why (until today).

There were 2 annoying aspects that kept me on my nerves: I couldn't set my Gnome to a different language from the system language (I like to have the system in English a for me in German). The second point that kept me pissed off was a strange SSH error "could not chdir /home/...".

For the language it is pretty straight forward:

#---
cat > $HOME/.dmrc << __END__
[Desktop]
Language=de_DE.utf8
__END__
#---


But somehow didn't work.

My other problem, SSH login was somehow cryptic for me (how could it be?!?). But today it strikes me: SELinux (I tried a local login, in the terminal, and the same error came). Somehow SELinux prevents "login" from accessing the home directory.

Anyway, the solution, which some security freaks would recommend, was to change SELinux from "ENFORCING" to "PERMISSIVE" and reboot. To do the same:

1. Edit as root: /etc/sysconfig/selinux
2. Change the SELINUX variable to:
SELINUX=permissive
3. Reboot

That's it. Now everything works just fine.

Thursday, July 24, 2008

Reader Question: Network Adapter

The question:

Anonymous has left a new comment on my post "My Fedora 9 road map":

great!

what have been changed in your /etc/sysconfig/network-scripts/ifcfg-eth0? My fedora 9 sometimes can't detect my eth0 network card, I would like to know what config have to be changed about device eth0.


Ok Anonymous, here is the deal. You have basically two main approaches for networking: by hand our by NetworkManager. I will explain both but in case you do not have any reason not use NetworkManager I recommend it (it has some drawbacks nevertheless).

For the following instructions I assume that you are logged as root.

1. Per hand:

I assume that you do not like the GUI configuration program (which is fairly decent, as root: system-config-network) so the first step is to discover what NIC (Network Interface Controller) do you have:

1.1. Which NIC I do have:

#---
lspci # looking for Ethernet
#---


or

#---
lspci | grep -y ethernet
#---


I assume that you have the driver for it (as you said it does not work sometimes). But I does not hurt searching for any "tricks" regarding your specific NIC (googling it gives you the answer).

1.2. Looking if my NIC is "online":

Sometimes the problem is not on the NIC but on "loosing" the IP. So check it out:

#---
ifconfig -a
#---


Pay attention to the output, it must list as may "real" adapters as NICs you have (loopbacks, alias, and vmware/vbox adapters are virtual).

At this point I may answer your question: do you have more than 1 NIC? If yes then your problem is probably on knowing how to name eth0 and eth1 and so on. That is a very simple problem. Take note of the MAC address of each of your NICs, choosing the number of each one and add to /etc/sysconfig/network-scripts/ifcfg-eth0 the following line:

/etc/sysconfig/network-scripts/ifcfg-eth0:

HWADDR=<the same string from ifconfig>


Repeat it for the other NICs that you may have.

1.3. Configure the rest of the parameters:

The rest is like to be configured (you said that it eventually works) but add one more line:

/etc/sysconfig/network-scripts/ifcfg-eth0:

NM_CONTROLLED=no


That prevents the NetworkManager from trying to override your configurations.

1.4. Deactivating the NetworkManager:

#---
chkconfig --level 2345 NetworkManager off
#---


1.4.1. There is another nice TUI program that I like for such configurations:

#---
ntsysv --level 2345
#---

1.5. Restart and check-out if it boots ok.

That is what I have to say to you based on your comment. If it does not work I could try to help you (but leave a comment with your email, I will not publish it so no spam :-)).

2. With NetworkManager:

The NetworkManager is a great tool if you have a standard machine or a notebook, because it really makes everything easy, specially with wireless and so on. In my notebook I use it but in my desktop at home no (it has more than 1 NIC and the NetworkManager is not that great with that, at least that is what my experience tells).

2.1. Enabling NetworkManager:

The very first step is to add the following line to your ifcfg-eth0

/etc/sysconfig/network-scripts/ifcfg-eth0:

NM_CONTROLLED=yes


Then you need to enable the service at boot time:

#---
chkconfig --level 2345 NetworkManager on
#---


That is pretty much it. Just boot up and check it out.

3. Pros and Cons from NetworkManager:

The most annoying aspect of it is that it is an on demand "almost-pre-login" service and it prevents other network dependant services to work properly at boot (ntp can not adjust the clock at boot if you use NetworkManager). That for me is not ok. But again it is not its fault. The service is designed for that and to be frankly it is better so (it will be very annoying to asked at boot time to figure it out how to connect to the hotspot of your hotel, specially if it requires to logon in a home-page and put your login data). That said it relieves the pain of configuring your network every time you are relocated (if have to travel regularly you know what I mean).

That is why I prefer to suffer some lack of service in my notebook but keep things tight under my control in my desktop (I do not carry it with me, never). But it is always up to you.

Again, if you have any question you can send me a comment with your email (I will not publish your comment with your email) and I will try to help you.

Have fun!

Friday, July 18, 2008

A note on Java and OpenJDK

This is curious, I have both Javas, Sun and OpenJDK, installed and for both I have the Firefox plugin (I forgot to remove Sun's after installing OpenJDK). The side-effect was a seemingly high CPU use some times in Firefox. I suspect that it was due to the fact that I have too many extensions that could be fighting over conflicting resources (like 2 extensions that control the behaviour of tabs, I don't know, just bad guess work). Anyway, the point is: it wasn't. Since I removed one of the plugins (Sun's) it all got normal.

So, if you have both plugins (or you forgot that you have both installed, like me) and are experiencing some high CPU use with Firefox, try removing one of them :-)

Have a nice day!

Saturday, May 31, 2008

Migrating from Firefox 2.0 to 3.0

There are some problems when migrating from Firefox 2.0 to Firefox 3.0 (in this case Firefox 3.0b5), which is the case when migrating from Fedora 8 to Fedora 9. For me it was not clear what was happening so maybe if you are experience some "weird" Firefox behaviour it might be also the case.

To keep things short:

1. Backup your bookmarks.

2. Close Firefox or kill it:
#---
killall firefox && echo done
#---


3. Remove your $HOME/.mozilla directory (or a safer measure, move it):
#---
cd $HOME
mv .mozilla .mozilla-firefox2
#---


4. Restart Firefox and start the painfully work of customising it.

Just a little history. I had had a Firefox 2.0 for a long time and when I migrated to Fedora 9 (see my road map) it also implies a migration from Firefox 2.0 to 3.0b5. The first thing, which was expected, was that my add-ons did not worked any more (compatibility issues). This was ok, I removed the deprecated add-ons and kept using the ones the worked.

The problem that first caught my attention was GMail, which was working just in the basic html mode (which sucks if you are used to the normal version). I thought that it was a problem with add-ons (so I remove every single one of them), it did not work. Then I start suspecting of Java (tried 2 Sun versions and open-java version), but it wasn't it. At the end I was suspecting some incompatibilities between Firefox and AJAX (which is what Google uses).

The very last thing, after a week or so seeking for an answer, was clearing my configuration directory. Which solved the problem. Don't ask me why, I do not know (and didn't bother to look for the answer).

The bottom line is: if you are experience some weird behaviour with Firefox, try to start fresh.

Wednesday, May 21, 2008

[updated] Encrypting partition with LUKS

This topic is far away from new and you will find a lot of tutorials on the net. But as I already said before I lack a sort of baked recipes and central point for things. So if want the originals from this baked recipes go here and here and for the official LUKS page here

So first of all what I really need to encrypt are the following partitions:

/home
/var
/etc
swap


You can simplify by encrypting everything except /boot (ok, you may also encrypt that but I do not see the point and did not try it).

The main issue about disk encryption resides in disk performance specially by removing things (which includes moving from and to file systems). So if you really need some juicy speed upped partition I recommend to have a plain ext2/ext3 partition by the end of the disk (as closer to the out border of the disk as quick things get done, it does not apply for SCSI disks).

That said, the reasons you want to encrypt swap is to ensure that no one will eventually forces an swap attack on you (forcing the system to drop some sensitive data on the swap partition and then read them out). The /var is also important because there are the system logs and if you are a not that security freak you will eventually mix things up and type your password instead of username (which will be registered in the security log). The /etc is for the sake of it (you do not need it if you keep a safe check sum of all files there and check it before turning your network connection on, hehe). The last, but not the least, your precious /home and you know why you need it (as also RIAA).

The problem with Fedora 9 out-of-the-box procedure is that it does not randomizes the disk before encrypting it (which is important but takes a lot, but a LOT of time) and it is understandable for a installation procedure. But you want security so you want to do things right. Before you start doing things keep that in mind: you need time, a lot of time. For my SATA disk in a Pentium 4 3.2GHz the speed was about 3M/s, doing the math:

1GB ~ 6min.
10GB ~ 1h
50GB ~ 4h 45min.
100GB ~ 9h 30min.
150GB ~ 14h
200GB ~ 19h
250GB ~ 24h
300GB ~ 29h
512GB ~ 2days
1TB ~ 4days

If you know a speed upped procedure, please tell me. The speed problem is not on the disk but on the random generation, so it is unlikely to change for a notebook (if you getting nervous about that).

So the procedure is the following for a data partition and swap. But first of all (and that is VERY important) copy this text in text file and save it in your root partition (I really meant /) because you will need to shutdown your X11 AND network connections.

1. Do backup of your partition, you will lost everything.

2. Really, DO a backup, you will regret it later if you don't (you can use the FlyBack)

3. Save this text on text file in "/";

4. Logout and switch to a terminal (<CONTROL>+<ALT>+<F1> should do it) and log on as root;

5. Execute the following commandos:

5.1. Runlevel 1:
#---
telinit 1
#---


5.2. Note somewhere which is the real partition that you want to encrypt:
#---
mount | grep home
#---


It should return something like: /dev/sdaXX or /dev/hdaXX

If it returns something /dev/mapper/SEC_DEV it means that your partition was previously encrypted and you will need the real device.

5.2.1. Dealing with encrypted devices:
#---
cat /etc/crypttab | grep SEC_DEV
#---


Here you should get the real partition name.

5.3. /home:
#---
fuser -mvk /home
umount /home
#---


5.4. Verify if it was really unmounted:
#---
cat /proc/mounts | grep home
#---


5.4.1. If you have a previously encrypted partition you need this step (I'm confident that you do have a safe backup):
#---
cryptsetup remove SEC_DEV
#---


Note that I do NOT included the whole path (/dev/mapper/SEC_DEV)

5.5. Fill the partition with random data (this is the point where you must be sure you have a backup):
#---
dd if=/dev/urandom of=/dev/REAL_DEV
#---


The REAL_DEV is the same from step 5.2.
Note that the above command will end with and "out of space" error, do not worry about it.

5.6. Let LUKS know about your new partition.
#---
cryptsetup --verbose --verify-passphrase luksFormat /dev/REAL_DEV
#---


5.6.1. Open it:
#---
cryptsetup luksOpen /dev/REAL_DEV SEC_DEV
#---


SEC_DEV is a string you like. Fedora standard is luks-REAL_DEV (like luks-sda6 for /dev/sda6).

5.6.2. Verify it is everything there:
#---
ls -l /dev/mapper | grep SEC_DEV
#---


5.7. Create the file system:
#---
mkfs.ext3 /dev/mapper/SEC_DEV
#---


5.8. Mount it, to check it out:
#---
mount /dev/mapper/SEC_DEV /home
df -h | grep home
#---


5.9. Edit your /etc/crypttab and include the following line:

SEC_DEV /dev/REAL_DEV none

[update]
5.10. Collect your UUID for the /etc/fstab:

NOTE: The method with cryptsetup does NOT work in reencrypted partitions, so prefer the tune2fs method.

#---
cryptsetup luksUUID /dev/REAL_DEV
#---


#---
tune2fs -l /dev/mapper/SEC_DEV | grep UUID
#---

[update]

It must throw something like: c3119452-5a93-49bb-9c91-28d75a830a18

5.10.1. Alternatively you can already throw it in your /etc/fstab (but be careful to include the two ">":
[update]
#---
tune2fs -l /dev/mapper/SEC_DEV | grep UUID >> /etc/fstab
#---

[update]

5.11. Edit your /etc/fstab to include the following line (removing any other existing line that refers to /home):

UUID=<YOUR UUID> /home ext3 defaults 1 2

or

/dev/mapper/SEC_DEV /home ext3 defaults 1 2

5.12. Verify again:
#---
umount /home
mount /home
#---


5.13. Restore SELinux contexts:
#---
/sbin/restorecon -v -R /home
#---


6. Now the swap partition, which is a little bit different:

6.1. Identifying the partition:
#---
swapon -s
#---


6.1.1. If it turns out to be an encrypted partition, follow the step 5.2.1.

6.2. Turn off the swap (unmount the partition):
#---
swapoff -a
#---


6.3. Repeat the steps 5.4.1. (if you need) and 5.5.

6.4. Let LUKS knows about the new partition:
#---
cryptsetup create SEC_DEV /dev/REAL_DEV
#---


Here you will get the UUID for this device, note it somewhere. Or use the cryptsetup method from step 5.10 (because it is NOT a data file system it is the only way and it works, but just for swap partitions).

6.5.1. Open it: (step 5.6.1)

6.5. Make it swap:
#---
mkswap /dev/mapper/SEC_DEV
#---


6.7. Edit your /etc/crypttab (step 5.9.).

6.6. Edit your /etc/fstab to include the following line:

UUID=<YOUR UUID> swap swap defaults 0 0

or

/dev/mapper/SEC_DEV swap swap defaults 0 0


6.7. Check it:
#---
swapon -a
swapon -s
#---


7. Reboot your system:
#---
shutdown -r now
#---


Your passphrase will be asked at boot time and after everything is running restore your backup.

Have fun!

Tuesday, May 20, 2008

[updated] Time Machine on Linux

If wonder about the Time Machine from MacOS X and wanted it, you can make your own using rsync but if you want something more fancier (like I do) with a GUI you should try FlyBack (if it does not work try this) which is a nicely made Python program (or should I say script) that includes all your needs for a decent backup (using, of course, rsync). Try it, it worth.

By the way I already tried other solutions like:

Unison (painfully slow)
Grsync (hard to configure, exclude list is not possible)
fwbackups (very slow)
KBackup (very slow)

And my own TAR based backup script, which I was using until I tried flyback. It is really a great backup solution for the average desktop backup needs.

By the way, the first backup is a little time consuming (for my 16GB it took about an hour or so), but the following backups are very efficient (it takes no longer then 5 minutes).

P.S.: I'm using LUKS in my partitions.

[update]
I just used a full recovery from my system (I migrated my /home to LUKS and it worked just perfect, like nothing happened).

Monday, May 19, 2008

[updated] Aplause for Fedora 9

I'm really impressed by Fedora 9 and here come one of my source of frustration on the previous versions: Java Support and Eclipse.

Until Fedora 8 I needed to install a "thrid party" (the original) Eclipse and Sun's Java to have a decent Java support. I needed to use the original Eclipse because somehow it doesn't wanted to use the Sun's Java, just Gnu Java (which wasn't compatible with Java 1.6). Now Fedora have really flexible Eclipse (3.3.2) with some useful plugins and I can use the Java version that I want. Here comes the hack: I do not need it any more because Gnu Java (ok, openjdk actually) is already Java 1.6 compatible. An amazing step forward to interoperability (at least for me). I still keep the Eclipse "third party" step in my road map, as also Sun's Java, but just because I haven't tried it long enough to discard it (but I'm using the Fedora packages now).

For those of you that want to give a shot:

[update]
Java source included:
java-1.6.0-openjdk-src
java-1.5.0-gcj-src
[update]

Java support:
#---
yum -y install \
gcc-java \
java-1.6.0-openjdk \
java-1.6.0-openjdk-plugin \
java-1.6.0-openjdk-javadoc \
java-1.6.0-openjdk-src \
java-1.5.0-gcj \
java-1.5.0-gcj-devel \
java-1.5.0-gcj-javadoc \
java-1.5.0-gcj-src
#---


Eclipse for Java:
#---
yum -y install \
eclipse-platform \
eclipse-ecj \
eclipse-jdt \
eclipse-cvs-client \
eclipse-subclipse \
eclipse-subclipse-book
#---


For C++ development:
#---
yum -y install \
eclipse-cdt
#---


Mylyn plugin:
#---
yum -y install \
eclipse-mylyn \
eclipse-mylyn-ide \
eclipse-mylyn-java \
eclipse-mylyn-bugzilla \
eclipse-mylyn-trac
#---


A note on the docs, you will find them in:

/usr/share/javadoc/java-1.5.0-gcj/
/usr/share/javadoc/java-1.6.0-openjdk/

Friday, May 16, 2008

A word about flash and Firefox 3.0

If you are using Firefox 3.0 and want to have flash support there is a broken dependency problem in the flash RPM, it does not include the libflashsupport, which is mandatory to have sound in flash.

So to install flash and have it working properly you need to:

1. Add flash repository: Adobe (flash plugin)

2. Install it, with libflashsupport:
#---
yum -y install \
flash-plugin \
libflashsupport
#---


The problem was reported here.

Wednesday, May 14, 2008

My Fedora 9 road map

- Basic system setup
-- Adjust [/etc/resolv.conf]
-- Adjust [/etc/fstab]
-- Adjust [/etc/sysconfig/network-scripts/ifcfg-eth0]

- Add repositories:
-- Freshrpms
-- Adobe (flash plugin)
-- Livna

-- Correct conflict between livna and freshrpms (in favor of freshrpms):
Edit your [/etc/yum.repos.d/livna.repo] file to look like this:

...
#mirrorlist=http://rpm.livna.org/mirrorlist-7
exclude=vlc*,mplayer,libdvbpsi*,ffmpeg*,mencoder*,x264*,lame*
enabled=1
...


-- Update your system:
#---
yum -y upgrade
#---


- Install additional software:
-- Multimedia:
#---
yum -y install \
mplayer \
mencoder \
gecko-mediaplayer \
gnome-mplayer \
vlc \
grip \
ogle \
flash-plugin \
libflashsupport \
AdobeReader_enu \
k3b \
k3b-extras-nonfree
#---


-- Torrent with transmission
#---
yum -y install \
transmission
#---


-- Email with sylpheed-claws
#---
yum -y install \
bogofilter \
claws-mail \
claws-mail-plugins
#---



-- XMMS with its most precious plug-ins
#---
yum -y install \
xmms \
xmms-libs \
xmms-skins.noarch \
xmms-mp3 \
xmms-faad2 \
xmms-flac \
xmms-wma \
xmms-cdread \
xmms-arts \
xmms-esd \
xmms-musepack \
xmms-acme
#---


-- Pidgin, a very good IM client
#---
yum -y install \
pidgin \
pidgin-encryption \
pidgin-guifications \
pidgin-libnotify \
pidgin-otr \
purple-plugin_pack-pidgin \
purple-plugin_pack-pidgin-xmms
#---


-- For kernel modules
#---
yum -y install \
kernel-devel \
kernel-headers
#---


-- Nautilus plug-ins
#---
yum -y install \
nautilus-open-terminal \
nautilus-search-tool \
nautilus-flac-converter \
nautilus-extensions
#---


-- Misc
--- Diagrams and images, usually old stuff that I'm used to
#---
yum -y install \
graphviz \
dia \
gv \
xfig \
xpdf \
eog \
gnuplot \
grace
#---


--- Editors and related
#---
yum -y install \
gvim \
kile \
dictd \
diction
#---


--- My beloved spreadsheet program
#---
yum -y install \
gnumeric
#---


--- Unrar and related programs
#---
yum -y install \
unrar \
p7zip
#---


--- My beloved debugging program
#---
yum -y install \
ddd
#---


-- Remove things I do NOT like:
--- Multimedia players that do not play divx/mp3 and stays as default for video and audio files:
#---
yum -y erase \
xine* \
totem*
#---


--- This is REALLY annoying, it prevents mplayerplug-in from working properly:
#---
yum -y erase \
mozplugger
#---


-- Update your system:
#---
yum -y upgrade
#---


- Install and setup third-part programs
-- VirtualBox/VMware
-- Skype
-- Real Player (check for the RPM version)
-- Sun Java
-- Eclipse

P.S.: For Real Player you will need to install the following package (broken dependency on Real Player RPM):

#---
yum -y install \
compat-libstdc++-33
#---


- Setup printers
- Backup [/etc] and [/boot/grub]
#---
tar -czf bkp-system.`/bin/date +"%Y%m%d-%H%M"`.tgz /etc /boot/grub
#---


- Some issues:
Acrobat Reader install its Firefox/Mozilla plug-in, which has a memory leak. I recommend to remove it. To do so:

#---
rm -f /usr/lib/mozilla/plugins/nppdf.so
#---


Related posts:

- Pidgin with multiple languages (obsolete by package purple-plugin_pack-pidgin, but not working properly)
- C Cedilla with Gnome
- Eclipse and Java from RPMs

Tuesday, April 22, 2008

There is no such thing as GPL tools or why I love GS

I had had a problem, actually my advisor, to convert a bunch of PDFs to PDFs with embedded fonts. The usual windows approach is to open every single file with Acrobat Professional and embed the fonts. But I found a solution (here). To understand why non-embedded PDFs are a problem is to figure out that for some professional printers (the ones that you find by big publishers) assumes that the PDF has the fonts embedded (so that it does not have to have them installed on the printer). But back to the solution:

INPUT=<file to convert>
OUTPUT= <font embedded file>


#---
gs \
-dSAFER \
-dNOPLATFONTS \
-dNOPAUSE \
-dBATCH \
-sDEVICE=pdfwrite \
-dPDFSETTINGS=/printer \
-dCompatibilityLevel=1.4 \
-dSubsetFonts=true \
-dEmbedAllFonts=true \
-sOutputFile=${OUTPUT} \
-f ${INPUT}
#---


I left the following options out:

-sPAPERSIZE=letter
-dMaxSubsetPct=100


You may also want to change the compatibility parameter to:

-dCompatibilityLevel=1.6

To check if the fonts are OK:

#---
pdffonts ${INPUT}
pdffonts ${OUTPUT}
#---


To check if format and such are also OK:

#---
pdfinfo ${INPUT}
pdfinfo ${OUTPUT}
#---

Wednesday, March 26, 2008

Java... what a hell?!?[2]

Following the last post about Java (here) I tell another weird Java behaviour that costed my a work day to figure it out.

//--- snippet ---//
double tst1[] = new double[]{1.0, 2.0};
double tst2[] = new double[]{1.0, 2.0};
Collection lst1 = new ArrayList();
Collection lst2 = new ArrayList();

for (double val : tst1) {
lst1.add(val);
}
for (double val : tst2) {
lst2.add(val);
}
// array version
System.out.println(tst1.hashCode());
System.out.println(tst2.hashCode());
System.out.println(tst1.hashCode() == tst2.hashCode());
System.out.println(tst1 == tst2);
// collection version
System.out.println(lst1.hashCode());
System.out.println(lst2.hashCode());
System.out.println(lst1.hashCode() == lst2.hashCode());
System.out.println(lst1 == lst2); // false
System.out.println(lst1.equals(lst2)); // true
//--- snippet ---//


Try the snippet above and you will see what I mean. I always thought that arrays would be at least hash consistent, i.e., implementing the collection specification on Java.

Once again Java had proven my intuition wrong. By the way, my output from the above snippet is the following:

//--- snippet ---//
4072869
1671711
false
false
-32504895
-32504895
true
false
true
//--- snippet ---//

Thursday, January 31, 2008

gVim revisited

In previous post (here) I gave some hints about gVim and some scripts. The first serious update is on the spell-checking area. The new Vim 7.0 already includes a spell-checker. To activate it include the following in your ~/.vimrc file: set spell spl=<lang>, where <lang> is of [en,en_gb,en_us,de,de_20], see the complete documentation for more (here) and a nice quick reference chart here, from where I got inspired to add my own contribution for spell-checking.

First you need to install the dictd package:

#---
yum -y install dictd
#---


Then you can add the following to your ~/.vimrc file:

nmap <silent> <F2> :!dict -s exact -d gcide -m <C-R><C-W><CR>
nmap <silent> <F3> :!dict -s exact -d gcide <C-R><C-W><CR>



This line makes a dict query for word where your cursor is (if you press <F2>. It is just a match against on of the available dictionaries (see: dict --help for more details). This is useful for dictionaries that are not that updated and when the Vim spell-checker says that a word does not exist you can double-check it with <F2>.

The second variant, pressing <F3>, gives you the word definition.

I hope you enjoy it!

Related posts: Some scripts.

Wednesday, January 23, 2008

Fedora Control Center: I'm impressed

I just bumped into the Gnome Control Center today and I must say I'm impressed. It is just the thing that MS Windows had had since the beginning and I sort of regretted that Linux doesn't, actually didn't. It is pretty much a polished clone from the earlier versions of MS Windows Control Panel (resembles the MS Windows 2000).

The first thing I tried was the regular stuff: sound and so on. But what really impresses me was the IPTables configuring tool (Firewall). It is really not that bad. I'm still a shell guy but that control center worths the try.

Main Menu -> System -> Preferences -> Control Center

Tuesday, January 15, 2008

[UPDATE] C Cedilla with Gnome

This problem could be perfectly overcame with a language switch to Portuguese, but I like to have my Linux in English or German and still be able to write in Portuguese, this includes the ç characters. But the default for English and German is to produce a ć instead of our beloved cedilla.

Anyway the answer I found in here and it says the following:

1. Edit the file /etc/gtk-2.0/i386-redhat-linux-gnu/gtk.immodules /etc/gtk-2.0/x86_64-redhat-linux-gnu/gtk.immodules

2. Add at the line beginning with: "cedilla" the language that you want to produce, as default, the c cedilla.

The original is:
"/usr/lib64/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa"

And I changed it to:
"/usr/lib64/gtk-2.0/2.10.0/immodules/im-cedilla.so"
"cedilla" "Cedilla" "gtk20" "/usr/share/locale" "az:ca:co:fr:gv:oc:pt:sq:tr:wa:en:de"