paul's blog: Explorations in knowledge sharing, culture and human organisations
Linux technical notes
Simple Export of Moveable Type to Drupal
I have modified a script from here to make a simple export from Moveable Type into Drupal. I had to make some small modifications to get the correct count of entries into one of the tables (_sequences, which holds the maximum id number for other tables of content).
I had 2 weblogs to import, one after the other. Only entries and comments are imported. All I have to do now is sort out the taxonomy, which I wanted to revise anyway.
The bug I found in the import script:
1. sequences table has elements using table prefix (prefix_), not used by the import script.
Suspend to disk or to RAM
Having installed SuSE 9.2 I have been trying out suspend (hibernate). The suspend to disk works fine, although I have to make sure no applications are open (or visible on the desktop) as the password box is obscured behind the application windows!
With suspend to RAM, the machine (an NX9005) goes to sleep, but wakes up with a blank screen (so I have no idea what it is doing).
I have found this comment "I had nothing but trouble with suspend-to-ram until I used some extra parameters in GRUB. With IBM's Thinkpads it's best to use the option "acpi_sleep=s3_bios" upon GRUB's start-up." SuSE Linux Forums -> Hibernate on Linux?
Something to try out.
Wireless card problems
See update below.
So far I have not been able to get my wireless card working.
Others with SuSE 9.1 seem to be having similar problems ( see here . One of the posts on this thread prompted me to try deleting both Wireless card and the Ethernet card in Network Card settings (under Yast). I reinstalled just the Wireless card, set the correct encryption key, and IT WORKED.
I will see if it still works after reinstalling the ethernet card. I wonder if there is some conflict when 2 network devices are installed that makes it impossible for the Wireless card to get an IP address (this was what was constantly reported in /var/log/messages, in addition to only registering 2Mb/s under kwifimanager)
Here is my /etc/sysconfig/network file:
BOOTPROTO='dhcp'
MTU=''
REMOTE_IPADDR=''
STARTMODE='onboot'
UNIQUE='*************'
WIRELESS_AP=''
WIRELESS_BITRATE='auto'
WIRELESS_CHANNEL=''
WIRELESS_ESSID='WLAN'
WIRELESS_KEY='**************'
WIRELESS_MODE='Managed'
WIRELESS_NICK=''
WIRELESS_NWID=''
WIRELESS_POWER='yes'
_nm_name='static-0'
WIRELESS_FREQUENCY=''
Update 30/8/2004
I am now able to get my wireless card to function every time. The solution was to delete all network cards with YasT. I then inserted the wireless card and found that it registered with kwifimanager as functioning at 11Mb/s, although not able to connect to the router. With ifconfig I found that it was functioning as eth1 rather than wlan0. WIth YasT all I did was to add the name of the wireless LAN to the device configuration. The card then was able to connect.
One odd thing is that if the card is installed during power on and boot, it won't work. So I boot up, then push the card into the PCMCIA slot. Not much help if you have an inbuilt card. I have no idea yet what could cause this problem, but it doesn't inconvenience me. Please let me know if you have anything to add to this.
I hope SuSE can nail some of these irritating little problems, as they make it hard for me to persuade colleagues & friends to switch to Linux.
USB problems with SuSE 9.1
Since upgrading to SuSE 9.1 the USB interface has not worked so well.
Automount of USB can be disabled in /etc/sysconfig/hotplug by setting the parameter:
HOTPLUG_USE_SUBFS=no
A
Linuxquestions thread addresses this, and also this SuSE article explains how to revert to conventional mounting rather than using subfs.
The hotplug system is explained in SuSE article .
Kpilot & Tungsten E
USB seems to be a problem - this could be a SuSE 9.1 issue.
I have tried /dev/ttyUSB1 as the device, with 9600 baud and Unicode (UTF8) and it has occassionally worked.
This instruction tries to list databases on the Palm:
pilot-xfer -p /dev/usb/ttyUSB1 -l
Someone else has had problems with kpilot setting ports & ignoring preferences. See here
Have just tried setting device to /dev/pilot where there is a link: pilot -> /dev/ttyUSB1 This works.
Multiple Weblogs and .htaccess
I have one main weblog which is the main page on my site, with other weblogs in subdirectories. I wanted users to be able to access each weblog by requesting only "mydomain.com" or "mydomain.com/OtherWeblog" without the need for direct reference to a specific file.
A problem I had was that the weblog software is not permitted to write into the root directory. This means that a request for "mydomain.com" needs to be redirected to the directory with the main weblog.
I have achieved this with a directive in the .htaccess file. This tells the server to use a different index.html file than the one in the requested directory.
This also means that a request for any other directory will also be redirected to the same file, unless that subdirectory also contains a .htaccess file with the directive "DirectoryIndex /thisDirectory/index.html".
Relevant documentation can be found at apache.org here or here at interland or here at homelinux.com , the latter also has some useful ideas for blocking unwelcome bandwidth consuming bots.
TCP/IP networking with dynamic addresses
I have a Linux network which requires either fixed IP addresses or for one of the PCs to act as a name server. Since I am on a cable connection via a modem with dynamic addressing, neither of these are possible.
IP masquerading enables me to use one PC as a gateway that receives a dynamic address from my cable provider. A second ethernet card has a fixed address on an internal network with a router that allows other PCs with fixed addresses to communicate with each other as well as the internet.
All I had to do was to change a setting in /etc/sysconfig/sysctl
IP_FORWARD="yes"
and adding the following line to /etc/rc.d/rc.local
echo 7 > /proc/sys/net/ipv4/ip-dynaddr
(see SuSE Linux 8.2 Administration Guide, p.445 5th Edition.)
Firewall settings must also be such that a local network is permitted.
Spam Blacklist
Having been bothered by some unsavoury spam attacks on my weblog comments, I have now installed MT-Blacklist .
Following are the instructions I followed:
First, download, unpack the archive and upload to your webserver in ASCII mode. Put the files in the following locations relative to your main Movable Type directory (abbreviated MT_DIR below) where mt.cgi resides.
MT_DIR/mt-blacklist.cgi <--- Should be in the same directory as mt.cgi
MT_DIR/plugins/Blacklist.pl
MT_DIR/extlib/jayallen/Blacklist.pm
MT_DIR/extlib/jayallen/MTBlPing.pm
MT_DIR/extlib/jayallen/MTBlPost.pm
Set the permissions for all files to 755 (-rwxr-xr-x).
go to http://YOURDOMAIN/MT_PATH/mt-blacklist.cgi
-then configuration can be completed.
There is a master blacklist here that can be used to fill your own blacklist.
I have come across here a routine to update this without a cron job.
New spam identities can be shared with the master blacklist. A great way to work together to beat this scourge.
To run MT-blacklist: www.mydomain.com/mt-cgi/mt-blacklist.cgi
Mounting hard disk partitions
The way that Linux handles the file system is rather different to Windows. Different sources of data, such as hard disk partitions, CD ROMs, floppy drives, etc can be mounted to any point within the file system.
The top level of the file system is "/" (or the root directory). The filing system of a user is in /home.
To mount a partition manually, open a shell as superuser. You alternatively use one of the other graphical consoles by [ctrl][alt][F1-6] and log in as root. (To get back to your graphical screen, [ctrl][alt][F7].
->fdisk -l will give you a list of all partitions on your system
Decide where you are mounting a partition to....
->mount /dev/hda5 /home/myself/stuff mounts the partition /dev/hda5 to a subdirectory of user myself. You can specify the file system type, but the Linux should recognise that automatically.
If you want to have a partition mounted automatically at startup then you have to edit a file called fstab in /etc
This is where you will need to learn how to use a text editor. The traditional one is vi (vee-eye).
As root, change directory to /etc:
-> cd /etc
-> vi fstab
It will look something like this:
/dev/hda1 /home/myself/Windoze ntfs noauto 0 0
/dev/hda2 / reiserfs defaults 1 1
/dev/hda4 /home/store reiserfs defaults 1 1
/dev/hda3 swap swap pri=42 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs noauto 0 0
/dev/cdrecorder /media/cdrecorder auto ro,noauto,user,exec 0 0
/dev/fd0 /media/floppy auto noauto,user,sync 0 0
For those of you that still use Windows in a dual boot system and need access to your windows files, the first line is the one you want to add.
In vi, use the cursor keys to move to where you want to insert text and press i for insert, then type in the new line. You must then [esc] in order to switch back to command mode.
To write and quit type...
:wq
Now, vi is not like the wysiwig (what you see is what you get) word processing packages you are used to, but it is worth learning as there are times when you are not able to use the window manager (I use KDE). For help on vi, see here
The next time you start up, the new partition will be mounted ready for use. If you need to unmount a partition, make sure that you are not accessing or using the partition and then
->umount /dev/hda5 and note, it is not unmount but umount!
RSS Aggregation
A news aggregator is a great way of scanning content from a large number of sites and sources without visiting each one in turn.
I use knode which is an NNTP newsreader for KDE. I have it set to pick up news feeds from usenet and from various news and weblog sites.
Usenet is a longstanding internet service that provides discussion forums for a huge range of interests. Most ISPs (internet service providers) support usenet. The posts to a usenet forum are replicated across the internet within minutes of being posted, providing a totally non-centralised service. An introduction to usenet can be found here .
Weblogs have come into vogue over the last couple of years (although the first weblogs started before that) as a way for individuals to publish their ideas and share them with an interested audience. The great attraction for those who belong to some kind of community of interest, professional or private, is that weblogs provide a way of sharing and developing ideas with like minded people across the globe. Some weblogs function like personal magazines, others constitute a slow evolving conversation with visitors and other weblogs.
I have found it an onerous and time consuming task to visit all those weblogs and news sites that are of interest to me. The ability to aggregate them into a newsreader is a great way of cutting down browsing time and getting more quickly to relevant information. Any site that has an XML tab or icon can be added to the newsreader. I use a software add-on called nntp//rss available as Open Source Software from http://www.methodize.org/nntprss.
Once installed, nntp//rss has a Web-based administration interface at http://127.0.0.1:7810/
New sites to aggregate can be added by copying the XML location for the desired site (copy link location).
allows
