Tuesday 30 June 2009

Kyocera FS2020 network printing

This is tentative post - as we're not sure this is solved yet.

A new Kyocera FS2020 was having trouble printing over the network. This appears to have been solved by setting up the host name on the printer's network interface to match the name set on the DNS.

Setting mailman user passwords

Been doing so stuff using a bunch of email addresses that are handled by scripts to customise various mailman behaviour - in particular a script that does a subscribe via email command, then reads the result and then mails the user to determine if they are already on the list or not.

However, to do this we needed to set all the users up with a pre-determined password, but the initial listing of mailing list recipients was done using the mass subscription which generates random passwords.

Some hunting on the internet didn't yield anything for resetting them - they could be seen using

/var/lib/mailman/bin/dumpdb /var/lib/mailman/lists//config.pck | less

but nothing poped out about changing them - then I looked in the bin directory and found reset_pw.py.

This is intented to be used to reset the passwords to new random ones - but a little edit to the script and you can use it to set the password to whatever you want running it with:

withlist -l -r reset_pw -v

Tuesday 9 June 2009

Connecting to the Internet from Ubuntu using bluetooth to a Nokia E65

Having just set this up for about the 4th time, I thought it was about time to record what I actually do - rather than working it out each time!

First off, I get the phone and laptop paired - easy enough using the bluetooth icon on the gnome panel.

Then, edit /etc/bluetooth/rfcomm.conf to look like:

#
# RFCOMM configuration file.
#

rfcomm0 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device 00:AA:BB:CC:DD:EE;
#
# # RFCOMM channel for the connection
channel 2;
#
# # Description of the connection
comment "Nokia E65";

}

using the appropriate device MAC. If you don't know this then
hcitool scan

will reveal devices that are visible in your locality and then
sdptool browse

will let you find the channel number for Dialup Networking.

Restart bluetooth after this change.

Next create /etc/ppp/peers/orange

noauth
#change this if you move the path to your connect script
connect "/usr/sbin/chat -v -f /etc/chatscripts/orange-connect"
#change this if you move the path to your disconnect script
disconnect "/usr/sbin/chat -v -f /etc/chatscripts/orange-disconnect"
#I found that I needed this to remove problems with loopback on connecting
silent
#remove this if you don't want lots of information going to /var/log/messages
debug
#this is the device specified in your rfcomm.conf file
/dev/rfcomm0
#speed at which to connect - might be worth trying higher...
115200
#this is needed so that a default route is added to your routing table
defaultroute
#this is needed so that you pick up Orange's DNS settings
usepeerdns

lcp-echo-failure 0
lcp-echo-interval 0
nomagic
noccp


And /etc/chatscripts/orange-connect:

TIMEOUT 5
ECHO ON
ABORT '\nBUSY\r'
ABORT '\nERROR\r'
ABORT '\nNO ANSWER\r'
ABORT '\nNO CARRIER\r'
ABORT '\nNO DIALTONE\r'
ABORT '\nRINGING\r\n\r\nRINGING\r'
'' \rAT
TIMEOUT 12

OK ATE1
#here's the magic bit!
OK 'AT+CGDCONT=1,"IP","orangeinternet"'
OK ATD*99***1#
TIMEOUT 30
CONNECT ""


And /etc/chatscripts/orange-disconnect

ABORT "BUSY"
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" "\K"
"" "\K"
"" "\K"
"" "+++ATH"
"" "+++ATH"
"" "+++ATH"
SAY "\nPDP context detached\n"


With all this in place, sudo pon orange should make the connection and sudo poff orange should break it.

Monday 8 June 2009

Scanning documents using SANE and an ADF on a Fujitus M4097Ddm

Working on a document scanning project to sort out some paperless office systems, I came across an interesting problem while using the ADF on our Fujitsu M4097Ddm scanner.

The command scanimage -y 297 --source="ADF Front" resulted in a message back from sane of

scanimage: rounded value of br-y from 297 to 279.364

I.e. the page was getting truncated to US Letter length - not very helpful.

The solution is to change the order of the parameters and add an extra one:

scanimage --source="ADF Front" --pageheight=297 -y 297

Once the document source is specified then the list of available options changes and the pageheight and pagewidth options become available.