weblog d’un abbe

20080229

FreeBSD 7.0-RELEASE released

Filed under: Yippee!! — abbe @ 1243

I know its late, but I just came to know about this. Happy FreeBSDing.

20080219

freed.in

Filed under: Fun, Yippee!! — abbe @ 0141

freed.in - Big Banner - 728x90

freed.in 2008 is back. And this time, the theme is knowledge shall set you free. Though I’m not able to attend freed.in on 22nd, but will be there on 23rd and 24th. Following is the list of talks, I’m interested in, lets hope they don’t conflict ;) :

Hope to see you there :)

20080217

Want to try NASM 2 on Gobuntu

Filed under: Hacking — abbe @ 1909

Interested in trying out NASM 2 (which supports AMD64 Instruction Set :) ) on Gobuntu Gutsy, or Hardy, then you can add my Launchpad PPA‘s repository to your /etc/apt/sources.list as given below for Gutsy and Hardy:

# For Gutsy
deb http://ppa.launchpad.net/wahjava/ubuntu gutsy main
deb-src http://ppa.launchpad.net/wahjava/ubuntu gutsy main

# For Hardy
deb http://ppa.launchpad.net/wahjava/ubuntu hardy main
deb-src http://ppa.launchpad.net/wahjava/ubuntu hardy main 

And after this you can install nasm and nasm-doc (contains nasm manual) packages using following command:

abbe [~] chateau $ sudo apt-get update && sudo apt-get install nasm nasm-doc

The packages are unsigned, so you’ll get a warning when trying to do apt-get. Any happy NASMing :)

20080216

Using accumulator to prevent signals from continuing further

Filed under: Hacking — abbe @ 0416
// How to use accumulator to control signal
// delivery in GLib2
// (C) 2007. Ashish Shukla

#include <glib-object.h>
#include <glib.h>
#include <glib/gprintf.h>

G_BEGIN_DECLS

#define TEST_OBJECT_TYPE                 (test_object_get_type())
#define TEST_OBJECT(obj)                 (G_TYPE_CHECK_INSTANCE_CAST((obj), TEST_OBJECT_TYPE, TestObject))
#define TEST_OBJECT_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST((klass), TEST_OBJECT_TYPE, TestObjectClass))
#define TEST_IS_OBJECT(obj)              (G_TYPE_CHECK_INSTANCE_TYPE(obj, TEST_OBJECT_TYPE))
#define TEST_IS_OBJECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE(klass, TEST_OBJECT_TYPE))
#define TEST_IS_OBJECT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), TEST_OBJECT_TYPE, TestObjectClass))

typedef struct _TestObject TestObject;
typedef struct _TestObjectClass TestObjectClass;

struct _TestObjectClass {
  GObjectClass parent;

  guint sig_test;
};

struct _TestObject {
  GObject parent;
};

G_END_DECLS

G_DEFINE_TYPE(TestObject, test_object, G_TYPE_OBJECT) ;

static GObject*
test_object_constructor(GType type,
			guint n_props,
			GObjectConstructParam* props)
{
  TestObjectClass* klass;
  GObjectClass* pc;

  g_printf("Test Object constructor()\n");

  // dispatch the parent class constructor.
  klass = TEST_OBJECT_CLASS(g_type_class_peek(TEST_OBJECT_TYPE));
  pc = G_OBJECT_CLASS(g_type_class_peek_parent(klass));
  
  return pc->constructor(type, n_props, props);
}

static gboolean
test_accumulator(GSignalInvocationHint* hint, GValue* return_accumulator,
		 const GValue* return_handler, gpointer data)
{
  g_printf("closure %d called\n", hint->detail);

  hint->detail++;

  // only allow 3 signal invocations
  if(hint->detail >= 3 )
    {
      g_printf("signal aborted\n");
      return FALSE;
    }

  return TRUE;
}

static void
test_object_trigger_test(TestObject* object)
{
  g_printf("Triggering test on %p\n", object);
  g_signal_emit(object, TEST_IS_OBJECT_GET_CLASS(object)->sig_test, 0);
}

static void
test_object_class_init(TestObjectClass* klass)
{
  GObjectClass* object_class;

  object_class = G_OBJECT_CLASS(klass);
  object_class->constructor = test_object_constructor;

  klass->sig_test = g_signal_new("test", G_TYPE_FROM_CLASS(klass),
				 G_SIGNAL_RUN_LAST, 0,
				 &test_accumulator, NULL,
				 g_cclosure_marshal_VOID__VOID,
				 G_TYPE_INT, 0, NULL);

  g_printf("In class_init() routine, registered signal id: %d\n", klass->sig_test);
}

static void
test_object_init(TestObject* self)
{
  g_printf("Init test_object_init() routine\n");
}

#define DEFINE_TEST_SIG_HANDLER(x) \
  static int test_handler##x(void) { g_printf("In handler " #x "\n"); return x; }

DEFINE_TEST_SIG_HANDLER(0)
DEFINE_TEST_SIG_HANDLER(1)
DEFINE_TEST_SIG_HANDLER(2)
DEFINE_TEST_SIG_HANDLER(3)
DEFINE_TEST_SIG_HANDLER(4)

int
main()
{
  TestObject* object;

  g_type_init();

  object = g_object_new(TEST_OBJECT_TYPE, NULL);

  g_printf("created.\n");

  g_signal_connect(object, "test", test_handler0, NULL);
  g_signal_connect(object, "test", test_handler1, NULL);
  g_signal_connect(object, "test", test_handler2, NULL);
  g_signal_connect(object, "test", test_handler3, NULL);
  g_signal_connect(object, "test", test_handler4, NULL);

  test_object_trigger_test(object);

  g_object_unref(object);


  g_printf("un-reffed\n");

  return 0;
}

Outputs:

abbe [gobject] chateau $ ./test
In class_init() routine, registered signal id: 2
Test Object constructor()
Init test_object_init() routine
created.
Triggering test on 0x607020
In handler 0
closure 0 called
In handler 1
closure 1 called
In handler 2
closure 2 called
signal aborted
un-reffed

20080205

paulgraham.com not resolvable

Filed under: Fun — abbe @ 1359
abbe [~] chateau $ whois paulgraham.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

   Domain Name: PAULGRAHAM.COM
   Registrar: NETWORK SOLUTIONS, LLC.
   Whois Server: whois.networksolutions.com
   Referral URL: http://www.networksolutions.com
   Name Server: NS5.STORE.YAHOO.COM
   Name Server: ST-NS1.YAHOO.COM
   Status: clientTransferProhibited
   Updated Date: 28-dec-2006
   Creation Date: 29-oct-1998
   Expiration Date: 28-oct-2009

>>> Last update of whois database: Tue, 05 Feb 2008 08:18:10 UTC <<<

NOTICE: The expiration date displayed in this record is the date the 
registrar's sponsorship of the domain name registration in the registry is 
currently set to expire. This date does not necessarily reflect the expiration 
date of the domain name registrant's agreement with the sponsoring 
registrar.  Users may consult the sponsoring registrar's Whois database to 
view the registrar's reported date of expiration for this registration.

TERMS OF USE: You are not authorized to access or query our Whois 
database through the use of electronic processes that are high-volume and 
automated except as reasonably necessary to register domain names or 
modify existing registrations; the Data in VeriSign Global Registry 
Services' ("VeriSign") Whois database is provided by VeriSign for 
information purposes only, and to assist persons in obtaining information 
about or related to a domain name registration record. VeriSign does not 
guarantee its accuracy. By submitting a Whois query, you agree to abide 
by the following terms of use: You agree that you may use this Data only 
for lawful purposes and that under no circumstances will you use this Data 
to: (1) allow, enable, or otherwise support the transmission of mass 
unsolicited, commercial advertising or solicitations via e-mail, telephone, 
or facsimile; or (2) enable high volume, automated, electronic processes 
that apply to VeriSign (or its computer systems). The compilation, 
repackaging, dissemination or other use of this Data is expressly 
prohibited without the prior written consent of VeriSign. You agree not to 
use electronic processes that are automated and high-volume to access or 
query the Whois database except as reasonably necessary to register 
domain names or modify existing registrations. VeriSign reserves the right 
to restrict your access to the Whois database in its sole discretion to ensure 
operational stability.  VeriSign may restrict or terminate your access to the 
Whois database for failure to abide by these terms of use. VeriSign 
reserves the right to modify these terms at any time. 

The Registry database contains ONLY .COM, .NET, .EDU domains and
Registrars.NOTICE AND TERMS OF USE: You are not authorized to access or query our WHOIS
database through the use of high-volume, automated, electronic processes. The
Data in Network Solutions' WHOIS database is provided by Network Solutions for information
purposes only, and to assist persons in obtaining information about or related
to a domain name registration record. Network Solutions does not guarantee its accuracy.
By submitting a WHOIS query, you agree to abide by the following terms of use:
You agree that you may use this Data only for lawful purposes and that under no
circumstances will you use this Data to: (1) allow, enable, or otherwise support
the transmission of mass unsolicited, commercial advertising or solicitations
via e-mail, telephone, or facsimile; or (2) enable high volume, automated,
electronic processes that apply to Network Solutions (or its computer systems). The
compilation, repackaging, dissemination or other use of this Data is expressly
prohibited without the prior written consent of Network Solutions. You agree not to use
high-volume, automated, electronic processes to access or query the WHOIS
database. Network Solutions reserves the right to terminate your access to the WHOIS
database in its sole discretion, including without limitation, for excessive
querying of the WHOIS database or for failure to otherwise abide by this policy.
Network Solutions reserves the right to modify these terms at any time.

Get a FREE domain name registration, transfer, or renewal with any annual hosting package
- or just $8.95 with monthly packages.

http://www.networksolutions.com

Visit AboutUs.org for more information about PAULGRAHAM.COM
AboutUs: PAULGRAHAM.COM 




Registrant:
Graham, Paul
   19 Avon St
   Cambridge, MA 02138
   US

   Domain Name: PAULGRAHAM.COM

   ------------------------------------------------------------------------
   Promote your business to millions of viewers for only $1 a month
   Learn how you can get an Enhanced Business Listing here for your domain name.
   Learn more at http://www.NetworkSolutions.com/
   ------------------------------------------------------------------------

   Administrative Contact, Technical Contact:
      Graham, Paul              paulgraham@YAHOO.COM
      19 Avon St
      Cambridge, MA 02138
      US
      617 661 2452 fax: (408) 731-3301


   Record expires on 28-Oct-2009.
   Record created on 29-Oct-1998.
   Database last updated on 5-Feb-2008 03:18:44 EST.

   Domain servers in listed order:

   ST-NS1.YAHOO.COM             209.191.66.175
   NS5.STORE.YAHOO.COM          

abbe [~] chateau $ dig ns paulgraham.com @resolver2.opendns.com

; <> DiG 9.4.1-P1 <> ns paulgraham.com @resolver2.opendns.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36056
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;paulgraham.com.                        IN      NS

;; ANSWER SECTION:
paulgraham.com.         172796  IN      NS      ns5.store.yahoo.com.
paulgraham.com.         172796  IN      NS      st-ns1.yahoo.com.

;; Query time: 315 msec
;; SERVER: 208.67.220.220#53(208.67.220.220)
;; WHEN: Tue Feb  5 13:13:40 2008
;; MSG SIZE  rcvd: 83

abbe [~] chateau $ dig ns paulgraham.com @ns5.store.yahoo.com

; <> DiG 9.4.1-P1 <> ns paulgraham.com @ns5.store.yahoo.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35645
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;paulgraham.com.                        IN      NS

;; AUTHORITY SECTION:
.                       3600000 IN      NS      A.ROOT-SERVERS.NET.
.                       3600000 IN      NS      B.ROOT-SERVERS.NET.
.                       3600000 IN      NS      C.ROOT-SERVERS.NET.
.                       3600000 IN      NS      D.ROOT-SERVERS.NET.
.                       3600000 IN      NS      E.ROOT-SERVERS.NET.
.                       3600000 IN      NS      F.ROOT-SERVERS.NET.
.                       3600000 IN      NS      G.ROOT-SERVERS.NET.
.                       3600000 IN      NS      H.ROOT-SERVERS.NET.
.                       3600000 IN      NS      I.ROOT-SERVERS.NET.
.                       3600000 IN      NS      J.ROOT-SERVERS.NET.
.                       3600000 IN      NS      K.ROOT-SERVERS.NET.
.                       3600000 IN      NS      L.ROOT-SERVERS.NET.
.                       3600000 IN      NS      M.ROOT-SERVERS.NET.

;; Query time: 330 msec
;; SERVER: 209.191.66.226#53(209.191.66.226)
;; WHEN: Tue Feb  5 13:14:02 2008
;; MSG SIZE  rcvd: 243

abbe [~] chateau $ dig ns paulgraham.com @st-ns1.yahoo.com

; <> DiG 9.4.1-P1 <> ns paulgraham.com @st-ns1.yahoo.com
; (1 server found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5379
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;paulgraham.com.                        IN      NS

;; AUTHORITY SECTION:
.                       3600000 IN      NS      A.ROOT-SERVERS.NET.
.                       3600000 IN      NS      B.ROOT-SERVERS.NET.
.                       3600000 IN      NS      C.ROOT-SERVERS.NET.
.                       3600000 IN      NS      D.ROOT-SERVERS.NET.
.                       3600000 IN      NS      E.ROOT-SERVERS.NET.
.                       3600000 IN      NS      F.ROOT-SERVERS.NET.
.                       3600000 IN      NS      G.ROOT-SERVERS.NET.
.                       3600000 IN      NS      H.ROOT-SERVERS.NET.
.                       3600000 IN      NS      I.ROOT-SERVERS.NET.
.                       3600000 IN      NS      J.ROOT-SERVERS.NET.
.                       3600000 IN      NS      K.ROOT-SERVERS.NET.
.                       3600000 IN      NS      L.ROOT-SERVERS.NET.
.                       3600000 IN      NS      M.ROOT-SERVERS.NET.

;; Query time: 360 msec
;; SERVER: 209.191.66.175#53(209.191.66.175)
;; WHEN: Tue Feb  5 13:14:12 2008
;; MSG SIZE  rcvd: 243

abbe [~] chateau $ dig soa paulgraham.com

; <> DiG 9.4.1-P1 <> soa paulgraham.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36764
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;paulgraham.com.                        IN      SOA

;; Query time: 709 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Feb  5 13:16:08 2008
;; MSG SIZE  rcvd: 32

It seems someone messed up WHOIS records or DNS RRs in early morning. So, until someone fixes the problem, welcome to http://web.archive.org/*/www.paulgraham.com/. Wayback Machine rocks :)

UPDATE: paulgraham.com is back. It seems I’m sensitive to intermediate states ;).

Create a free website or blog at WordPress.com.