Archive for the ‘Uncategorized’ Category

Arduino for Mandriva

Monday, November 26th, 2012

A while ago I decided to do some development work on the Arduino platform (http://http://arduino.cc). I bought an Arduino Uno and started to get information about the required software. As usual ( @%$#%^#) everybody is using M$ Windows, but for the Arduino there are also Mac and Linux installations available. Unfortunately there is no mentioning of Mandriva Linux in their list, so I started with the noarch tarball and tried to run the IDE. Right away I had problems with access rights, lock files etc. Googling the issues didn’t help a lot, since the solution were never Mandriva compliant. I was so happy when I read a thread of a guy who build a Mandriva 2010 package, but it turned out that the links were a bit off and when I finally found the rpm I ran into a rats nest of circular dependencies.

Why didn’t anybody tell me that Mandriva has a Arduino package in the repository?

Make sure that you have Contrib-Backports selected in your media list and you will be able to install the Arduino IDE.

I found the rpms beginning with Mandriva 2010.1, installation was no problem at all and the Blink example worked right away.

Good Luck and have fun with your Arduino.

IBM Thinkpad T22 laptop as media center

Monday, July 11th, 2011

 

I still have an old Thinkpad T22 laptop with a 900MHz Pentium3 CPU and 128MB memory at home.

 

My wife used it for a while with a Windows 2000 app. I was never able to upgrade her to Windows XP. The laptop sat in a corner for several years until I had that idea to set up a little media system in our living room.

I started bold and installed Mandriva 2010. That failed right away and so I stepped down a notch.

  • Mandriva 2007.1 installed without a problem on the system.
  • I added Firefox 3.6.18 (later releases required newer C++ libraries) as web browser.
  • I created a few shortcuts to the panel, webmail, my local music streamer, Intellicast for weather. Just use the “firefox -url <URL>” option to start your browser.
  • A PCMIA network card gives me wireless access to my network.
  • The Samba client gives me access to Windows shares.
  • Installing auto login (MCC->boot->setup autologin) allows easy operation. WARNING: this is a security risk and you have to be aware of that risk!

The last piece was to upgrade the memory to the maximum of 512MB ($58 at amazon.com) to make the system a bit faster.
Connect the audio out to the aux in of the amplifier and now I can listen to the music from my server and even my wife will be able to learn how to use it.

Changing wallpaper using crontab

Tuesday, July 5th, 2011

It all started with our week as volunteers in the Mount Washington Observatory. All over that place you find the observatory’s weather panel and so I decided to make it a desktop background picture on my PC. Now this PC I am talking about is running Windows XP. It didn’t take long to find a background changer application. But then I needed to download and install wget (yes, that is not part of Windows). Like most Windows apps, the changer has a GUI and even in ‘hiding’ mode shows up prominently in the tray. So I started building a batch file that would download the panel and install it as background. After some headaches and downloading a few UNIX tools (the panel is a png file, Windows wants a bmp) it finally worked.

I said: “This MUST be MUCH easier on Linux!”

- wget, check!
- Gnome can use pngs, check!

The script “ChangeWallpaper” looks like this:

!#/bin/bash

cd /home/wallpaper
rm -f conditions.png
wget “http://mountwashington.org/weather/conditions.png”
gconftool-2 -t str –set /desktop/gnome/background/picture_filename “/home/wallpaper/conditions.png”

- run script, wallpaper changes, check!

NOT SO FAST!

The panel is updated ever 15 minutes, so in order to catch it I created a crontab like this:

*/5 * * * * /home/wallpaper/ChangeWallpaper

but that didn’t do anything.

Some digging leads to the solution:

GNOME uses dbus for Inter Process Communication (IPC). When I started the gconftool it had no information about dbus and therefore just exited. The dbus address that is used by clients to connect to the server is not available at in crontab and so we have to retrieve that address.

There are different ways to find that address, I like the one where you look at the nautilus application (kind of explorer) and export its DBUS_SESSION_BUS_ADDRESS:

export $(tr ‘\0′ ‘\n’ < /proc/$(pgrep nautilus)/environ | grep ‘^DBUS_SESSION_BUS_ADDRESS=’)

The full script is now:

!#/bin/bash

cd /home/local/wallpaper
rm -f conditions.png
wget “http://mountwashington.org/weather/conditions.png”
export $(tr ‘\0′ ‘\n’ < /proc/$(pgrep nautilus)/environ | grep ‘^DBUS_SESSION_BUS_ADDRESS=’)
gconftool-2 -t str –set /desktop/gnome/background/picture_filename “/home/local/wallpaper/conditions.png”

You may want to use the configuration editor to change /desktop/gnome/background/picture_options to ‘centered’. Feel free to poke around yourself.

Trouble with vmplayer (“Could not open /dev/vmmon”)

Monday, May 23rd, 2011

A while ago I started using vmplayer to install a Windows XP on my laptop (Stop grinning! There are reason to do this)

When they came out with vmplayer 3.1.3 and 3.1.4 I could run vmplayer for a while and at some point I got the dreaded “Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon’ is loaded” error message. Looking this up on the Internet shows plenty of issues, but not a lot of useful advice. All solutions turned out to be temporary solutions, after several reboots I always came back to the issue.

One of the ‘solutions’ created a new scenario, the vmmom was loaded, but then the display wasn’t recognized. Once I loaded that module, the next piece was missing. After starting all these modules manually several times I finally found a way to get the system started.  I don’t claim this is a fix, but certainly a good work-around.

All vmplayer modules are actually loaded by the vmware service. Apparently that doesn’t work too well for whatever reasons. But if you restart the service right before you bring up vmplayer everything starts working.

The ‘vmplayer’ command is a script in /usr/bin. We change that script to restart the vmware service before it is taking any other action. I do that right after:

export PRODUCT_NAME=”VMware Player”
libdir=”$LIBDIR”/vmware

We just add a line

sudo service vmware restart

This requires that you are in the sudoer file and have the right to manage servcies!

Firefox and its Automatic Download settings

Friday, December 24th, 2010

When I install a new Linux system, it happens so often that I cannot configure my download settings as I want them to happen.

Here is a scenario:
I often download files that are split into several smaller files and have to be re-assembled later. These are usually rar or zip type of files.
I download automatically them into ~/Download and once they all there, I will unpack them.

When I click the link, I get the Download popup and the options What should Firefox do with this file? I would like to check Save File and Do this automatically for files like this from now on. Unfortunately this second option is greyed out which means that I will always get the popup and I have to tell Firefox where to save the file. That is especially annoying when you use a download manager which downloads the files sequentially.

The problem is the messed up mime-type setting. There is a configuration file for mime-type settings and you can’t fix too much in it and therefore it should be deleted. It is called mimeTypes.rdf and is located in your profile folder (you can search for it under ~/.mozilla or follow http://support.mozilla.com/en-US/kb/Profiles). Delete this file and restart Firefox to create a default setting. You have a new configuration now and the check-box will be available when you start the download.

Check out these helpful links:
http://support.mozilla.com/en-US/kb/Profiles
http://kb.mozillazine.org/File_types_and_download_actions

DHCP woes

Saturday, November 27th, 2010

A DHCP server has the major advantage that you can keep the management of IP addresses located in one place. You can manage fixed PCs as well as wireless devices like as laptops, iTouchs etc.

My DHCP setup under Wingate was never working too well. The Linux systems never saw the local Windows PCs. The name resolution on the Linux side always bothered me, since I had to maintain hosts files, contrary to my goal to keep IP management in one place. After replacing the Wingate PC with a Linksys WRT 5GL running DD-WRT v24 I finally had a chance to experiment with DHCP.

I have applications running that on Linux PCs that require a static IP address, but Wingate never worked too well with that.

Her is my DHCP quick guide:

The DHCP server is set up with

- its own LAN IP address
- a starting address for dynamic IP addresses
- the max number  or a range of addresses handed out
- a table with static IP addresses
- a list of DNS servers

LAN IP address: To make things a bit easier, I use 1..19 for Access Points and printers, 20..39 for static addresses and 40 and up for dynamic addresses.

Static address: You will most likely need the MAC address (that is the hardware address of the device in a format like aa:bb:cc:dd:ee), the hostname of the device and the IP address. This data has to be set up in your DHCP server on the router. When a DHCP request from a device comes to the server, it will look at the MAC address and check if that address has an entry in the table for static IP addresses. If it doesn’t, the server will provide a ‘random’ address from the dynamic range.

DNS servers: I use OpenDNS (OpenDNS.com) instead of my provider’s DNS.

The DHCP client:
On my Mandriva 2009.1 system I had to change a few settings that gave me problems with DHCP:
- nsswich.conf: In this file you configure where the OS should get its settings from. The “hosts” entry should say “dns, files”, in that order! This ensures that host names are looked up through DNS provided by the router. Make sure that your network configuration applet has all values empty. DHCP will be confused if you have conflicting information and provide you with a dynamic IP instead.
- reslov.conf: this file is created on the fly, so you shouldn’t modify it. Make sure you see a nameserver entry with your router’s IP.

Final comments: Some of the Windows PCs had to be rebooted to get everything right, no surprise here. The Linux systems behaved well and reconnected through DHCP and now handle local IPs AND Internet domain names.

Saving Flash files

Sunday, November 7th, 2010

I have a few sites I visit on a regular basis that have videos that are viewed through an embedded Flash player. Some of these videos I would like save on my hard drive, because they might be available only on a temporary basis. There is no option in Flash player that would allow you to do that.

There are a few ways to find the temporary files that have to be stored someplace on your system:

1) Tools -> Page Info
The ‘Media’ option will show you all kinds of media files on the web page. You might be lucky to find the file here (I used Firefox, your browser might use other tools).

2) Your /tmp directory might hold the file.
Most of the time it won’t be a name you’d recognize. I suggest you clean out the temp directory first. Then start the video. Once you see that the download bar is at the end, the player has downloaded all of the file. Stop the video and look into the temp directory. Rename the new file to something useful and try to start playing it.

Good luck!

Google search settings not saved

Tuesday, October 5th, 2010

I always had my Google Search set up to show 50 results instead of the default 10. While I changed several of my PCs I noticed that Google only showed me 10 results. Easy enough … must be a cookie issue. I turned cookies on and off, cleaned up my cookies without success. Although google always claimed it saved my preferences it always came back with the defaults.

This time the fix is not related to Linux or Firefox, it’s a new Google feature called “Google Instant“. It will show you results while you type and is advertised as search enhancement. Since I don’t like anybody messing with my search settings I decided to turn Instant off:

Search for anything and check the results page. At the right of the search bar on the top of the page you will see a tiny “instant is …”. Click that and you will see the option to turn it off.

Can’t open Thunderbird attachments

Sunday, October 3rd, 2010

I recently received an email that had a PDF attached. When I double clicked the attachment I was only allowed to save the file, no option to open it. I am sure that never worked that way.
The usual suspect would be the mimeType.rdf in the .thunderbird directory, but deleting that didn’t help.

I am currently running 3.0.5 and maybe this is fixed in 3.1, but for all of those with the same issue, here is a way out:

Download the add-on “Gnome Open” from the Firefox Add-On option. Save the file in a temp directory.

Open Thunderbird and go to Tools->Add-Ons. Click the Install button and find the xpi file you just saved from Firefox. Thunderbird will restart and from now on you can pick your application to open files!

Firefox and Flash hell

Tuesday, July 13th, 2010

Did you ever wish Firefox go to He**?

I installed Firefox on different Mandriva systems several times with the result that flash files (*.swf) wouldn’t work. Don’t get me wrong, I LOVE Firefox as a browser, but its dealing with flash is just not acceptable.

What happens:

Prelude:
I install Firefox and instead of a flash application I get a big grey “play” button. I go to “Tools -> Add-ons -> Plugins” and I see “Shockwave Flash 9.0 r999″. Ok, that easy. Go to http://get.adobe.com/flashplayer , select the rpm and it will install whatever the lastes Flash version is available (right now 10.1). Adobe says you’re all set.

The Test:

Back to your original site refresh (or restart Firefox) and you get a nice … grey “play” button.
Check “Tools -> Add-ons -> Plugins” again and now I have “Shockwave Flash 9.0 r999″ and “Shockwave Flash 10.1 r53″ installed, both enabled.

AHA! Disable 9.0!

You will see, that doesn’t help at all.

The Research:
Where is this player installed? I found Adobe’s “libflashplayer.so” in different places, but usually it is found in /usr/lib/flash-plugin. I found that by brute force with find / -name “flash*” and the directory it was in gave it away. You will probably find symlinks from different homedirectories to this library.
But why doesn’t it work then?
The first doubt about Firefox’s use of flash libraries comes when you type “about:plugins” in your address field. You will find the names of the libraries used for the different flash versions:

Shockwave Flash

File:    libswfdecmozilla.so
Version:    Shockwave Flash 9.0 r999

File:    libflashplayer.so
Version:     Shockwave Flash 10.1 r53

Now we’re cooking! Search with find / -name “libswfdecmozilla.so” and you will find it most likely in /usr/lib/mozilla/plugins. Now rename it (or remove it if you are bold).

The End:
Go to your site and you will see … a great Flash application.

Voila!