Archive for the '*nix' Category

6th Nov, 2007, 11:16am

The definitive guide to Apache, Subversion & AD LDAP on Debian

After struggling for ages with different guides on ldap, Apache & Subversion, I found the following guide, and everything just worked after following it. Kudos to Sander.

You can read the article in full here.

Here’s the: http://www.jejik.com/articles/2007/06/apache_and_subversion_authentication_with_microsoft_active_directory/

No Comments yet »

18th Oct, 2007, 9:18am

Making Thunderbird more Mutt like

I used to be a big mutt fan, but with the growing amount of HTML mail I recieve, it became too much of a chore, combined with the fact that IMAP offline support is a bit kludgy (I’ve used both isync & offlineimap) I abandoned mutt some time ago and move to Thunderbird.

Thunderbird has better offline IMAP support, but it’s very mouse driven, but there are some handy extensions that can make it easier to use from the keyboard. I’m using GMailUI and keyconfig. GMailUI gives you j/k support, and single key archive (these are UI features lifted from GMail, but we all know that they came from vi/mutt originally)

I don’t use Thunderbird’s spam filters, I have a sendmail/cyrus/spamassassin mail setup, and I keep it trained using folders on the IMAP server, this also means that the rest of my family should get the benefit of my spam training.

A shorter version of this is that I want to press a single key to move a mail to a certain folder, without invoking Thunderbird Junk Mail stuff.

keyconfig to the rescue!

  • Install keyconfig
  • Open the keyconfig menu (Tools, Keyconfig)
  • Click “Add a new key”
  • Call it what you like (mine is MoveToJunk)
  • Enter the following code:
    MsgMoveMessage('imap://simon@mccartney.ie/INBOX/Junk');

    Where simon@mccartney.ie is the name of the IMAP account I’m using and Junk is a subfolder of the Inbox (as far as Cyrus is concerned, everything is a subfolder of the Inbox, unlike other IMAP systems).

  • Click OK
  • Assign a key against it (I use Shift-J, which meant I also had to un-map the existing Junk Control keys using keyconfig, look As Junk & As Not Junk and click reset.
  • Ahhh, keyboard heaven!

No Comments yet »

4th Aug, 2007, 10:32pm

Using GPRS Easy Connect 3.0.1 with Ubuntu 7.04 (Edgy Eft)

I’ve been playing around with some cobbled together pppd & chat scripts to get my Novatel Wireless U630 working under Ubuntu, with a Vodafone UK Data SIM (I think most of the problmes come from VF UK’s DNS Servers being broken in some odd way)

One of the many resources for APN settings etc is from the GPRS Easy Connect web site, http://gprsec.hu, (other great resource are filesaveas and Taniwha). After I got my stuff working by hand, I thought I would have a play with their tool that wraps all there settings together. I hit some problems installing from the source package (the supply rpms, but no .deb files), here’s how they were resolved:

wget http://www.gprsec.hu/downloads/GPRS_Easy_Connect_301.tar.bz2
tar xvjf GPRS_Easy_Connect_301.tar.bz2
cd GPRS_Easy_Connect_301
sudo ./INSTALL.sh
./INSTALL: error while loading shared libraries: libgtk-1.2.so.0: cannot open shared object file: No such file or directory

This easy resolved via the libgtk1.2 package:

sudo apt-get install libgtk1.2

Take #2:

sudo ./INSTALL.sh
Gtk2:TrayIcon perl module [Error]

Better, but still some problems, this one is easy resolved, using the libgtk2-trayicon-perl package:

sudo apt-get install libgtk2-trayicon-perl

BTW, it’s fairly easy to identify these packages required by playing about with apt-cache search, in this case:

apt-cache search trayicon | grep perl
libgtk2-trayicon-perl – Perl interface to fill the system tray

After that, the source package was able to complete it’s installation.

PS, here are the cobbled together scripts are working for me, YMMV.
/etc/ppp/peers/vodafone-U630
/etc/chatscripts/vodafone-U630
/etc/ppp/ip-up.d/2override-dns (prepends the PPP IPCP supplied DNS servers with your own DNS Server of choice)

I just kick this off with a “pppd debug vodafone-U630″ in a root terminal window.

PPS The Windows based Novatel tool is able to tell me all sorts of into about signal strength etc, as is the 3rd party tool MWConn, I wonder are there any specs around that would let us get similar info in a non-Windows environment?

No Comments yet »

28th Aug, 2006, 6:02pm

Bright Ideas II: Photo Tagging

I use a mix of photo gallery software, I use Flickr for some things, notable stuff that’s public for other people to use, I also use Fuzzy Monkey‘s My Photo Gallery, which is simple, but has some neat features (like auto thumbnail generation, keeps photos and thumbnails seperate, allowing me to use Unison/rsync to keep my online photos in sync with an offline copy, simple passwording etc).

But I’m beginning to dig tagging, so I hoked about for some web gallery software that does this, and there seems to be a real shortage, I found Original and a modification of it that supports tagging, but it mix of php & python, and I couldn’t get my head round all of the Python.

So this got me thinking about what is the best way to generically tag my photos so that the will work in my online gallery and with my offline tools. Microsoft have added a couple of tags in the EXIF standard, eg XPKeywords. There is some stuff on XMP, Extensible Metadata Platform from Adobe. IPTC gets mentioned quite a bit, and is also supported by Google’s latest incarnation of Picasa, but is supposedly being phased out in favour of XMP.

Notably all of this is support by Phil Harvey’s ExifTool, which is a Perl library and CLI tool.
All of this comes under metadata, i.e. it’s data about the images. So, where to start? Well, I think I need to do the following:

  • Decide which format to support! (EXIF XPKeywords, XMP, IPTC etc)
    (actually, the gallery should probably support multiple methods, but let’s try and focus on one to start with)
  • Extend My Photo Gallery so that it can scan it’s directory of photo data & build a tag database
  • Extend My Photo Gallery so that is can generate a tag cloud.
  • Extend My Photo Gallery so that it can manage tags in the management UI.

Easy eh?

Where to start? Minimal overhead to start with, probably use SQLite for the tag/photo database, make it scan photos for tags, then work on building a tag cloud. jbrout looks like the thing to start tagging with. Then add tag management to the web UI.
Here’s some of my background reading:

1 Comment »

11th Aug, 2006, 8:02pm

Unison, Cygwin & syncing stuff

I have a Linux VPS account which I use for hosting this and some private photo collections [i.e. personal, not porn!] etc, I used to use Unison to sync my photo directories between my Linux VPS and my Linux Laptop. I’m currently running Windows XP on my laptop, so I was looking for a way of syncing stuff with my off site storage again, after some playing around with different versions of Unison, I settled on running unison from withing Cygwin. I have a bash script that fixes the permissions on the remote filesystem and some other stuff using SSH. Getting ssh-agent to work cleanly in a Cygwin environment is tricky, I found the following tips, and liked this one. It needed some tweaking to work, probably just the knock on effect of having spaces in my $HOME.

This fragment can be used to setup the ssh-agent so that the rest of the commands in the script that use SSH don’t prompt for passphrases (including running unison using ssh)
[quickcode:noclick]
#
# Setup ssh-agent if it’s not already there
# This is where the ssh-agent environment settings are stored for scripts
# using this fragment
SSH_ENV=”$HOME/.ssh/environment”
function start_agent {
echo “Initialising new SSH agent…”
/usr/bin/ssh-agent | sed ‘s/^echo/#echo/’ > “${SSH_ENV}”
echo succeeded
chmod 600 “${SSH_ENV}”
. “${SSH_ENV}” > /dev/null
/usr/bin/ssh-add;
}

# Source SSH settings, if they are there
if [ -f "${SSH_ENV}" ]; then
. “${SSH_ENV}” > /dev/null
# If ssh-agent is dead or gone, start from scratch
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null || {
start_agent;
}
else
# start from scratch
start_agent;
fi
[/quickcode]

After this script, I just call ssh a couple of times to tidy up the remote destination, and then call unison using a profile that also uses ssh, slicker than a greased monkey falling of a pole.

No Comments yet »

7th Aug, 2006, 3:30am

Cut & Shut (I’ve moved to WordPress from Movable Type)

A couple of friends have just started blogging (Keith & Jonny), I was stunned how clean and simple their blogs look. At the same time I’ve been getting frustrated at several things in MovableType (like the lack of any decent online editing tools for creating posts, and the fact that it is painfully slow on my VPS), so I had a quick look at the blogging software they are using, WordPress. I was mightly impressed, it seems to be much slicker & easier to use than MT, I was even more impressed that I could import all my current entries & comments, and that there’s plenty of help in making old links work. So I exported my stuff from MT & imported into WordPress, with the help of notes from here. I’ve also got over my need for everything to be in perl.

The next challenge was to ensure that old links get redirected to the content properly, this was mostly just a technical challenge as this blog is mostly private, I doubt anybody I don’t know reads it, so ensuring that links in search engine indexes is largely moot. (I had to struggle to find a reference to my blog in Google, resorting to restricting it to my site, like this). Anyway, I found a couple of pointers that sent me in the right direction, like one from the WordPress wiki and one from the newer Codex resource.

I ran into some snags in the method used here, mostly because the permalink/archive method I had used in MT was YYYY/MM/entry, so here’s the template I needed:

[quickcode]
<?php
require(‘wp-config.php’);
header(‘Content-type: text/plain’);
?>
<MTEntries lastn=”999999″>
Redirect Permanent /archives/<$MTArchiveDate format=”%Y/%m”$>/<MTArchiveFile>
http://www.mccartney.ie/wordpress/<$MTArchiveDate format=”%Y/%m/%d”$>/<?php echo sanitize_title(“<$MTEntryTitle$>”); ?></MTEntries>
[/quickcode]

This generates a file that us suitable for using as a .htaccess file, making Apache redirect requests for the old MT URIs to the new WordPress URIs. For the category links, I’ve just hand crafted the lines, I only had a couple of categories.

(In writing this post, I’ve discovered some of the problems with quoting PHP in a PHP based system, so I’ve started to read this and promise to make the template above make sense soon, I also found this) Done.

4 Comments »

21st May, 2006, 11:29am

Windows Flaws, Mac OSX Advantages

A good friend of mine, AlanP, sent me this link: http://www.roughlydrafted.com/Oct05.5Flaws.html, which is an interesting discussion design flaws in Windows 2000/XP that aren’t in Mac OSX.

1 Comment »

« Prev - Next »