Archive for the 'Linux' Category

Backup script for ToodleDo

 

Just started using ToodleDo with the GotToDo Android app on my HTC Desire.

There is a rare bug in the app which has deleted all the ToodleDo tasks for a very small number of people. the author of the app is working on a solution at the moment, but in retrospect I should have had a backup plan for this data anyway.

Benny Morrison on the app mailing list sent me a DOS script he used to back up his Toodledo account, and I have hacked it to work under linux (the core functionality comes from Benny – all I did was wrap it up in some linux specific stuff to create the appropriate directories and do some rudimentary checking).

The (short) script is below. I run this from a cron job a few times a day.

Pete

NOTE: script updated 26th July 2011 after ToodleDo redesign

#!/bin/sh
# Script to backup toodledo account
# makes a backup on your local machine and
# sends a copy to a google account of your choice
## CONFIGURATION SECTION
## CHANGE THESE VARIABLES ONLY
#
# Where you want the data stored.
DATADIR=/home/YOUR-NAME-HERE/toodledo-backup/$(date +%Y)/$(date +%m)/$(date +%d)/$(date +%H:%M:%S)
LOGIN="TOODLEDO-LOGIN"
PASS="TOODLEDO-PASSWORD"
# This variable is where you want copies of the backups sent. I use a dedicated gmail account.
ARCHIVEMAIL=ARCHIVE-EMAIL-ADDRESS
#
## END OF CONFIGURATION SECTION
mkdir -p $DATADIR
cd $DATADIR
wget -q --no-check-certificate --keep-session-cookies --save-cookies cookies.txt --post-data "email=$LOGIN&pass=$PASS" https://www.toodledo.com/signin.php
wget --quiet -O Tasks.xml --load-cookies cookies.txt http://www.toodledo.com/tools/xml.php
rm cookies.txt
rm index.php
#
## Check for login errors
if [ -f signin.php ]
then
echo "$0 - ERROR - login not complete.
There is a HIGH RISK that your ToodleDo backup did not complete."
fi
#
## Does the Tasks.xml file look OK ?
if ! egrep -q '' Tasks.xml
then
echo "$0 - ERROR - Problem with Tasks.xml file.
There is a HIGH RISK that your ToodleDo backup did not complete."
fi
## Now mail the file to a google account
/usr/bin/mutt -s "ToodleDo backup - `/bin/date`" -a Tasks.xml -- $ARCHIVEMAIL < /dev/null

Fixing zotero with OpenOffice

Zotero had been working fine in combination with OpenOffice until a recent update.

After the update, attempts to insert a citation gave an error message:

‘Firefox could not load the component required to communicate with your word processor. Please ensure that the appropriate Firefox extension is installed, then try again.’

A useful reply on

http://forums.zotero.org/discussion/8795/openoffice-plugin-error-firefox-could-not-load-the-component/

said to try removing the icedtea6-plugin package, i.e.:

sudo apt-get remove icedtea6-plugin

I did this and Bingo! The Zotero problem was fixed.

(This was on ubuntu 9.10.)
Continue reading ‘Fixing zotero with OpenOffice’

nmh – very slow scanning folders

I started having problems within MH-E recently – folder completion was taking a very long time – between 1-2 minutes!

After posting to the MH-E mailing list, Jeffrey Honig questioned if it was a locking issue. He was right, and removing the locks resulted in a massive speedup.

——————————————–

Jeffrey> I have 510 folders and it takes 2 seconds. ?My first guess
Jeffrey> would be file locking. ?Do you have any links to
Jeffrey> directories outside your home dir where you can not write
Jeffrey> .lock files. ? Is nmh configured for .lock files? Thanks

Good call!

cd ~/Mail
find . | egrep -i "\.lock"

produced


./ebay/.mh_sequences.lock
./Trust/SMTL/.mh_sequences.lock
./non-urgent/.mh_sequences.lock
./Contacts/andy.xxxxxxx/.mh_sequences.lock
./Contacts/linuxemporium/.mh_sequences.lock

I removed all of these. Now:

/usr/bin/mh/folders -noheader -norecurse -nototal +Contacts
0.08s user 0.19s system 28% cpu 0.956 total

Thanks for that. Would never have thought of it being a locking issue.

Just to demonstrate that it was these locking files:

touch ./Contacts/andy.xxxxxxx/.mh_sequences.lock
time /usr/bin/mh/folders -noheader -norecurse -nototal +Contacts
0.08s user 0.21s system 0% cpu 1:16.00 total


rm ./Contacts/andy.xxxxxxx/.mh_sequences.lock
time /usr/bin/mh/folders -noheader -norecurse -nototal +Contacts
0.07s user 0.22s system 26% cpu 1.107 total

I.e., 1 min 16 sec with the lock in place, 1.1 sec without.

Thanks Jeffrey.

Regards
Pete

HOWTO: how to fix problem with lyx 1.5.3 crashing with Ubuntu Hardy Heron 8.04 LTS

I have been having regular crashes with lyx under my Hardy Heron install.

The problems range from lyx crashing when I try to edit a table, through to crashing when trying to read a file it had just saved. The error messages are usually:

lyx: SIGSEGV signal caught
Sorry, you have found a bug in LyX. Please read the bug-reporting
instructions in Help->Introduction and send us a bug report, if
necessary.

Reading the lyx mailing list, it appears that this been narrowed down to problems with the qt libraries, specifically the 4.4.0 versions. These are not installed by default on Hardy, but are if you have the backports repository enabled (my reading of the posts suggests that the 4.4.0 libraries come from Debian unstable). Micha (michf@post.tau.ac.il) on the list explained that by downgrading from 4.4 to 4.3.4 he was able to get lyx working again.

This is my list of instructions for how I did this downgrade.

1 – Fix the repositories to get rid of the backports one:

using synaptic, I unchecked the box for backports in the Settings/Repositories menu.

ran a reload in synaptic, Then closed down synaptic. Rest will be done from command line as root

2 – Remove the affected packages.

at a terminal, as root, I ran:

apt-get remove libqt4-core libqt4-gui libqtgui4 libqt4-svg libqtcore4 libqt4-network libqt4-script libqt4-dbus libqt4-opengl libqt4-designer libqt4-core libqt4-xml libqt4-test libqt4-assistant

which came back with:

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-backports-modules-2.6.24-16-generic unison adept-installer
libkbluetooth0 adept-updater adept kaffeine kwin-style-crystal
libboost-signals1.34.1 lyx-common atlas3-base skype-common
libboost-filesystem1.34.1 adept-notifier linux-headers-2.6.24-16-generic
linux-headers-2.6.24-16
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED
apport-qt hwdb-client-kde jockey-kde kdebluetooth kubuntu-desktop
language-selector-qt libqt4-assistant libqt4-core libqt4-dbus
libqt4-designer libqt4-gui libqt4-network libqt4-opengl libqt4-script
libqt4-svg libqt4-test libqt4-xml libqtcore4 libqtgui4 lyx python-qt4
python-qt4-dbus skype software-properties-kde speedcrunch
system-config-printer-kde
0 upgraded, 0 newly installed, 26 to remove and 28 not upgraded.
After this operation, 75.6MB disk space will be freed.
Do you want to continue [Y/n]?

At this stage I copied the list of packages being removed so that I could reinstall the ones I needed later.

then I said ‘y’ to the prompt and it removed all the various packages.

3 – now reinstall the necessary packages.

apt-get install libqt4-core libqt4-sql libqt4-gui libqt4-qt3support

these all installed OK so now time to reinstall the programs which were deleted last time.

first of all I tried lyx on its own:

apt-get install lyx

which worked ok.

plus these other programs:

apt-get install apport-qt hwdb-client-kde jockey-kde kdebluetooth kubuntu-desktop
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
linux-backports-modules-2.6.24-16-generic unison atlas3-base skype-common
linux-headers-2.6.24-16-generic linux-headers-2.6.24-16
Use ‘apt-get autoremove’ to remove them.
The following extra packages will be installed:
language-selector-qt python-qt4 python-qt4-dbus software-properties-kde
speedcrunch system-config-printer-kde ttf-unfonts-core
Suggested packages:
python-qt4-dbg
The following NEW packages will be installed
apport-qt hwdb-client-kde jockey-kde kdebluetooth kubuntu-desktop
language-selector-qt python-qt4 python-qt4-dbus software-properties-kde
speedcrunch system-config-printer-kde ttf-unfonts-core
0 upgraded, 12 newly installed, 0 to remove and 28 not upgraded.
Need to get 13.6MB/13.7MB of archives.
After this operation, 40.0MB of additional disk space will be used.
Do you want to continue [Y/n]?

I said ‘y’ and they all went on OK.

When I fired up lyx, it opened the files it crashed on previously with no problems, and I could edit the tables which also caused it to crash previously, so it looks like everything is now sorted. I accept that there may be some programs from backports hanging around which may cause problems, but I’ll deal with them one by one as they crop up.

mh-e article referenced on GTD times

Oliver Starr over at GTD Times has posted about my mh-e article. ‘Cool beans’ as my brother would say!




Switch to our mobile site