dinsdag 28 juli 2009

Samba shares in Thunar (file manager of Linpus Lite)

Wow, I just found this very handy forum posting explaining how to mount a Windows (or Samba) share on Linpus. I don't know if Linpus has been updated, because earlier I wasn't able to let Thunar (the default file manager) open smb shares.

I will be using the words Samba or smb because I have my shares on a Linux computer.

Part 1: create a script which will mount the samba share


First of all, create a directory in /mnt/. For example /mnt/windows, /mnt/samba or /mnt/<servername>
sudo mkdir /mnt/samba

Now, create a new file called /root/samba-share.sh with the following content
#!/bin/bash
/bin/df -k | /bin/grep /mnt/samba > /dev/null
if [ $? != 0 ]; then
sudo /sbin/mount.cifs //<server>/<share> /mnt/samba -o user=<user>%<password>
fi
/usr/bin/launch-thunar.sh /mnt/samba


You will have to insert your own servername (or ip address), share, username and password. If your server allow anonymous logins, you can replace "user=<user> password=<password>" by "guest".
Let's go through the script. The first line checks if the share is already mounted. If so, the mounting by mount.cifs is skipped.
Finally the graphical file manager Thunar is opened at your samba share.

You will have to make this file executable with the command
sudo chmod 755 /root/samba-share.sh

Part 2: create a desktop item and show it in the interface


We will create a file called /usr/share/applications/sambashare.desktop
In this directory all desktop items are placed. These items are used by the default interface.
In this file we'll put
[Desktop Entry]
Name=My Samba Share
Comment=Files shared on Samba server
Exec=/root/samba-share.sh
Icon=mydownload.png
Terminal=0


Now, just add this desktop item to the files menu. Open the file /home/user/.config/xfce4/desktop/group-app.xml and add the following line to the group with id=8 (search for <id>8</id>).
<app sequence="6">/usr/share/applications/sambashare.desktop</app>
This will have added an icon the the files menu. A reboot is needed to show it, though.

Clicking the icon will open Thunar at the samba share.

maandag 27 juli 2009

Too many markers in Google Maps

When creating an application with the Google Maps Api I, as many, stumbled upon the problem of having too many markers on a maps. In some cases over 1000. On the web there are some good solutions.

Here's a blog with some solutions. I decided to try MarkerClusterer, which was added later to the article. The screenshots look good and it should work fine for my project.

Here's a blog of the creator of MarkerClusterer. It describes the use briefly.

A real good example of simple use, excellent to start out with, is over here. It shows the url of the script to include and how to display a bunch of markers on the map.

When you're somehow familiar with Google Maps and the MarkerClusterer, here's a good advanced example. The source code describes how to use the advanced setting, for example how to show your own markers instead of the colored circles that are standard for MarkerClusterer.

With these links, you should be able to create some nice applications.

vrijdag 24 juli 2009

Install FireFox3 on the Acer Aspire One

Also, a good thing to do with your Aspire One is to install Firefox 3. Firefox 2 is installed by default, but since several Linpus programmes (like email) depend on Firefox 2 libraries, you cannot just upgrade 2 to 3.
I found a very good tutorial you can use, or you can follow my summary of the tutorial.

On the Firefox site you can choose the newest Firefox in your favorite language. Make sure you choose a download with os=linux. In this example, I'll use version 3.5.1 in US English. I downloaded via the link http://www.mozilla.com/products/download.html?product=firefox-3.5.1&os=linux&lang=en-US and put it in /tmp.

Now extract the file as superuser to the directory /opt.
sudo tar -jxf firefox-3.5.1.tar.bz2 --directory /opt

Set the default user as owner of all the files with
sudo chown user -R /opt/firefox

I choose to rename the old startup script /usr/bin/firefox to firefox2. Then I set a symbolic link from /usr/bin/firefox to the newly installed one.
sudo mv /usr/bin/firefox /usr/bin/firefox2
sudo ln -fs /opt/firefox/firefox /usr/bin/firefox

The next step links all plug-ins (not to be confused with extensions) to Firefox 3.
sudo ln -s /usr/lib/mozilla/plugins/* /opt/firefox/plugins

Launch the profile manager using the command below. Create a new profile, name it anything you like and select it. If you want to keep your bookmarks export them via the bookmark manager first. You can then delete the old default profile.
The old profile has some things disabled, including the "check for updates".
firefox -profilemanager -no-remote

Now, I'm going to change the connect menu. First, copy the old .desktop file to a new one. I want to keep the old one, just in case.
sudo cp /usr/share/applications/linpus-web.desktop /usr/share/applications/firefox3.desktop

Edit the linpus-web.desktop file with your favorite editor. Search the line with "Exec=firefox" and edit it to "Exec=firefox2".
In the file firefox3.desktop, replace the old icon with a new one.
sudo sed '/Icon/ s/acs_//' -i /usr/share/applications/firefox3.desktop

Now, edit the menu. Edit the file ~/.config/xfce4/desktop/group-app.xml.
Optional: I copied the line <app sequence="0">/usr/share/applications/linpus-web.desktop</app> to the bottom of the block, replacing 0 by 11 (my last menuitem was 10).
We want to have the new FireFox icon on the first spot (replacing the old browser). Edit the line <app sequence="0">/usr/share/applications/linpus-web.desktop</app> and replace "linpus-web.desktop" by "firefox3.desktop".

Now, after a reboot of the system, it should work. You'll have a nice Firefox logo in the connect menu, which will open Firefox3.

Popmundo tools

For players of the online game Popmundo
, there are a few tools. Two of them are a travel route planner (to plan the quickest route between two Popmundo cities) and a tour planner.
I find them quite useful.

donderdag 23 juli 2009

How to install software in Linpus Lite on the Acer Aspire One

I wanted to install an irc-client on my AA1. I decided xchat was an ok option. I will post a step by step installation.

  1. First open a terminal screen. This can be done with Alt-F2 and run program xterm.
  2. Use the software package manager yum to install xchat. Yum is installed with Linpus. On the command line, type yum install xchat to install.
  3. Now the program is installed, but it's nice to have an icon in the connect-menu. The install made a file named /usr/share/applications/xchat.desktop with a desktop entry, containing links to an icon and the executable. This file we want to present to the menu.
  4. The menu is located in /home/user/.config/xfce4/desktop/group-app.xml, an xml file. Now look for the group where the first app is <app sequence="0">/usr/share/applications/linpus-web.desktop</app>. You can put the icon at the end, by adding the line <app sequence="9">/usr/share/applications/xchat.desktop</app> at the end of the apps, but I preferred to give it sequence=2 and give the other sequences an increase of 1, so xchat is displayed on the home screen.
Well, this installed xchat for me. In this way, you should be able to install most of the programmes.

First post!

I reinstalled my Acer Aspire One with Linpus Lite recently. I want to share my tips and tricks I found on the internet to help others, and for myself, in case I need it some other time. For example, how to install software, how to add memory, etc.

Sometimes, I won't suppress the urge to post other useful or even useless stuff.