Feed on
Posts
Comments

I just upgraded to Ubuntu 10.10 on my ThinkPad and the only issue so far is that TrackPoint scrolling had stopped working. To re-enable it I used GPointingDeviceSettings and set the following settings:

The important change was to set the wheel emulation’s button to 2, not 4 as it appeared to have been set to. If you don’t have GPointingDeviceSettings installed:

sudo apt-get install gpointing-device-settings

Update:

This original method didn’t survive a power-cycle but I found adding this file to /usr/share/X11/xorg.conf.d/20-thinkpad.conf will work:

1
2
3
4
5
6
7
8
9
10
11
Section "InputClass"
    Identifier "Trackpoint Wheel Emulation"
    MatchProduct "TrackPoint"
    MatchDevicePath "/dev/input/event*"
    Driver "evdev"
    Option "EmulateWheel" "true"
    Option "EmulateWheelButton" "2"
    Option "Emulate3Buttons" "false"
    Option "XAxisMapping" "6 7"
    Option "YAxisMapping" "4 5"
EndSection

If you use an SMS gateway, such as Clickatell, to send SMS from your website or computer, you might want to set up your own simple return path for people to reply to those SMS and have them emailed to you.

With an always-on Ubuntu 10.04 machine, an old mobile phone and a cheap pre-paid SIM, you can have this setup in under 10 minutes.

First, install the required software; the Gammu SMS daemon for getting the SMS off the mobile and Mutt for sending our emails.

1
$ sudo apt-get install gammu-smsd mutt

Put this little shell script somewhere like /var/spool/gammu/mail_wrapper.sh, customising the email addresses. It will be used to send the email when an SMS is received:

1
2
3
#!/bin/bash
export EMAIL="SMS Daemon <sms@example.com>"
echo | mutt you@example.com -i "/var/spool/gammu/inbox/$1" -a "/var/spool/gammu/inbox/$1" -s "SMS Received"

Attach your phone to your computer (mine was USB) and select “Phone mode” or similar on the mobile (as opposed to mass storage mode or photo mode, for example). Follow your system log to see what port your mobile shows up on, you should see output similar to this:

1
2
3
4
5
6
$ tail -f /var/log/syslog
Sep  6 09:00:22 smsgateway kernel: [105224.650743] usb 1-4: new high speed USB device using ehci_hcd and address 6
Sep  6 09:00:22 smsgateway kernel: [105224.991701] usb 1-4: configuration #3 chosen from 1 choice
Sep  6 09:00:22 smsgateway kernel: [105224.995894] cdc_acm 1-4:3.1: ttyACM0: USB ACM device
Sep  6 09:00:22 smsgateway kernel: [105224.997427] cdc_acm 1-4:3.3: ttyACM1: USB ACM device
Sep  6 09:00:22 smsgateway kernel: [105225.000013] cdc_wdm 1-4:3.7: cdc-wdm0: USB WDM device

The logs above show my mobile exposing two USB modem ports, /dev/ttyACM0 and /dev/ttyACM1. Trial and error lead me to discover that /dev/ttyACM1 was the port I was looking for.

Now configure this port in your /etc/gammu-smsdrc file with the line port = /dev/ttyACM1 and add the line runonreceive = /var/spool/gammu/mail_wrapper.sh so that the script we created earlier is executed when an SMS is received. The complete /etc/gammu-smsdrc file should look similar to this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Configuration file for Gammu SMS Daemon

# Gammu library configuration, see gammurc(5)
[gammu]
# Please configure this!
port = /dev/ttyACM1
connection = at
# Debugging
#logformat = textall

# SMSD configuration, see gammu-smsdrc(5)
[smsd]
service = files
logfile = syslog
# Increase for debugging information
debuglevel = 0

# Paths where messages are stored
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/

runonreceive = /var/spool/gammu/mail_wrapper.sh

Now start Gammu’s smsd and, with the configuration above, Gammu will log activity to syslog so you can send an SMS and see the fruits of your labour:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ sudo service gammu-smsd start
 * Starting Gammu SMS Daemon gammu-smsd                                                                                                                                   [ OK ]
$ tail -f /var/log/syslog
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: Configuring Gammu SMSD...
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: SHM token: 0xffffffff
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: Warning: No PIN code in /etc/gammu-smsdrc file
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: commtimeout=30, sendtimeout=30, receivefrequency=0, resetfrequency=0
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: checks: security=1, battery=1, signal=1
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: deliveryreport = no
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: phoneid =
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: Inbox is "/var/spool/gammu/inbox/" with format "standard"
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: Outbox is "/var/spool/gammu/outbox/" with transmission format "7bit"
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: Sent SMS moved to "/var/spool/gammu/sent/"
Sep  6 09:09:00 smsgateway gammu-smsd[11229]: SMS with errors moved to "/var/spool/gammu/error/"
Sep  6 09:09:00 smsgateway gammu-smsd[11232]: Using FILES service
Sep  6 09:09:00 smsgateway gammu-smsd[11232]: Starting phone communication...
Sep  6 09:09:13 smsgateway gammu-smsd[11232]: Received message from +61412345678
Sep  6 09:09:13 smsgateway gammu-smsd[11232]: Received IN20100902_165719_00_+61412345678_00.txt
Sep  6 09:09:13 smsgateway gammu-smsd[11258]: Starting run on receive: "/var/spool/gammu/mail_wrapper.sh" IN20100902_165719_00_+61412345678_00.txt
Sep  6 09:09:13 smsgateway gammu-smsd[11232]: Process finished successfully

If you run into any problems or need some help, please leave a comment below.

Note that there are more sophisticated ways of setting this up and many gateway providers have a much easier method to achieve the same result without you having to set up anything.

GNU gettext is used by many open source projects for translation support.

If you need to just do a find and replace in gettext source files, try this out to do a whole directory at once:

1
2
3
4
5
for i in *.po; do
  echo "Processing $i"
  msgfilter --no-wrap sed -e "s/OLD_TEXT/NEW_TEXT/g" < $i > /tmp/gettext
  mv /tmp/gettext $i
done

I couldn’t find a way to do the edit in place (a la sed -i), if you know of a way please let me know in the comments.

The good people of SUSE Studio have just released SUSE Gallery, which allows you to share appliances built in SUSE Studio (done with the usual SUSE Studio style I might add – “Enabling Infinite Improbability Drive” is displayed when you enable the new features :) nice!).

OpenAustralia DevLive, the ready-to-run OpenAustralia.org and PlanningAlerts development environment, is built with SUSE Studio and you can now find it published in SUSE Gallery.

This means you can download it directly from SUSE Gallery and more importantly, clone it to customise it or to improve it. I haven’t been giving it much love lately ;( so it’d be great if someone added a few new things to it. There’s a bunch of things that could be done to improve it and some bugs to fix, which should probably be added to the ticket tracker.

Wireshark is a network protocol analyser, or packet sniffer, available for Ubuntu 10.04 via a simple sudo apt-get install wireshark. However to use it correctly, we need to change some permissions to ensure we’re not running the whole application as root.

The following commands will let the adm group run Wireshark without elevated privileges – the adm group is the group that allows you to read log files, etc., I always add myself to it anyway.

1
2
3
4
5
6
7
8
$ sudo chgrp adm /usr/bin/dumpcap
$ sudo chmod 750 /usr/bin/dumpcap
$ ls -alF /usr/bin/dumpcap
-rwxr-x--- 1 root adm 63520 2010-04-13 01:17 /usr/bin/dumpcap*
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
$ getcap /usr/bin/dumpcap
/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip
$

That’s all pretty self explanatory – the setcap command allows that binary to use special capabilities, namely to control NICs (to set promiscuous mode for Wireshark) and capture raw traffic from NICs.

« Newer Posts - Older Posts »