Wednesday, May 13, 2009

Using xhost with Ubuntu/Kubuntu Linux running gdm or kdm

I was just chatting to a work colleague about the ease and wonders of X11 as part of extolling the virtues of the Linux Terminal Server Project, when I said I'd show him how it works.

So I tried to do 'xhost +' on his machine and then ran xeyes from my machine giving his machine's IP address in the -display option, but it didn't work! Trawling the web, I found that Ubuntu had tightened things up:

http://davesource.com/Solutions/20070912.Ubuntu-xhost.html

This solution works for gdm users, but my colleague and I both run kdm (kde4) to control acces to X. So here's the expanded instructions:

  1. Edit /etc/X11/xinit/xserverrc:
    Remove (or comment out) the "-nolisten tcp"
  2. Edit /etc/X11/kde4/kdm/kdmrc:
    Find the line 'ServerArgsLocal = -br -nolisten tcp and comment out the '-nolisten tcp' bit.
  3. Log out of X (GNOME or KDE) and log back in again (this should restart the kdm or gdm process).
Having done that it should work thus:

My machine's IP is 192.168.0.10 and my colleagues is 192.168.0.20. On my colleague's machine, having done the above he opens a command line and issues:

% xhost +

On my machine, I open a command line and issue:

% xeyes -display 192.168.0.20:0.0

And xeyes appears on his screen!

Wednesday, February 4, 2009

Running a network batch file under Windows XP without the publisher could not be verified error appearing.

At my work for People & Planet, I was setting up a new PC running Windows XP (shock, horror).

One of things that the new machine has to do is to run a DOS batch file over the network to set a few things up when a user logs in. However Windows XP displays a warning dialogue box telling you The publisher could not be verified. Are you sure you want to run this software?.

I searched around the net and found some information about the page at http://windowsxp.mvps.org/networkfile.htm and had to adapt the instructions a tad. Here's what I needed to do to make the batch file run without the annoying warning:
  1. Click Start, Run and type INETCPL.CPL
  2. Click the Security tab.
  3. Select Local intranet and click Sites.
  4. Click Advanced.
  5. In Add this website to the zone: enter \\mysmbservername\ and click Add.
  6. Make sure Require server verification... is unchecked.
  7. Click Close, then OK, then OK to close the Internet Properties dialogue.

Obviously you need to replace \\mysmbservername above with the name of the Samba (Windows networking, CIFS) share name that your script is running from. So for example if your script is \\scripts\startup\startup.bat then enter \\scripts above.

Disabling autonumbering in OpenOffice.org Writer

Autonumbering can be useful, but it can also be annoying. Personally I know what I want to do and I don't need some smart-arse word processor telling me otherwise.

OpenOffice is really cool, but this particular feature was driving my girlfriend to derision and she was threatening to dump her Ubuntu Linux laptop in favour of a return to Windows: the situation was serious!

It's not obvious how to to disable this feature; in fact, it's down-right annoyingly difficult to find out where it is. Anyway I did by searching around the net and here's how you do it:

  1. Tools -> Auto Correct
  2. Options tab
  3. Uncheck the option Apply numbering - symbol: *
  4. Click OK

That's it, obviously re-check that option to turn it back on.

Friday, January 23, 2009

Results of installing Flash Media Server 3.5 on Debian Etch Linux

I've been trying to install Flash Media Server 3.5 on Debian Etch.

It works with some messing about.

Firstly you can download the software from Adobe's web site and then have it ready to install on your server, but you must first install some libraries, do the following:

aptitude update && aptitude install libstdc++2.10-glibc2.2 iceweasel

Yes install iceweasel! You'll see why in a sec. Now download the software and get it onto your server and follow the instructions to install it (by reading the file Install.htm with lynx).

Now on first start-up you should spot the error about the NSPR library:

NPTL 2.3.6
Starting Adobe Flash Media Server (please check /var/log/messages)
Error: Flash Media Server needs the NSPR library installed.

Now if you run the command 'ldd /opt/adobe/fms/fmsmaster' you'll get this:

linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7f83000)
libnspr4.so => not found
libplc4.so => not found
libplds4.so => not found
libasneu.so.1 => not found
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7f43000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f3f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e59000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e34000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e29000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cf8000)
/lib/ld-linux.so.2 (0xb7f9f000)

We need to sort out those missing libraries, all except libasneu. So do this:

ln -s /usr/lib/iceweasel/libnspr4.so /usr/lib/
ln -s /usr/lib/iceweasel/libplc4.so /usr/lib/
ln -s /usr/lib/iceweasel/libplds4.so /usr/lib/
ln -s /usr/lib/libssl.so.0.9.7 /usr/lib/libssl.so.4 # (I'm not sure that that is necessary, so try without)

Now run the ldd command and you should get:
server:/opt/adobe/fms# ldd fmsmaster
linux-gate.so.1 => (0xffffe000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7f51000)
libnspr4.so => /usr/lib/libnspr4.so (0xb7f20000)
libplc4.so => /usr/lib/libplc4.so (0xb7f1a000)
libplds4.so => /usr/lib/libplds4.so (0xb7f17000)
libasneu.so.1 => not found
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7f0e000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7f0a000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7e25000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7dff000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7df4000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7cc3000)
/lib/ld-linux.so.2 (0xb7f6d000)

Now try to start the server again. You can do this with the command:
/opt/adobe/fms/fmsmgr server fms start

The admin server can be started with:
/opt/adobe/fms/fmsmgr adminserver start

Finally you need to run the console, I'll put the instructions up for this soon.

Sunday, December 21, 2008

One-liner to back process old Apache log files using AWStats

I had the issue of going back and wanting to process all the old Apache log files using AWStats when the web server had already been running for a while and logrotated had been busy archiving them. This particular server runs the site http://portal.bristolwireless.net on a server running Debian and Apache2.

I used this one-liner to deal with all the archived gzip files:

% cd /var/log/apache2
% for i in `ls -tr access.log*.gz`; do gunzip $i; /usr/lib/cgi-bin/awstats.pl -LogFile=/var/log/apache2/`echo $i | replace '.gz' ''` -config=portal.bristolwireless.net -update; gzip `echo $i | replace '.gz' ''`; done

Now there's just the one uncompressed file to do:

% /usr/lib/cgi-bin/awstats.pl -LogFile=/var/log/apache2/access.log.1 -config=portal.bristolwireless.net -update

And then run it as normal (which defaults to /var/log/apache2/access.log in this case):

% /usr/lib/cgi-bin/awstats.pl -config=portal.bristolwireless.net -update



Et voila!

Tuesday, December 16, 2008

Migrating Thunderbird files from OS X to Linux and vice-versa

I have a MacBook and can never work out whether I prefer OS X or a Linux distro, well actually I prefer the latter, just that the former has up until very recently always worked better :P

Now with the packaged Ubuntu 8.10 all under the Linux side of my dual boot using rEFIt seems to be rosy, so I've moved back to it. I use Thunderbird for my email, and the files are in a slightly different location on the different OS versions:
  • Under Linux both the profile directories and the profiles.ini file live in ~/.mozilla-thunderbird
  • Whereas under OS X the profiles.ini file lives in ~/Library/Thunderbird/ and the actual profiles are then stored in ~/Library/Thunderbird/Profiles/
Therefore a small amount of mangling needs to be done to move from one to the other. Follow these steps:

Moving Thunderbird from OS X to Linux:
  1. First take a back-up copy of ~/Library/Thunderbird from OS X (you probably will want to back up all of your home directory) and then once in Linux, copy this into your home directory.
  2. Now change the name of this directory using 'mv ~/Library/Thunderbird ~/.mozilla-thunderbird' - note that the dot between the slash and the m is important.
  3. Change to the new directory with 'cd ~/.mozilla-thunderbird'
  4. Move the profiles with 'mv Profiles/* .' and then remove this directory with 'rm -rf Profiles'
  5. Now use your favourite text editor to edit the file called 'profiles.ini', for example 'nano profiles.ini' and then find the entry for your profile, it may look something like this:
    [Profile0]
    Name=default
    IsRelative=1
    Path=Profiles/mzsbzfk5.default
    Change the entry for 'Path' by removing the 'Profiles/' part, e.g. if I did that for the above, it would then read:
    [Profile0]

    Name=default
    IsRelative=1
    Path=mzsbzfk5.defa
  6. Save the file and exit your editor (in Nano this would be ^O ^X (control-O, control-X) and start Thurndebird. Et voila!
  7. P.S. They're be some files kicking around from OS X that you now do not need, to tidy these up do 'rm ~/.mozilla-thunderbird/Application\ Registry;rm -rf ~/Library/Thunderbird'
Moving Thunderbird from Linux to OS X:
  1. First take a back-up copy of ~/.mozilla-thunderbird from OS X (you probably will want to back up all of your home directory) and then once in OS X, copy this into your home directory.
  2. Now change the name of this directory using 'mv ~/.mozilla-thunderbird ~/Library/Thunderbird ' - note that the dot between the slash and the m is important.
  3. Change to the new directory with 'cd ~/Library/Thunderbird'.
  4. Make a subdirectory for the profiles with 'mkdir Profiles'.
  5. Move the profiles to this new directory. One of the easiest ways to do this is the following 'mv * Profiles;mv Profiles/profiles.ini .'.
  6. Now use Text Editor to edit the file called 'Library/Thunderbird/profiles.ini', it may look something like this:
    [Profile0]
    Name=default
    IsRelative=1
    Path=mzsbzfk5.default
    Change the entry for 'Path' by removing the 'Profiles/' part, e.g. if I did that for the above, it would then read:
    [Profile0]

    Name=default
    IsRelative=1
    Path=Profiles/mzsbzfk5.defa
  7. Save the file, quit Text Edit and start Thunderbird. Et voila!

Friday, October 24, 2008

Getting Spanish keyboard layout working well on a MacBook running Ubuntu

When I started learning Spanish I decided that I would run a lot of my computing environment in Spanish in order to familarise myself with the language, especially the terms used in computing and IT. When I moved to Spain I also started to use the Spanish keyboard layout frequently, which is very useful for writing Spanish and other Latin based languages because it contains keys for easily accenting characters.

So for example, some accented characters require a single keystroke or simple use of the shift key (ñ,Ñ,ç,Ç,º,ª) and some can obtained with a two-key compose sequence (à, á, â, ä, è, é, ê, ë, ò, ó, ô, ö, ù, ú, û, ü, ý, ÿ, ì, í, î, ï, ŕ, ń, ź, ć ś, ĺ) and some using a third-modifier key like right-apple-key / alt-gr (æ, ł, €, ø, þ, ß, ð, đ, ŋ, ħ, ĸ, µ). It's even possible to get some useful symbols easily using just one modifier key («, », º, ª, ·, ¦, ¿, ¡) and also the accents on their tod with the compose key followed by the space bar (^, `, ', ", ~).

Anyway great for all those weirdy European language characters, as I'm sure you'll agree - although I can't seem to get the Welsh language's 'w' with a caret/circumflex (^) over it very easily. In HTML you can get others from this URL http://www.computertorture.com/xhtml/character.xhtml but not this one. Weird as it's an important letter in Welsh and there must be a way to do it??

I was having trouble getting the layout to work under Ubuntu 8.04, but here's how I did it:

First go to Preferences -> Keyboard Shoutcuts and reassign to 'Switch to workspace to the left' to be Control-Shift-Left and likewise 'Switch to workspace to the right' to be Control-Shift-Right (both of these are right at the bottom of the list, so scroll down!).

This frees up the Alt (also known as Command) key for use as the third-level-modifier.

Then go to Preferences->Keyboard and the Layouts tab. Once here, select the 'Keyboard model' to be 'MacBook/MacBook Pro (Intl)' and then add the layout by clicking the 'Add' button. Here you want to select 'Spain' as the layout and 'Spain Macintosh' as the variant.

Then choose 'Layout options' button and here you need to expand 'Third level choosers' and choose the option 'Press Left Alt key to choose 3rd level'.

That's it.

Bristol Wireless News

People & Planet News Headlines

Followers