coooooongratulation !!!

Tuesday November 20, 2012 - 03:53am by darkhacker
as you can see Noob MCgarry your website is fucked !!?

more

Permalink. There is a comment.

Tickle my bumper

Monday September 12, 2005 - 10:42pm by greg
Years of playing computer games eventually has to catch up with you.  My brother must have forgotten he was driving his car and not playing ATV Fury 3.

Permalink. There is a comment.

eBay buys Skype

9:32pm by greg
So it seems everyone is talking about eBay's purchase Skype for $2.5B.  That's a lot of dinero.

Some interesting comments have been circulating.  For a company with a CapEx of $2M, a purchase of _42_ times it's revenue.  It's an expensive deal.  And I cannot exactly see the business model for the merger of free phone calls and auctioning.

It will be interesting to see how the markets respond.  I have this feeling that there might be some jostling by other players for their own VoIP infrastructure.

Permalink. There is a comment.

How to crash OS X

Sunday September 11, 2005 - 6:24pm by greg
I'm really starting to get annoyed at the lack of documentation that Apple provide for their proprietary interfaces.  First, I couldn't work out the crypto API, now I cannot get their NDRV socket interface to work.  Even if you do find documentation (like header files), it's quite often wrong.

In fact, the following code will quite successfully take down my machine.  Run it, wait 5 seconds and hit Control-C.  Not a blue screen of death, but they do tell you to hard reset the machine in many different languages. 

#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <strings.h>
#include <errno.h>

#include <net/ndrv.h>

#include <net/if_types.h>
#include <net/if_dl.h>

int fd;
struct sockaddr saddr;

int create_socket(void)
{
   fd = socket(AF_NDRV, SOCK_RAW, 0);
   if(fd < 0) {
      printf("socket() error = %d (%s)\n", errno, strerror(errno));
      return errno;
   }
   return 0;
}

void create_socket_address(char *name)
{
   saddr.sa_len = sizeof(struct sockaddr);
   saddr.sa_family = AF_NDRV;
   strcpy(saddr.sa_data, name);
}

int bind_socket(void)
{
   int err = bind(fd, &saddr, sizeof(struct sockaddr));
   if(err != 0) {
      printf("bind error = %d (%s)\n", err, strerror(errno));
      return err;
   }
   return 0;
}

void set_listening_protocol(void)
{
   struct ndrv_protocol_desc desc;
   struct ndrv_demux_desc demux_desc[1];

   bzero(&desc, sizeof(desc));
   bzero(&demux_desc, sizeof(demux_desc));

   desc.version = NDRV_PROTOCOL_DESC_VERS;
   desc.protocol_family = 0xdeadbeef; //PF_NDRV; // PF_IPX;
   desc.demux_count = (u_int32_t)1;
   desc.demux_list = (struct ndrv_demux_desc*)&demux_desc;

   demux_desc[0].type = NDRV_DEMUXTYPE_ETHERTYPE;
   demux_desc[0].length = sizeof(unsigned short);
   demux_desc[0].data.ether_type = htons(0x6667);

   int result = setsockopt(fd, SOL_NDRVPROTO, NDRV_SETDMXSPEC, (caddr_t)&desc, sizeof(desc));
   if (result != 0)
   {
      printf("setsockopt error = %d (%s)\n", result, strerror(errno));
      exit(-1);
   }
}

int server(void)
{
   // Create the socket (needs super-user privileges - use 'sudo')
   int err = create_socket();
   if (err != 0)
   {
      return err;
   }
  
   // Ethernet 0 (built-in)
   create_socket_address("en0");

   // Bind socket
   err = bind_socket();
   if (err != 0)
   {
      printf("unable to bind to socket");
      return err;
   }

   set_listening_protocol();

   char buffer[2048];
   printf("Waiting for packet\n");
   int addr_len = sizeof(saddr);
   int n = recvfrom(fd, buffer, 2048, 0, &saddr, &addr_len);
   printf("%d bytes read\n", n);

   return 0;
}


int client(void)
{
   // Create the socket (needs super-user privileges - use 'sudo')
   int err = create_socket();
   if (err != 0)
   {
      return err;
   }
  
   // Ethernet 0 (built-in)
   create_socket_address("en0");
  
   // Bind socket
   err = bind_socket();
   if (err != 0)
   {
      printf("unable to bind to socket");
      return err;
   }

   char buffer[2048];

   // destination
   int i;
   for (i=0; i<6; i++)
      buffer[i] = 0xff;
   // source
   buffer[6] = 0x00;
   buffer[7] = 0x0d;
   buffer[8] = 0x93;
   buffer[9] = 0x60;
   buffer[10] = 0x85;
   buffer[11] = 0x8a;

   buffer[12] = 0x66;
   buffer[13] = 0x67;

   int n;
   n = sendto(fd, buffer, 14, 0, &saddr, sizeof(struct sockaddr));
   if (n < 0)
   {
      printf("Error writing to socket\n");
      return -1;
   }
   printf("wrote %d bytes\n", n);

}

int main (int argc, const char * argv[])
{
   int rv;
   pid_t pid = fork();
   if (pid < 0)
   {
      printf("fork failed\n");
      return -1;
   }
   if (pid)
   {
      rv = server();
   }
   else
   {
      sleep(3);
      rv = client();
   }

   printf("finished\n");
   return rv;
}

Permalink. There are no comments.

Free iTunes music

Friday September 09, 2005 - 9:17pm by greg
This afternoon I have been playing with GarageBand.  This application usually since on my desktop doing nothing until NIN releases another track in GarageBand format.  It's a nice piece of software and relatively easy to use.

And here is the track that I created [1MB].  The file is in Apple's m4a format, which is the AAC codec.

It's fun, but I don't think I'm going to make a living off it.  At least with a title like this one, I'm likely to get some hits on the blog.

Permalink. There are no comments.

Petrol prices and the bike

Thursday September 08, 2005 - 11:32am by greg
Petrol prices in North America have once again increased to amazing levels.  Usually the petrol price in Canada is less than 90 cents per litre.  The last week it has been at $1.14 per litre.  The price always seems to track the US media stories and is currently linked to the Cyclone in New Orleans.

Not that the prices bother me too much, since I don't have a car.  I do sympathise with the car drivers and seek to find new technologies to ease this problem.

And this month I have decided not to get a monthly Translink pass and I am riding the bike round town.  Last night I rode the bike to social soccer.  The soccer field is in a difficult place; on the other side of the Skytrain loop.  Catching the Skytrain to soccer requires a 20-minute walk, a 35-minute Skytrain loop and another 5-minute walk.  Who'd have though that the bike ride would only turn out to be 35 minutes.  So now I'm saving myself 25 minutes (x2) each week going to soccer.  It's a real win.

Navigating, while riding a bike, is very different to driving a car.  I'm always on the lookout for the optimal route to my destination based on the least number of traffic lights and the least number of hill climbs.  It conserves my energy.  And the same approach can be used by all the car drivers in these times of expensive petrol prices.  There's an opportunity here!

And on my return journey from soccer, I was wondering if Google maps could add an elevation criteria to its travel planner.  I could then get a satellite image of my energy-conserving, optimal route to soccer.  And it wouldn't be this one.  The google route picked two huge hills to climb.  What was it thinking!

Just an idea...

Permalink. There is a comment.

A calculator story

Monday September 05, 2005 - 10:19pm by greg
Lately I've been inspecting bits heading out over the wire (or the ether, in this case), and comparing them against the code and the standards. Of course, the standards tend to specify constants in decimal while the bits coming off the wire are hexadecimal.  Well, there's only so many times you can scribble conversions on a piece of paper before you start to miss your calculator.

Although I have this grunty CPU sitting in front of me, I have never found a calculator software capable of comparing with my trusty Casio fx-82c.  And I really miss my old calculator when I have to do base conversions.

My Dad bought me the Casio calculator when I was 13 years old.  I had that calculator through high school, the engineering degree and took it to New Zealand.  I didn't bother packing it in my backpack to bring it to North America.  Maybe I should have?

So, this weekend I surveyed the calculators at Staples.  It's a popular office-supplies store in Canada.  Who'd have thought it could be so much fun.  It took literally an hour to check them all out, and come to the conclusion that nothing really can match my trusty-old fx-82c.  In the end, it was a compromise: get one that does base conversion and forget about the other features.

I now have a Canon F-502.  It really broke the bank at $8.97 + tax + tax.  It does have one thing over the fx-82c.  It does complex calculations.  But I doubt I'll every use that feature; that's why I have this grunty CPU sitting in front of me. 

Permalink. There is a comment.

Tour de White Rock

Tuesday August 30, 2005 - 10:01am by greg
Late Saturday afternoon I went down to White Rock, BC.  It's located on the coastline, about 2 miles north of the US border.  Recently, it's become the trendy place to live in the lower mainland, so I thought I'd go and check it out.

And it's a nice place!  The "beach" is actually a rock beach, but the miriad of colours in the rocks makes a walk along the beach particularly enjoyable.  A good path system connects all parts of the beachfront.  The main street is full of beachside-style shops, including restaurants, ice-cream parlours and fish-n-chips shops.  And the fish-n-chips make a very enjoyable dinner, sitting on the water-edge.

The name of the city does actually come from a large white rock sitting on the edge of the water.  These days the rock is almost always covered with children climbing on it and turning its white colour dark.  So, the rock is now painted white to preserve its historic colour.  Well, actually, it looks like a tacky tourist attraction now, but it really is an authentic landmark.  It's amazing to consider how the rock arrived there!


The houses on the side of the hill are apparently worth upwards of $800k each, so I won't be living there.  But I did suspect that two miles on the other side of the border the housing prices aren't likely to be so high.  After all, why would an American want to live this far north?

Permalink. There are no comments.