Author Archives: verens

more music scams…

last year, I wrote about some scams where people claimed to be looking for music lessons for their son or daughter.

So far, I have not had one single student for guitar come to me through email or the Internet. Every single request has been a scam.

Here is an example email I received today from andrewbarton67@yahoo.com (Andrew Barton):

Hello,

I’m Andrea Barton during my search for a Music Instrument Lessons teacher that would always take my Daughter (Gwyn) and I found your advert.Your advert looks great and it is very okay to me since you specialize in the area I am seeking for her. My daughter will be coming to your Country before the middle of July for 2 Months. She is just 15yrs Old, a beginner, I want you to help me teach her music during her stay in the Country because i will not want her to less busy, i want her to engage in something to keep her busy during her stay.

So, kindly let me know your charges cost per week in order for me to arrange for the payment before she travels down to your country.I would also like to know if there is any Text Book you will recommend for her as a beginner so that she will be reading privately at home after the lesson during her stay.

Please Advise back on;

(1) Your charges per 1 hour twice a week for 2 Months?

(2) The Day and time you will be available to teach her During the week?

(3) Tuition address?

I will be looking forward to read from you soonest.

Best Regards.

There are a few things about this which should immediately strike anyone:

  • People don’t usually mis-spell their own name. Is it Andrea (in the text) or Andrew (in the email address)?
  • There is no mention of what instrument the girl is supposed to be learning. Guitar? Piano? Didgeridoo?
  • The weird capitalisation says to me that translation software has been used, and only for some specific words. I can imagine a template that goes something like this: “I’m ________ during my search for a ________________ teacher that would always take my ________ (____) and I found your advert”. Every one of the blanked out words was inserted with capital letters.
  • There’s a lot of talk about countries – “your Country”, “the Country”, “down to your country”. This person obviously does not know what country I am in, yet knows that his/her daughter will be coming to it?
  • As for that, “My daughter will be coming to your Country before the middle of July for 2 Months.” The email arrived at 2 in the morning today. It’s the 18th of July. A real request for upcoming lessons would surely arrive weeks or months before the trip had already started?

There is a quirky little urge in me to take this as far as I can. However, I’m also not made of time, so I won’t bother.

So here’s the warning: NEVER trust an email from anyone you don’t know.

Here’s how this would pan out if I took it seriously:

  1. We agree price and dates.
  2. They send a cheque and urge me to cash it. I go to the bank and do so.
  3. I suddenly receive an urgent email saying there’s been an error and they sent me too much, and to please send back the extra money.
  4. Of course, that involves me writing and sending a cheque of my own.
  5. They then cash my cheque.
  6. Their cheque then bounces….
  7. The student never turns up.

So don’t be an idiot. Either throw these email in the spam directory (or delete it), or have fun trying to get the guy to do ridiculous things, but never take it seriously.

Btw: here’s an example of this same exact person being a bit over enthusiastic with the attempts – 9 copy/paste messages, with two separate daughters, Rita and Marsha – this guy should probably have got the kids lessons when they were younger…

audio alerts for php errors

I tend to keep a log tailing in one console while working in another.

tail is a Linux program that displays the last few lines of a file. If you run tail -f /var/log/httpd/error_log as root, or as your normal user if you’ve set the right permissions, then you will see any errors as they are added to the log.

However, I also tend to get immersed in my coding and not notice any errors until they cause a visual problem.

What I needed was a program that would watch my log, and beep to get my attention if an error was added.

This article explains how to set that up in Fedora.

First, install the program swatch:

[root@ryuk ~]# yum install swatch

Now create /etc/init.d/swatch, which is the startup/shutdown script for the logger:

#!/bin/sh

case "$1" in
'start')
                /usr/bin/swatch --daemon --config-file=/etc/swatch-httpd-errors --tail-file=/var/log/httpd/error_log --pid-file=/var/run/swatch-httpd-errors.pid
                ;;
'stop')
                PID=`cat /var/run/swatch-httpd-errors.pid`
                kill -9 $PID
                ;;
*)
                echo "Usage: $0 { start | stop }"
                ;;
esac
exit 0

Notice the two file locations in the /usr/bin/swatch command – the configuration file location, and the log file to be tailed.

Make the file executable:

[root@ryuk ~]# chmod +x /etc/init.d/swatch

Now create the configuration file, /etc/swatch-httpd-errors:

watchfor /PHP Parse error|PHP Fatal error/
        exec mplayer /home/kae/sounds/beep-8.wav > /dev/null 2> /dev/null

You can have swatch do basically anything, from sending an email, to flashing lights in your face if you have them connected to the computer. All I wanted was a little beep.

Change the exec command to whatever your want.

I started experimenting by having Arnold Schwarzenegger yell “What the hell are you doing??” at me, but that could get annoying for other people. In the end, I changed it to a beep – a very /short/ beep. More of a tick than a beep.

Now start up the daemon:

[root@ryuk ~]# /etc/init.d/swatch start

Create a php script with an error in it, and view it in your browser. You should get a satisfying beep.

If you want to have this run automatically when the laptop boots, add the above command to the /etc/rc.local file.

long beep short beep short beep

Bronwyn’s laptop just “died”. She turned it on, there was a beep sequence (“long short short”), then nothing appeared to happen.

All the lights were on, the fan was running and there appeared to be activity, but nothing showed on the monitor.

The problem, it appears, is that the GPU overheats too easily and was soldered incorrectly to the motherboard by HP (it’s a HP Pavilion dv2000). When it overheats, the solder melts. When the computer is turned off, the solder solidifies and shrinks, breaking the connection with the GPU, causing the laptop to fail to turn on the video when next booted up.

The proper solution is to replace the GPU, or at least to re-solder the connection and improve the thermal flow around the chip. Unfortunately, I’m just not technically able to do that.

The temporary solution is:

  • Place the laptop on a cushion so the air intake ports are blocked.
  • Turn on the laptop.
  • Let it overheat for ten minutes or so. This will melt the solder again, re-establishing the connection.
  • Turn off the laptop.
  • Turn on the laptop.

Obviously, this is a temporary solution until I can get the cash to pay for a new laptop for her. After that, the laptop joins my collection of broken laptops and will be used for something or other that doesn’t need a working video card.

piano grade 2 results arrived

I did the grade 2 exam three weeks ago. The results just arrived: “successfully passed in the second grade examination in Pianoforte with first class honours”

Cool, I’ll shove that certificate up on the piano next to last year’s one.

I’m going for grade 3 in September. Was meant to do grade 2 a few months ago, but couldn’t find anywhere close that would do the examination. The nearest was in Louth, but that’s too far to walk.

Here are the examiner’s notes:

Max Marks Requirements Examiner’s Comments Marks Awarded
15 Scales & Arpeggios Very good. Good choice of speed but make sure you keep it nice and steady! Very good tone. 13
10 Sight Readng Very good. Mind the counting 9
10 Ear Tests Very good. 9
5 Theory Excellent. 5
20 First Piece Sonatina in G: You caught the mood well. Nice fluent performance. Good phrasing, tone, dynamics and technique. 18
20 Second Piece Waltz: Another lovely performance. Very good balance in left hand melody. Great attention to detail. Very enjoyable! 19
20 Third Piece Samba: Excellent rhythm throughout. Very good range of dynamics and good use of arm weight. Good control throughout. Well done! 18
Total/Additional Comments: Congratulations! Keep up the excellent work! 91

As you can guess, I’m pretty happy about this!

I’m hoping the keep up the high marks for the next exam. My teacher says my pieces for that exam are already at “pass” level, so three more months of practice can only improve that!

I’m hoping to have enough money next month (royalties from my last book) to afford a new piano and a camera, so may be able to stick some tunes online soon.

review: Expert PHP5 Tools

In short: great overview of the various tools and processes that can be followed to make working in PHP easy and manageable. I have a new employee here in the office who will be getting this book after me, to quickly bring her up to speed on good practices.

The Good

As you might guess from the “new employee” comment, even though the word “Expert” is in the title, you don’t need to be an expert PHP programmer to use this book. It’s an all-round overview of the programs you might use during your day-to-day programming life for the next few years.

As the author (Dirk Merkel) suggested in the book, some people may disagree with some choices in the book. For example, I am a fervent Vim user, but the book chooses Eclipse as its programming environment of choice.

From a broader point of view, the Eclipse IDE may be the correct one for programmers to use, as it offers much more than just a text editor. As for me, it’s hard to change an old dog’s habits!

The book includes some handy reference notes for various tools, such as SVN or phpDocumentor. It’s good for people that are not used to reading online references for everything to have them all in one book.

Each chapter is immensely in-depth. To the point that it’s almost like each chapter is a mini-book on its own subject. In some cases the chapters include everything you might ever use on those subjects.

For myself, I’m interested to try some of the suggestions in the Continuous Integration chapter and throughout the book, as I already run a few projects where updates are more important than releases. I’m especially interested in integrating SVN with automated testing and style-checking. Test-driven Development is described in the book, and it certainly seems more robust than my current “deadline-driven development” style!

The Bad

There were code samples in there that could have been shortened immensely by choosing a different spacing scheme or reducing the comments. For example, in the Debugging chapter, there is a code sample that goes on for 9 pages. That’s a lot of code to read… If the empty lines and comments had been removed or reduced, Dirk could have cut it down to maybe 4 or 3 pages, making it much more readable in print. As it was, I did my best to read through it, flipping back and forth between pages to find where references went or came from.

The Ugly

Actually, there wasn’t really anything in this book that I’d call ugly, apart from the overly long code examples.

Conclusion

Immensely useful for the professional programmer. Especially a programmer who needs to fit into a team.

I’m no beginner myself, and picked up quite a few tips throughout the book.

Buy this book – it’s worth it.

update: CMS design with jQuery and PHP

I got an “urgent” email recently from my Packt coordinator – she told me that if I kept writing my book at the rate I was writing, then it would end up being about 500 pages.

Thing is, though – it would be tricky to reduce the chapters I’ve already done, as a half explanation is as good as no explanation at all.

So, I looked over the planned chapters again, and saw that the final three could probably be dropped without affecting the core content of the book – they were just more example plugins showing how to integrate various things with the CMS.

The book itself is on how to build a CMS in PHP, that uses jQuery to make administration easier. That has been accomplished already in the existing chapters (1-7).

I suggested to Packt that I would drop the final three chapters and rework the earlier chapters so the book was more easily read (a 40-page chapter is /not/ easy to read).

Got an email back from them yesterday saying that the plan sounded good.

So the current plan is:

  • Finish chapter 8, which is on panels and widgets.
  • Write chapter 9, which will build a plugin demonstrating panels and widgets.
  • Try to break the earlier chapters apart so that there are more chapters, with less pages per chapter.
  • profit

I think I’ll be finished the current chapters within three weeks, then take a week or two to rework the earlier chapters, then another month for rewrites, and finally the book will be published 2/3 weeks later.

So, the book may be out within two months.

After this, I’m taking a break from modern technology to write about baroque technology – I’ll be writing a book on how to build a cheap clavichord.

happy birthday KFM

KFM is 4 years old today:

http://verens.com/2006/05/27/file-manager-for-fckeditor-day-one/

demos of older versions no longer available, but it’s interesting to know that it’s lasted four years!

of particular interest in my own case, is that there has been no major functionality change in the last two years or so. KFM today is basically the same as KFM two years ago; just faster, more secure, and better coded.

KFM 1.4.6 released

KFM 1.4.6 has been released.

This is partly a security update, so upgrade your installation.

While writing up a post about KFM for the webworks blog, I realised that KFM is 4 years old in 2 days!

This post from 2006 describes the first day’s work on the project.

closing a filament-group menu on mouseout

The filament group menu plugin is one of the better ones out there.

But it has a few flaws. One of the major ones is that they’re not developing it anymore, leaving that to the jQuery UI team. But, development on that is really painfully slow… I don’t expect to see a working menu for months. Even the demos linking from the jQuery UI Menu page are hardly inspiring – they’ve got practically no functionality at all. Hardly useful.

For that reason, I’m okay with taking the current fgmenu code and extending it.

Here’s a simple fix, which has been asked for on their blog. I can’t comment on it because comments are closed.

To close menus onmouseout, all you need to do is to add a mouseout to all menu items, and if it’s triggered, then a second or so later, close all menus.

Obviously there’s a little more to it than just that. Read the code if you want the full details.

Just add this bit to your fg.menu.js file:

$('.fg-menu,.fg-menu-top-level')
  .live('mouseover',function(){
    this.mouse_is_over=true;
    clearTimeout(window.fgmenu_mouseout_timer);
  })
  .live('mouseout',function(){
    this.mouse_is_over=false;
    window.fgmenu_mouseout_timer=setTimeout(function(){
      var o=0;
      $('.fg-menu,.fg-menu-top-level').each(function(){
        if (this.mouse_is_over) o++;
      });
      if(!o){
        $.each(allUIMenus, function(i){
          if (allUIMenus[i].menuOpen) { allUIMenus[i].kill(); };
        });
      }
    },2000);
  });

what I'm up to

As usual, I’m behind on stuff.

I just submitted chapter 3 of my upcoming book “CMS Design with PHP and jQuery”, and chapter 4 was due to be complete and sent two days ago.

My clavichord project stalled when the cumulative number of mistakes made it incredibly unlikely I’ll complete it in a usable fashion.

In work, I’m behind on a pretty large online-store project, but in that case I’m okay with it – I wasn’t slacking; things are just very busy at the moment.

My piano playing has also stalled – I’ve been trying to learn The Heart Asks Its Pleasure First for the last month. I’m stuck on the final page, where the left hand is all over the place and the right has an intricate tune to play. Its all in my head, but I just can’t play it smoothly. Thinking of putting that on the back-burner and going onto Bach’s 2-part inventions instead.

upcoming

Packt have asked me to review Expert PHP5 Tools. Looking forward to it. It’s got some stuff in it which I’ve read about but never tried. Including: UML design of applications, incorporating tests into subversion submissions, and automated documentation of source (among other things).

My piano teacher found an examiner who will be testing in Monaghan next month, so I’ll finally be able to get grade 2 out of the way. I’ve been practicing grade 2 and 3 tunes for months. Playing 6 tunes every day before I do anything else has been reducing th amount of time I have for the rest of my practice, so I’ll be glad to get this one passed as well.

I’m trying to push myself to get the current book finished as soon as possible. This is difficult as writing a CMS is a much more complex job than writing a cookbook of techniques. The chapter I just finished had 40 pages in it. By the 40th page of the previous book I was already into chapter 3. Chapter 2 wasn’t much smaller either!

When this book is finished, I’ll be starting a new one, on building a clavichord as cheaply as possible. Because I failed with the current one, but learned quite a lot from it, I feel I’ll get it right this time, and would like to document it as I go. There’s a lot of math involved in building a clavichord, and I think I may even get a good programming application out of it!

After that, I’m thinking of starting up contact juggling again, and completing the book, this time with videos.

When I get the time, I’d also like to get back into building robots. I think the gardening robot is a bit beyond me at the moment (involves some very complex AI), but I thought I’d try build a digger bot. You tell it what you want dug, where to put the debris, etc., and it gets to work.