Showing posts with label fedora8. Show all posts
Showing posts with label fedora8. Show all posts

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"

Tuesday, December 04, 2007

[update] Convert .ape to .flac

There is a new audio format around: the monkey's audio codec or file. To make the conversion you will need the shntools (RPM) and MAC (RPM). Notice that both RPMs are for Fedora 7, but they work. If found a Fedora 8 version, please let me know. This document is a customized version from other two documents: this and this.

- Set some variables:

CUE_FILE=<full path name to the CUE file>

#---
# assuming that the APE/FLAC file has the same name as the CUE file
APE_FILE="`basename \"${CUE_FILE}\" .cue`.ape"
WAV_FILE="`basename \"${CUE_FILE}\" .cue`.wav"
FLAC_FILE="`basename \"${CUE_FILE}\" .cue`.flac"
#---


- Convert APE file to WAV and to FLAC (if instead of an APE file it is a FLAC file you should skip this step):

#---
mac "${APE_FILE}" "${WAV_FILE}" -d
flac --best "${WAV_FILE}" "${FLAC_FILE}"
rm -f "${WAV_FILE}"
#---


- Break and convert to flac:

#---
cuebreakpoints "${CUE_FILE}" | shnsplit -o flac "${FLAC_FILE}"
#---


- Rename single tracks into music names, based on CUE file:

[UPDATE]
This script does NOT check character set validity. It means that it may not work for some particular case (or the general case in some languages). A simple example would be a CUE file in French in ISO-8859-1 (Windows default) and a Linux in Unicode (UTF-8). Oder problem also related with character set is the protection for non-valid character like ":" or "/", which may not be used within a file name. In any case the script will simply not rename the file (which will be left to the user to do). So, in the worst case, you will need to rename the failed files by hand. Useful for that will be to run the following command:

#---
grep -e "^[[:space:]]\+TITLE" "${CUE_FILE}"
#---
[UPDATE]


#---
COUNT=1;
## the first TITLE is for the album name, discard it
grep -e "^[[:space:]]\+TITLE" "${CUE_FILE}" \
| sed -e "s/.*\"\(.*\)\".*/\1/g" \
| while read TRACK_NAME;
do \
## just a little fine tune to have track names like
### "artist - 01 - track.flac" and "artist - 10 - track.flac"
if [ ${COUNT} -lt 10 ];
then \
NUM="0${COUNT}";
else \
NUM="${COUNT}";
fi;
ARTIST=`grep -e "^[[:space:]]\+PERFORMER" "${CUE_FILE}" \
| head -${COUNT} | tail -1 | \
sed -e "s/.*\"\(.*\)\".*/\1/g"`
## rename in the format: "<artist> - <track number> - <track name>.flac"
mv split-track${NUM}.flac "${ARTIST} - ${NUM} - ${TRACK_NAME}".flac;
COUNT=$(($COUNT+1));
done
#---

Wednesday, November 28, 2007

Java... what a hell?!?

Recently I experience a problem with Java (both 1.5 and 1.6, up to update 3), which throws the following message error in your face:

The error is: xcb_xlib.c:50: xcb_xlib_unlock: Assertion 'c->xlib.lock'

It does not affects all Java programs (my Eclipse was still running) but some. Not weirdly enough it seems actually a Java problem instead of a Fedora problem. Anyway, to workaround the problem the procedure is even more weird (extracted from here):

sed -i 's/XINERAMA/FAKEEXTN/g' /usr/java//jre/lib/i386/xawt/libmawt.so

Wednesday, November 21, 2007

[updated3] My Fedora 8 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*
enabled=1
...


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


- Install additional software:
-- Multimedia:
#---
yum -y install \
mplayer \
mencoder \
mplayerplug-in\
vlc \
grip \
ogle \
flash-plugin \
k3b \
k3b-extras-nonfree \
bittorrent \
bittorrent-gui
#---


-- 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-otr
#---


-- 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 \
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
#---


- Install and setup third-part programs
-- VirtualBox/VMware
-- Skype
-- Acrobat Reader
-- Real Player
-- 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
#---

Tuesday, November 20, 2007

How to get language switch in pidgin

To get language switch in pidgin you need a plugin called switch-spell, which does not come in a RPM package (as far as I know). This means that you need to get the sources (here, in download) and compile it. To make the job easier here goes the necessary packages:

dbus-devel
dbus-glib-devel
libpurple-devel
aspell-devel
gtkspell-devel
pidgin-devel


And the yum command:

#---
yum -y install \
dbus-devel \
dbus-glib-devel \
libpurple-devel \
aspell-devel \
gtkspell-devel \
pidgin-devel
#---


After that just extract the sources and compile:

#---
./configure
make && make install
#---


Have fun!

P.S.: Just remember the previous post, if you get a "fails sanity check" error.

Funny thing: "fails sanity check"

Ok that is a very funny error and I have never got it, until today. But why should I get such an error trying to compile something if I do have GCC and any other prereq whatsoever? The point is, and do not ask me why, GCC package does not requires glibc-headers. So you may get that following funny, and for me cryptic message, even though I have had "/lib/cpp" (go figure!):

configure: error: C++ preprocessor "/lib/cpp" fails sanity check

Anyway, just install the package and everything will go as you expect.

#---
yum -y install glibc-headers
#---

Tuesday, November 13, 2007

Fedora 8 screw big time

For those who got the "Invalid Module Format" trying to install/configure any module after installing Fedora 8 here is why. (It affects VMware (version Workstation 6.0.2 build-59824) and VirtualBox (version 1.5.2) BIG TIME!)

1. You have installed "kernel-devel" afterwards using yum (that is what I used);
2. Fedora 8 install kernel.i586 and yum (version 3.2.7) kernel-devel.i686 (notice the difference in the architecture?);
3. You can NOT upgrade your kernel to a i686 version.

How do I fixed the problem?

1. Install the "kernel-xen" and boot your box with it;
2. Remove ALL kernel instances (NOT kernel-xen, which your are using now);
2.1. You will need to remove 2 more packages too:
rpm -e xorg-x11-drv-nouveau xorg-x11-drivers
rpm -e kernel.i586 kernel-devel
3. Re-install the kernel:
yum -y install kernel.i686 kernel-devel.i686 xorg-x11-drv-nouveau xorg-x11-drivers
4. Reboot with the new kernel
5. Recompile the modules or, in case of vmware and virtual box, setup:
vmware-config.pl
/etc/init.d/vboxdrv setup
6. Enjoy!