Entries posted in March 2005

XLib automation

Monday, 28 March 2005

Musings on Control

A while back I wanted a simple system for automating sending text messages via the internet.

There are a few friends I’ve got on different plans where I can send them messages via a form on the internet. And I wished to automatate this so I could say “at 9pm send this”.

However i couldn’t work out how. The obvious solution of WWW::Mechanize doesn’t work in my case because of the extensive use of Javascript a lot of providers want.

So I came up with another plan.

SendKeys

SendKeys is a thing that Visual Basic programmers might recognise, it’s a simple means of injecting keypresses into windows.

I wrote some XLib code for faking key presses + releases into random windows and all is good.

I could then write a simple parser which understood two options:

  • Executing a program
  • Sending keys to it.

My first program was:

#!/home/skx/bin/faker
execute mozilla-firefox http://www.random.com/
sendkeys "[tab]5555-1234[tab]This is a message[tab][ret]" 

This works, but it doesn’t allow for much customization, or flexability.

It also didn’t deal well with the popup windows I have to use for some programs, where I want to use something more complex.

I realised I needed to use conditionals:

if ( ! findWindow( "mozilla-firefox"  ) )
  execute( "mozilla-firefox" );
fi

..

So I have three choices:

  • Write a proper grammar and parser.
  • Rewrite my code as a Perl/Ruby/Python extension and do the logic in that.
  • Hookup my functions “execute”, “sendkeys”, “findwindow”,etc to the C intepretter cint

I think I like the idea of the last one best .. but I’m probably going to be doing one of the first two.

Perl is my favourite language, but this would be a fun way of learning to write Ruby extensions.

Of course now I need to think of a name!

I guess we’re talking of something that is analagous to “expect”, but for GUIs.

Right now I’m thinking of something like XLib::SendKeys.

| No comments

 

Blogging ...

Saturday, 26 March 2005

Less is more.

| No comments

 

Voting and Writing.

Friday, 25 March 2005

Debian Vote

I’ve made my vote for the Debian Project Leader election…

I was pondering the current setup last night, and I think it would be interesting to investigate the idea of having the DPL stand for a “release term” – rather than a year.

I can’t decide if this would be a good thing or not, but at least I think it would be an interesting change.

Other stuff

The ngrep package is now in better shape after the recent upload.

I sponsored the introduction of skippy into the Debian archive – it’s a funky tool for switching between open windows. I recommend you check it out if you’re into desktop toys.

A few new articles have been written:

More are pending, I guess not working is giving me more time to experiment with things and write.

Planet Trivia

More people arrive at my site(s) via planet.debian.net than via planet.debian.org – Historical artifact?

| No comments

 

SSP Firefox

Thursday, 17 March 2005

SSP Firefox

Yesterday before going to bed I rebuilt Mozilla Firefox from source to see how well it would work.

Took a good few hours to finish the build, but it was very straightforward:

apt-get install debian-builder
debian-builder --verbose mozilla-firefox
cd /var/cache/debian-builder/debs
dpkg --install mozilla-firefox*.deb

No major problems detected so far, plugins all continue to work, as does java.

There’s a problem with the builder though, about 8 packages which were installed to complete the build were not removed – so I had to remove them manually.

Maybe builidng inside a chroot-jail would work better?

| No comments

 

IRC Interviews

Wednesday, 16 March 2005

DPL Election

Well the IRC question & answer sessoin is over now.

I missed it “live” due to being asleep, but reading it afterwards was enlightening.

I hesitate to criticise the execution, being a non-contributor…. But perhaps next year to avoid people with bogus IRC settings, or the pasting truncation we might have a trial session in advance?

We could have test questions such as:

  • What is the air speed velocity of an unladen swallow?
  • What’s your favorite colour?
  • Tell me about your childhood .. childhood .. childhood
  • Complete the following limerick ;)

Etc.

The most obvious problem was there were a few replies that were truncated – they were restored afterwards. It’s a shame something as simple as a “BEGIN” + “END” to each response would have helped – and next time it’s something we’ll know.

Thanks all round to the organizers, the people submitting the questions, and of course the candidates themselves.

| No comments

 

Hijack + Picture + Promotion

Tuesday, 15 March 2005

Gotya

I have a new hackergotchi courtesy of gnrfan.

Hijack

In other news I hijacked ngrep which I feel a little bad about.

Pimping

After a bit of free money came my way I bought some Google Adwords to promote my site. So far there have been a lot of impressions but few clicks – I may have to tweak my keywords, or wordings.

It’s certainly an interesting experiment, perhaps the next thing to do is advertise myself for doing remote admin jobs? I’d be interested in how most consultants get recommended? I know that I’ve got happy customers, but in diverse locations so it doesnt seem to do me much good in the word-of-mouth advertising.

I guess the obvious thing to do is send them all a mail and ask if they’ll contribute an “endorsement” on my site .. still I feel that’s being a little pushy, and nine times of ten when I read an endorsement on a random web page I assume it’s faked anyway.

Guess I’m too cynical!

| No comments

 

Gtk + Debian

Monday, 14 March 2005

Cams

I updated my webcam snapshot taking software so that it’s more cleanly organised in terms of both source code and GUI.

I had a horrible time making the preferences work properly in Gtk which is probably my error, and I think the solution I came up with is suboptimal. Still seems to work.

Debian

“The once universal Operating System”

I’m in two minds about the proposed changes post-Sarge. On the one hand it seems to be a workable solution. On the other hand I have a couple of intel boxes before me, and a Sparc.

Guess we’ll wait and see how it plays out. One thing is sure though, the last thing we need is another flame-fest.

| No comments

 

Coding: GtkCam

Friday, 11 March 2005

Steve in code writing shocker!

I’ve been writing original code this morning for the first time in months, and I feel fine!

Once upon a time I wrote a simple console application to grab a single frame from a webcam and output it to a .jpg file, camgrab. I’ve used this off and on ever since to take still images from my webcam, or to place shots online with a timer.

But it’s very frustrating to write the following then realise you’re not in the shot properly, or the lighting sucks

sleep 1 ; camgrab

So I decided to solve this by writing a GUI which would show a preview – like the applications I’ve seen people use on Windows.

I have a main window which shows the live view from the webcam, updating every half second. When you click on the main window it will save the currently displaying image to a numbered) file.

This allows a lot more flexaiblity.

I’m suprised something like this doesnt exist already, but I couldn’t find anything with a quick search except for camstream which seems like a lot of overkill for me. I guess it does the same job but in a sexier way. (I notice it doesn’t use temporary files, so I should investigate it’s code).

I’ve used:

  • GTK
  • ImLib2
  • giblib
  • The Linux videodev interface

The code is nasty it grabs a frame, writes it to a temporary file, then updates the GUI. I can’t seem to display an imlib2 image to a GtkImage object without that step – which seems to suggest I’m missing something obvious.

If there are any comments asking I’ll post the source online. Nothing fancy, no timer to countdown or menubars…

Single sample output here (No I’m not that vain, just trying to document weight loss in my arms).

Update – Current source gtkcam. Needs to be refactored and improved.

| No comments

 

Birthday + Security

Thursday, 10 March 2005

March 10th 2005

Today is my birthday (I’m 29), so I updated my Amazon wishlist for all my lovers ;)

Since I’m not working at the moment I’m not going to be celebrating.

Debian Security

I put together a simple breakdown of the security advisories released by Debian in 2005 after Javier asked if anybody had spare time.

He saw the Ubuntu security breakdown and thought it would be interesting to contrast the two.

I’d like to work on this some more, and actually produce some statistics – if nobody beats me to it I’ll look at this shortly.

| No comments

 

Debian Releases & Hardware

Sunday, 6 March 2005

Debian Releases

I was struck by a thought yesterday evening when I was half asleep: Once Sarge is released what will happen to apt-get.org and backports.org?

Right now they exist to provide newer pieces of software which aren’t available in Debian’s Woody release.

Once Sarge is out they become obsolete overnight – as all their software should be part of Sarge, and installable without any third party repositories.

Obviously Debian development will continue and over time newer pieces of software will be available in Sid that aren’t part of Sarge, so the backports will become necessary again. But there’s definately a point at which both sites become obsolete.

I guess that means the site admins get a nice break?

Hardware

Today I retired all the broken machines and pieces of hardware I have, in the traditional manner.

I took the boxes that are almost complete, stuck a post-it note on the side describing which pieces worked / and which are broken. Then took them outside my flat and piled the boxes up against the wall.

Come tomorrow I’ll go to work and by the process of magic all the spare parts and boxes will have disappeared.

I left my email address inside each of the cases, just on the offchance that somebody wants to say thanks – or will tell me where they end up.

I’d love to track hardware as it moves around through different hands – much like the Lighter Thief or Book Crossing sites.

| No comments

 

apt-get install apache2

Wednesday, 2 March 2005

New Article

Upgrading from Woody -> Sarge, Apache2 covers basic setup and the differences in using the apache2 package.

It also includes brief instructions on setting up an SSL host with Apache2.

This is also article 101 on the site, I’ve personally slowed down writing but it seems like the readership is growing.

| No comments

 

Recent Posts

Recent Tags