List folders and not sub files/folder of folders in Linux

http://www.cyberciti.biz/faq/linux-list-just-directories-or-directory-names/

Well done again cyberciti. Excellent solution

As it says on the link, add these to ~/.bash_profile

alias lf="ls -l | egrep -v '^d'"
alias ldir="ls -l | egrep '^d'"

Then (article aught to remind you of this) bring it to life with .  ~/.bash_profile

Leave a Comment

UFO’s over Macclesfield? Surely not

On Saturday 3rd Jan 2009, 7 of us traveled together in the area of Macclesfield. 3 adults and 4 children. I guess around 10pm.

In disbelief one of the passengers spotted 3 amber circular orb-like entities in the sky overhead. They were not traveling particularly fast but were either flying in ‘formation’ or part of  a single larger object. We actually pulled over and got out to look at them.

Also this in the news:
http://news.bbc.co.uk/1/hi/england/lincolnshire/7817378.stm

There must be other people in the Macclesfield area that also saw these things. Please let me know if you did.

I’m not a great believer in UFO’s and don’t watch the X-Files but it’s hard to dismiss them. This is the 3rd time something like this has happened. The previous experience was when 3 of us traveled one evening from Renne, France to Bristol, UK in a Piper Commander, G-BASJ – must have been around 1995. For about an hour a light seemed to be off out on the port wing about a mile away. It was like looking into the opening of a hot hair ballon. Nobody really said anything (did more looking actually) but when eventually we did start discussing it one of us took the matter up with the radar control (I don’t remember which of us or what control, Brize, Exeter or Bristol maybe) and reported this. They had nothing on their radar showing including any other air traffic. This thing just left as we got closer to land – nobody saw it go, it just vanished.

Thanks

Kevin

Leave a Comment

Royal Mail – Will you send a manager round to pick up someones mail from me?

Hells bells! After all the complaining they still send post to people in the wrong town!

I’m sure there a lot of quality people at Woolworths that would do a better job of delivering the post.  (God bless them. I hope it works out).
There are no words in my lexicon. Royal Mail is a law unto itself and has no shame. Apparently Monkeys are smart enough to know what street they are in. I dont know what its coming to really.

———- Forwarded message ———-
From: Kevin Yeandel <********@*****.com>
Date: 2008/12/22
Subject: holding post for stockport address
To: “contactus@royalmail.com” <contactus@royalmail.com>
Cc: postalreview@royalmail.com

Dear Sir

Last week, when I was overseas, I received the post of Mr and Mrs John Y*****ll, 10 W*****r D*******, Stockport.
As you well know from your own memory and the tens of times I’ve already had to write to you, my address is 10 ******** *******, Macclesfield and I have my post redirected, at least, most of it gets redirected, some of it not – sort-of, ad-hoc and random really.

The only relevant address details on this particular midelivered letter were the fact that both the Y*****ll’s and I live at a house no. 10 and the first 2 letters of the postcode.
True, there is a vague similarity in our last names and I do have an uncle John – though he lives in Swindon,  not Stockport – both words beginning with S of course.

I recall very clearly a written dialogue which was replied to where I explained to Royal Mail what would happen the next time I received the post of another intended recipient.
I stated that I will expect a manager from your company to come to my house by prior appointment to collect the misdelivered mail.

I’m now adding to that requirement the unedited completion of the remainder of the information I am entitled to under the terms of the Data Protection Act. Not the breach of UK law and ‘effort’ ms Hazel *unawad*n* sent.

In the mean time, I will write to the intended recipient of the document I am holding for them and notify them as to why I have not forwarded their post with the advice for them to contact you about the matter.
I will not be providing them with my address and you will not either.

In the mean time, while you think about how to handle this, please enjoy this video of monkeys working in a Japanese Tavern.
http://uk.youtube.com/watch?v=glNS4cvkhmw&NR=1
If you ever have the drive to improve your delivery service you could possibly take the same approach. Apparently these very capable monkeys work for bananas, they are not members of unions, never strike and will give you no reason to be fightened of them.

As I don’t anticipate hearing from you before I go away for Christmas, may I take this opportunity to wish you ‘happy holidays’ and a more profitable, less problematic New Year.

Yours faithfully.

Kevin Yeandel

Leave a Comment

CPAN Perl installing stuff

wget your package by saving link and pasting it into your putty session.

e.g.

wget http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Scalar-List-Utils-1.19.tar.gz

unzip and untar and change to the directory with the Makefile.PL

Then,

perl Makefile.PL
make
make install
make test
You should get no errors or spot missing dependencies. Repeat the same process for the missing parts until complete.

Leave a Comment

xml on php 5.1.x and obsolete google code fix

Some of the google php example code does not work in php 5 dot something.

And also you might find this map stuff certainly wont work properly in the versions of Firefox that exist at the time of this post. Something to do with ajax I believe. This code fixes that.

Over the years, lots of people hunting down fatal errors like:

undefined function: domxml_open_mem() or

Call to undefined function domxml_new_doc()

and its evident they are trying to make work the same sample code that I have. (The correct code is now on the google site btw)
The problem might be that they are using the wrong version of code with the release of PHP they have installed. The internet has been sending people down the wrong tracks trying to solve the problem.
It is also apparent that 5.x of PHP has, by default, the modules available for handling php.
Some basic checks first before moving onto the code:

To get it working in Centos you need to have  libxml2.x86_64 0:2.6.26-2.1.2.6 libxml2.i386 0:2.6.26-2.1.2.6

which means yum install libxml2

You should check the modules dir, e.g. /usr/lib64/php/modules/ for the presence of dom.so

Look at your php.ini (usually in /etc)

extension=dom.so

may not be necessary, errors like

PHP Warning: Module ‘mysql’ already loaded in Unknown on line 0 that appear when trying to run code from the command line may occur because in /etc/php.d/mysql.ini the module is already declared and subsequently loaded, therefore you can edit out the extentions = section of your /etc/php.ini

I’ve butchered the code of Google to suit my own application and table def. The critical lines changed are

$doc = new DOMDocument(‘1.0′);    (was create_document)
$node = $doc->createElement ….    (was create_element)
$doc->appendChild($node) …          (was append_child)
$newnode->setAttribute(“…             (was set_attribute)
$xmlfile = $doc->saveXML($markers_node);           (was dump_mem)

<?php

require(“./phpsqlajax_dbinfo.php”);

// Start XML file, create parent node

$doc = new DOMDocument(‘1.0′);

$markers_node = $doc->createElement(“markers”);$parnode = $doc->appendChild($node);
//markers_node is a node we’ll need as part of the FF fix. Basically somehow an extra line gets inserted which contains whitespace which leads to the error, Error: XML or text declaration not at start of entity. It will still work in IE though.

// Opens a connection to a mySQL server

$connection=mysql_connect ($mysql_host, $mysql_login, $mysql_pass);

if (!$connection) {

die(‘Not connected : ‘ . mysql_error());

}
// Set the active mySQL database

$db_selected = mysql_select_db($mysql_db, $connection);

if (!$db_selected) {

die (‘Can\’t use db : ‘ . mysql_error());

}
// Select all the rows in the markers table

$query = “SELECT * FROM ch_points WHERE 1″;

$result = mysql_query($query);

if (!$result) {

die(‘Invalid query: ‘ . mysql_error());

}
header(“Content-type: text/xml”);
// Iterate through the rows, adding XML nodes for each

while ($row = @mysql_fetch_assoc($result)){

// ADD TO XML DOCUMENT NODE

$node = $doc->createElement(“marker”);

$newnode = $parnode->appendChild($node);
$newnode->setAttribute(“name”, $row['owner']);

$newnode->setAttribute(“address”, $row['postcode']);

$newnode->setAttribute(“lat”, $row['lat']);

$newnode->setAttribute(“lng”, $row['lon']);

$newnode->setAttribute(“type”, $row['phases']);

}
$xmlfile = $doc->saveXML($markers_node);
//This is the other part of the firefox fix. Just pump out the nodes we need via markers_node.
echo $xmlfile;
?>

Leave a Comment

Warning to customers of BitDefender

Once BitDefender has your card details you’re screwed.

Another faceless company that treats you like dirt once they have your payment.

Not all software is bad. In 2007 I discovered fabulous packages like OpenLaszlo and Blender – so good they are beyond words. But at the other end of the spectrum, little is more is appauling than BitDefender.

I chose the product to protect my PC from viruses etc. based on poll results which, if my experience is anything to go by, these results are completely bogus and probably rigged. 

I bought BitDefender for 4 machines. One machine is on 24/7 as it forms part of a security system.
It became unstable and ran out of memory – despite increasing the swapfile to its limits, it had to be rebooted weekly.

The removal of BitDefender has since resulted in complete stability and it only requires boots after mandatory OS patches.

2 other machines became increasinly sluggish and unuseable. BitDefender services started crashing and refused to start, warning me my machine was not protected. Not the sort of thing I wanted to read.

After a catalogue of problems, I canned BitDefender and tried McAfee and AVG – these were found be far more suitable – the removal of BitDefender offered a noticeable performance increase on these machines.

BitDefender have ignored what is now 4 communications in cancelling auto-renewals. This is something that should be possible to be done through their web interface but unfortunately, they have constructed it in such a way that you can’t cancel (at least I can’t find a way to and have screen-shotted their web interface.)

Taking that on board with the fact that they ignore web and standard emails to them, you are left with facing the problem of cancelling your credit card. If they wont communicate then there is no other option: either take the renewal or cancel the card or force the card company to get involved (the least painful).

Frankly this is an awful company with zero PR cabability and an inadequate technical support department that does not seem to be able to read basic English.

Leave a Comment

load words into mysql table using infile

mysql> load data infile ‘/mnt/everyone/wordlist.txt’ into table words fields terminated by ‘\r’;

where the table is called words and has a field called word

Leave a Comment

Up and running with ADM5120P

In particular the Omnima SKU16140 from
http://www.omnima.co.uk/store/catalog/Embedded-controller-p-16140.html

Operating System : Squidge 1.7
Booted from USB.
Serial connection – telnet available from JP2, 115000,N,1,8. (USB to serial from Omnima works in XP HyperTerminal but not Vista). Pin 1 on JP2 aligns with dot on connector
Default IP address: 192.168.1.1  Change in /etc/config/system
HTTP running by default.  Create index.html in /www
Package installer: opkg
Package Location: /www/squidge/packages

Resources:
http://openwrt.org/
http://www.linux-mips.org
http://squidge.sourceforge.net

Turn on an LED
root@OpenWrt:/etc/config# echo 0 > /sys/class/gpio/export
root@OpenWrt:/etc/config# echo out > /sys/class/gpio/gpio0/direction
root@OpenWrt:/etc/config# echo 1 > /sys/class/gpio/gpio0/value

Full explanation of the above and further details to be found at:
http://squidge.sourceforge.net/gpio/

 

We’re told to scn the sources from the relevant http site which will create a folder called squidge.
Do not run the installation as root as it wont work. You have to be some other user.
Further, the authors advise the use of slackware 12.1, the problem being you need some sort of p2p like bittorrent to get it. So I tried with Centos 5. The following had to be done.
When you follow the instructions the process of building an image will break by not being able to find a file.
cd to  openwrt and run

%make V=99

If you don’t use the flag then make will appear to hang. This is because you are being asked a question.
Before you get to this, a configuration screen will be shown enabling you to configure the packages which can be included in the build. 

The rest of the process should continue and resolve missing packages by connecting to the internet – though I noticed one such connection could not be established.

Leave a Comment

October 6 – Site not accessible

Since my posting yesterday, the Load Average in a 1 minute interval hit 99.97 – never seen it so high.

Yesterday evening there were no mysql connections available.
As I write this my site is unavailable. It has been tested by people in different locations. Port 443 is not being resolved.

This will probably be a short category… I have sent an official complaint to the MD, Ditlev, and advised him I intend migrating to another supplier in the immediate future.

This company is a complete waste of time and should be avoided at all cost.

Leave a Comment

UK2.NET – rebooted October 5th

Load averages up in the 13’s also earlier.

Server: cpanel6.uk2.net

Unexpected reboot again – caused loss off data.
October 5th 2008

top – 20:03:51 up  4:35,  1 user,  load average: 8.00, 10.50, 8.67
Tasks: 205 total,   1 running, 200 sleeping,   0 stopped,   4 zombie
Cpu(s):  2.5% us,  1.6% sy,  0.0% ni, 82.2% id, 13.7% wa,  0.0% hi,  0.0% si
Mem:   2074328k total,  1698032k used,   376296k free,   269800k buffers
Swap:  4008208k total,      208k used,  4008000k free,   468860k cached

PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
3272 mysql     16   0  136m  45m 4128 S  4.7  2.2  24:01.74 mysqld

Leave a Comment

« Newer Posts · Older Posts »