Open files in GVIM in new tab in GNOME 3

This will make it so you can open every file you click on in Nautilus in the same GVIM window (in different tabs).
Create a file called gvim.desktop in /usr/share/applications.

Make the contents as follows:

[Desktop Entry]
Version=1.0
Name=GVIM
GenericName=Editor
Comment=Graphical Version of vim
Exec=gvim --servername gvim --remote-tab-silent %U
TryExec=gvim
Icon=gvim
Terminal=false
Type=Application
Categories=Programming; System Utilities

The important line is the Exec line. The difference between –remote-tab-silent and –remote-tab is that silent won’t give you an error message before you can start editing.

Then to use this new shortcut you right click on a file you would want to edit in Nautilus and click Properties. Go to Open With and you may need to click Show Other Applications.

Choose GVIM (in Fedora the original is Vim; don’t choose that one here; GVIM is the one you just created).

Do this for all file types you would want to open in the same GVIM session.

You could also make a separate .desktop file for each file type if you wanted to. ie php-gvim.desktop could be made to open all .php files in the same gvim session. The key would be to edit the server name (on the Exec line) in the .desktop file. You could call it php instead of gvim.

Exec=gvim --servername php --remote-tab-silent %U

And you will want to change the Name too:

Name=PHP-GVIM

Throttle Package Downloads in Fedora

One of my clients only has a T1 internet connection so if I start downloading too many updates at the same time people will complain.
If you need to limit your download speed in Fedora (or anything that uses yum) simply add the following line to /etc/yum.conf

 throttle=100k

if you need to limit download speeds to 100KBps (kilobytes per second).

Ref:

http://dailypackage.fedorabook.com/index.php?/archives/37-Package-Management-Week-Tips-Tricks.html

You don’t have a virus! Well, maybe…

If you have Microsoft Security Essentials and today (September 30, 2011) it detected the PWS:Win32/Zbot virus it may be a false positive. Especially if it seems to be shutting down Google Chrome.

MS suggests updating the Security Essentials definitions to fix the problem.

References:

http://www.microsoft.com/security/portal/Threat/Encyclopedia/Entry.aspx?Name=PWS:Win32/Zbot

Which package does this file belong to?

Usually you can just search something like “redhat which file package belong” without quotes to find it for a particular distro. Here are some I’ve used:

Gentoo / Funtoo

# equery belongs /path/to/file

 

Redhat/SUSE/Fedora

# rpm -qf /path/to/file

 

Ubuntu/Debian

apt-file search /path/to/file

You may need to install by doing this (as root):

# apt-get install apt-file
# apt-file update

 

FreeBSD

# pkg_info -W /path/to/file

Wireless stopped working on SuSE Linux 11.1

On a HP ProBook 4420s my wireless connection stopped working after some updates.

I looked in /var/log/boot.msg and saw no trace of the wireless driver being loaded.
So I looked in /var/log/boot.omsg and saw:

 [ 11.224842] iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kds
 [ 11.226111] iwlagn: Copyright(c) 2003-2009 Intel Corporation
 [ 11.227383] iwlagn 0000:43:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
 [ 11.228632] iwlagn 0000:43:00.0: setting latency timer to 64
 [ 11.228668] iwlagn 0000:43:00.0: Detected Intel Wireless WiFi Link 6000 Series 2x2 AGN REV=0x74
 [ 11.256845] iwlagn 0000:43:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels
 [ 11.258146] alloc irq_desc for 36 on node -1
 [ 11.258147] alloc kstat_irqs on node -1
 [ 11.258165] iwlagn 0000:43:00.0: irq 36 for MSI/MSI-X

Then I decided to check:

# locate iwlagn

Some of the results included relevent modules files:

 /lib/firmware/iwlwifi-6000-4.ucode
 /lib/modules/2.6.32.12-0.7-pae/kernel/drivers/net/wireless/iwlwifi
 /lib/modules/2.6.32.12-0.7-pae/kernel/drivers/net/wireless/iwlwifi/iwl3945.ko
 /lib/modules/2.6.32.12-0.7-pae/kernel/drivers/net/wireless/iwlwifi/iwlagn.ko
 /lib/modules/2.6.32.12-0.7-pae/kernel/drivers/net/wireless/iwlwifi/iwlcore.ko

I found (after trying to manually modprobe the modules) I was getting this error in dmesg:

# dmesg
[ 1181.314606] iwlcore: Unknown parameter `led_mode'

Googling the error led me here:
http://centos.org/modules/newbb/viewtopic.php?topic_id=30883&forum=39
So then I investigated and realized I had to go to:

/etc/modprobe.d/50-hp-preload-led.conf

and comment out the line with

#options iwlcore led_mode=1

This is basically because the driver does not support that option. If you run:

modinfo -F parm iwlagn

the led_mode parameter is not there.

Hope this helps.

PS: The package that did this to me was sled11-branding-hp-bnb-1-0.116.1.

akregator not starting…. NOO! MY FEEDS!

I should point out I am running Funtoo on amd64.

I tried starting akregator after some world updates and it just did not load. And got this error if starting it from the command line:

(KLibrary) kde4Factory: The library "/usr/lib64/kde4/akregatorpart.so" does not offer a qt_plugin_instance function.

After some research I realized that this is more of a warning and may not have anything to do with my problem. The backtrace wasn’t terribly helpful to me.
So I ran:

# emerge -pve akregator

merge: there are no ebuilds built with USE flags to satisfy ">=x11-libs/cairo-1.10.0[-qt4]".
!!! One of the following packages is required to complete your request:
- x11-libs/cairo-1.10.2-r1 (Change USE: -qt4)
(dependency required by "x11-libs/qt-gui-4.6.3-r2" [ebuild])
(dependency required by "kde-base/kontact-4.4.9" [ebuild])
(dependency required by "kde-base/akregator-4.4.9" [ebuild])
(dependency required by "akregator" [argument])

Something seems odd about that.

Perhaps this is all related to me moving what I had in:
/etc/portage/package.keywords/kde4
to another directory. Most of what I have installed is not keyworded any more. I did downgrade a few packages.

The main reason I had to do that because there was some funkiness with phonon trying to require the debug USE flag all of a sudden. I had started to think I had my packages in an unlikely state with a mix of old and new KDE. After removing the keywords and downgrading the 3 or so packages the debug flag issue was resolved. Okay, so back to akregator….

After trying to `emerge -pv` various qt packages I saw it really wanted cairo without the qt4 flag. Specifically it would do this with just “emerge -pv qt-gui.” That could be because qt-gui provides the needed files now or maybe there is just a weird dependency hell issue going on.
I added “x11-libs/cairo -qt4″ to package.use and tried this:

# emerge -vD1 qt-gui cairo

Aha, now I’m getting somewhere. I can run `emerge -pve world` and it doesn’t report any conflicts. However `emerge -pvDe world` does.

I apparently need:

media-libs/libpng static-libs
media-libs/jpeg static-libs
virtual/jpeg static-libs
dev-libs/libgcrypt static-libs
dev-libs/poptĀ  static-libs
dev-libs/libgpg-error static-libs

in package.use.

Suspicious but I’ll go for it. I suspect the static image libs are for boot splashscreen support. Why all of a sudden? I’m not sure I care.

So now I can run:

# emerge -aqvDe --jobs=2 --keep-going --backtrack=30 world

Yes, I have both q (quiet) and v (verbose) flags there. I don’t care if you don’t.
Also, usually if I don’t suspect any building problems I run more parallel “jobs” than that.

I started at 11pm on the spot. Only 1184 ebuilds to compile…
By the time it finished doing kdelibs (at 12:46am), and not before, I was able to start akregator.
kdelibs was number 273 of 1184 packages but I left it to keep running.

It’s so easy to get your libraries out of sync with your apps.

imagemagick having trouble converting multi-layer tif

I had some tiffs that I could open up in GIMP and save a layer at a time into a new jpeg. I really didn’t care for that method because I had a lot of pages and I would rather convert them to something like PDF anyway.

I tried converting the multi-layer TIFF to pdf using imagemagick:

# convert CONSUMABLEINVENTORY.tif Consumable.pdf

But it outputted:

Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOF at line 27 of strip 24 (x 0).
Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOL at line 27 of strip 24 (got 0, expected 2338).
Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOL at line 27 of strip 25 (got 0, expected 2338).

Weird. The resultant PDF had mostly blacked-out pages.

After some research I realized tiifcp could handle it. (a part of the tiff package. eg: emerge -av tiff on Gentoo )

# tiffcp -i CONSUMABLEINVENTORY.tif CONSUMABLEINVENTORY-new.tif
# convert CONSUMABLEINVENTORY-new.tif Consumable.pdf

And awesomeness ensued. Or at least a clean PDF file.

Cross Ref:
http://www.asmail.be/msg0055459042.html
tiffcp can clean tiffs with weird null EOL’s.
http://www.imagemagick.org/discourse-server/viewtopic.php?f=10&t=9907
Moderator on imagemagick explaining that libtiff might be encountering errors that other programs cope with (by ignoring errors).