jump to navigation

IE 7 and IE 8 on Linux with Wine 1.1.20 May 5, 2009

Posted by cillian in free software, linux, web development.
10 comments

In an interview with Jeremy White (C.E.O. of CodeWeavers) on The Linux Action Show he mentioned they have IE7 working in CrossOver Office in the latest beta release of version 8 and that the latest version of Wine has lots of improvements that make this possible. I thought I’d try it out as I’m working on a new site and would like to be able to test it. I installed the latest version available for Mandriva 2009.0 in the package manager and did the following dance:

Created a fresh ~/.wine
Ran winetricks and set the version to win2k and installed IE6.
Ran winetricks and set the version to winxp.
Installed IE7:
$ wine IE7-WindowsXP-x86-enu.exe
Installed IE8:
$ wine IE8-WindowsXP-x86-ENU.exe
I think it installed the first time, but when I tried to run it, it threw an error. For no good reason I ran the installer again. After that it works fine (except it doesn’t seem to run any JavaScript). I think it is very usable for testing layout issues.

Some sites throw an error: “Internet Explorer couldn’t download %ws” and not having JavaScript working is a problem, perhaps I’m just missing a dll or something. I think it’s really great news though. I bet the CrossOver Office folks will have this polished pretty soon (if they don’t already).

It’s really phenominal work the Wine community do and it is greatly appreciated. I have no copy of Microsoft Windows and from time to time I really need to run a Windows application (e.g. Tax Software from the Government) and without Wine this wouldn’t be possible. Up until today I could only partially test in IE7 so it is great to know that I now have a way to make sure that sites I make are at least functional in Internet Explorer. Unless the site is for a client I’m not going to go to kill myself trying to make it work perfectly though, I tend to assume that people who use Internet Explorer are accustomed to things not working perfectly :D

Goal oriented searching? May 3, 2009

Posted by cillian in Uncategorized.
Tags: ,
add a comment

I was just wondering if there’s a way to search according to a particular goal. Since we “check for updates” to news items, activity on social networks etc. “read up on” topics in wikipedia, blogs etc. “look for” products, instead of just “searching” by keywords and trying to pick clever ones to get decent results wouldn’t it be nice to express our intention?

http://agents.media.mit.edu/projects/goose/ sounds like a proposal to do something like that, but doesn’t seem to have taken off, and at a glance seems overly complicated with some natural language processing functionality. Since you probably never want to “read about” something on ebay or “shop” on wikipedia is there a simple approach? Could it be that most sites serve a particular goal and would fit into a neat and small set of goals which would be easy to state? I guess something like http://rollyo.com might already have user created searches which could effectively do this, but it seems a bit too manual.

How about adding metadata to a page to indicate it’s purpose? Like keyword metadata maybe this would just be abused by SEOs until it is worthless. Hmm …

Are your modules ready for Drupal 6? October 18, 2008

Posted by cillian in drupal, free software, linux, open source, web development.
add a comment

I was wondering when I could upgrade a Drupal 5 site to Drupal 6 so I knocked out a little script which reads the project page for each Drupal module you have installed and tells you the current releases and the version of Drupal that it can be used with:

http://drupal.org/project/og

Release: 6.x-1.0-rc6        Drupal version: 6.x
Release: 5.x-7.3           Drupal version: 5.x

It’s here:

http://cairde.net/social/drupal-module-status.py

(It requires Python and BeautifulSoup http://www.crummy.com/software/BeautifulSoup)

How to use a git hook to upload to a website that only allows ftp May 18, 2008

Posted by cillian in free software, linux, open source.
Tags: , , , ,
3 comments

NOTE: FIRST SEE THE UPDATE AT THE END FOR A NICER WAY TO DO THIS. USE AT YOUR OWN RISK, THIS WILL PROBABLY DELETE EVERYTHING ON YOUR SERVER AND EAT YOUR GRANDPARENTS!

There absolutely has to be better ways to do this, but with my weak bash-fu and lots of help from the good people on #git I stumbled through and got something working.

I am using gitosis to host a repo that is shared between a couple of people I trust. They have given me their keys and commit via ssh. I just followed the instructions on http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

I used yafc for the ftp part. It was my first time using it and I love it to bits. No more gui ftp clients for me, or plain old ftp either. The bookmark feature is awesome and really helped me out here.

  1. Login to your site via yafc anc save it as a bookmark
  2. Add the script below to your remote repo i.e. login to the server you are pushing to, if you set it up with gitosis you will have /home/git/repos/YourRepo and put it in hooks/post-receive.
  3. Finally make hooks/post-receive executable to enable it (chmod u+x post-receive)

#!/bin/sh

CHANGES=`mktemp -q -t`
FTPSTAGE=”/home/git/YourRepo-ftp/”

while read oldrev newrev refname
do
# This gets the paths of the files in the repo that have changed
# and shows if they are added A, deleted D etc.
echo `git diff-tree –name-status -r $oldrev $newrev` > “$CHANGES”
echo $CHANGES >> /home/git/YourRepo.log
UPLOADS=`cat “$CHANGES” | grep -v “^D” | cut -d” ” -f2`
# The sed expression here is to convert the path in the repo to the path on the server
DELETES=`cat “$CHANGES” | grep “^D” | cut -d” ” -f2 | sed -e ’s/^drupal\/YourRepo.website\///g’`
echo `date` “\nUploading: $UPLOADS\nDeleting: $DELETES” >> /home/git/YourRepo-git-ftp.log
for U in $UPLOADS
do
# Again to change the repo path into the server filesystem path
FTPPATH=`echo “$U” | sed -e ’s/^drupal\/YourRepo.website//g’`
# This dumps the files out of the repo on to the filesystem to be uploaded later
mkdir -p $FTPSTAGE`dirname $FTPPATH`
git cat-file blob $newrev:$U > $FTPSTAGE$FTPPATH
done
done

# Tell yafc to upload everything that has been dumped from the repo
# and delete everything that needs to be deleted
yafc <&lt;**
open YourBookmark
cd /public_html/YourRepo.website
put -fr $FTPSTAGE/*
rm -r $DELETES
close
**

# Tidy up
rm -rf $FTPSTAGE/*

If you’re any good at bash you are probably screaming in disgust right now but if you can spare a minute to explain how to improve this I would be grateful.

Note: this is so lame it doesn’t delete directories that have been created when you delete them from git. It just deletes the files. That’s just because the git command to get the paths doesn’t show when you’ve deleted the directory higher up. It just about works for me now, even though it’s horrible.

UPDATE: Replace all that gubbins with something like the following procedure:
Clone the repo on the server and set up sitecopy to sync that with the live site. Then in the post-receive hook:

cd /path/to/cloned/repo
unset GIT_DIR
git pull
sitecopy -u name

if you don’t change GIT_DIR you’ll see fatal: Not a git repository: ‘.’ even though running the hook on it’s own will work fine.
Thanks to: http://www.mail-archive.com/git@vger.kernel.org/msg03458.html

GMail please put spam in my inbox instead of my inbox in spam April 14, 2008

Posted by cillian in Uncategorized.
Tags: , , , ,
add a comment

I usually only have a look in my gmail spam folder for a laugh. Today I had a look and found it half full of valid emails. Emails related to projects I’m working on, replies to queries I thought I had never received and from people I regularly correspond with. I must see if I can add a filter to move everything from the spam box into my inbox otherwise I have to regularly clean out the spam manually which, I suspect, is going to take all the fun out of the computer generated poetry :(

RTÉ: In The Name Of The Fada (direct links if realplayer doesn’t like you) March 31, 2008

Posted by cillian in gaeilge, linux.
2 comments

Bfheidir toisc go bhfuil mé ag usáid Firefox3 Beta faoi láthair ach ar aon nós níl realplayer ag obair i gceart domsa agus bhí sé choimhseach deacair na nascanna díreach a fháil ón súiomh. Ar eagla gr mhaith le éinne eile breathnú ar an chlár íontach seo ó Des Bishop sheo dhuit:

http://www.rte.ie/tv/inthenameofthefada/watchtheshow.html

#1 rtsp://od2.rte.ie/2008/0313/inthenameofthefada-174675-228.rm

#2 rtsp://od2.rte.ie/2008/0320/inthenameofthefada-175692-228.rm

#3 rtsp://od2.rte.ie/2008/0327/inthenameofthefada-176285-228.rm

#4 rtsp://od2.rte.ie/2008/0403/inthenameofthefada-176843-228.rm

#5 rtsp://od2.rte.ie/2008/0410/inthenameofthefada-177613-228.rm

#6 rtsp://od2.rte.ie/2008/0417/inthenameofthefada-178349-228.rm

whois.py March 1, 2008

Posted by cillian in Uncategorized.
1 comment so far

# We’re looking for a name for the next high end free video editor
# and there are quite a lot of suggestions so far
# to test for available domain names I put this ditty together

# I believe a whois lookup doesn’t really tell you if a name
# has been taken but I guess it’s something

import commands
import sys
import time

if len(sys.argv) == 2:
    namelist = sys.argv[1]
else:
    print “please run it like this: python whois.py filename”

try:
    names = open(namelist, “r”).read().split(“\n”)[:-1]
    print “the following domain names may be available”
    for name in names:
        availabletlds = “”
        for tld in ["com", "net", "org"]:
            domainname = name+”.”+tld
            whoisresult = “”
            while not whoisresult or “fgets” in whoisresult or “LIMIT EXCEEDED” in whoisresult:
                whoisresult = commands.getoutput(“whois %s”% domainname)
                # whois gets upset if you query it too often
                if “fgets” in whoisresult or “LIMIT EXCEEDED” in whoisresult:
                    time.sleep(10)
                if “No match” in whoisresult or “NOT FOUND” in whoisresult:
                    availabletlds += ” “+tld
        print name + ” ” + availabletlds

except Exception, error:
    print error

A simple persistent DIRSTACK in bash January 3, 2008

Posted by cillian in Uncategorized.
add a comment

Here’s a simple way to use a persistent DIRSTACK in bash:

a script in your path called dhs saves your current DIRSTACK:

#!/bin/bash
dirs -l -p > /home/username/.drsk/pwdirs

And another one called dh to loads a dirstack from a file in ~/.drsk/, you may like to use different different dirstacks for separate projects:

#!/bin/bash
for i in `cat ~/.drsk/$1`;
do pushd $i > /dev/null 2>&1
done;
pushd +$( expr ${#DIRSTACK[@]} – 1 ) > /dev/null 2>&1
popd > /dev/null 2>&1
echo “DIRSTACK restored from ~/.drsk/$1″
dirs -v -l

and in your ~/.bashrc you can add:

source dh pwdirs

to load the default. When you adjust your working dirstack you can call `. dhs`to save it and each new terminal you open will use the same one.

Suspend2 and Compiz-Fusion solved January 3, 2008

Posted by cillian in linux.
add a comment

I’ve been waiting for ages for a new nvidia driver to work with suspend so I felt it was time to look for something that works now. I had been killing compiz and emerald manually and then running hibernate, which worked fine, but I really wanted to be able to shut the lid on my laptop and have it suspend and also just hit a button to hibernate. After a diversion into using Ubuntu’s acpi-support utility I found I could do it all with a simple addition to my existing hibernation config.

In /etc/hibernate/common.conf I added:

OnSuspend 20 killall compiz emerald &
OnResume 25 DISPLAY=:0.0 sudo -H -b -u username compiz –replace –sm-disable –ignore-desktop-hints ccp &

I also needed to fix sudo to let me use the DISPLAY but now, at last, it works like a charm!

EDIT: I spoke too soon .. now hibernation seems to often get stuck, bumping up the logging doesn’t reveal anything, nor am I getting any interesting messages in /var/log/messages. I also can’t seem to roll back the changes, I’m wishing I hadn’t touched it now :(

GNOME Do is magic December 14, 2007

Posted by cillian in design, free software, linux, open source, user interface.
add a comment

Quicksilver is a really impressive application that I believe makes a significant improvement to the desktop UI. I don’t think I’ve used it but I’ve seen the Google talk recently, and then heard that it was open source, but sadly still not available on Linux. I have also been a big fan of Gnome-launch-box ever since it came out, but I was getting disappointed that it hadn’t progressed much and by comparison was very basic and a little slow, so I was really delighted to come across GNOME Do today. It’s lightning fast and has some nice features that I haven’t even explored yet. David Siegel has done fantastic work with this and I have no doubt it will be rapidly adopted and widely adored.

GNOME Do (Black)