Personal.X-Istence.com

Bert JW Regeer (畢傑龍)

Birthday -- I am now 19!

My birthday was really good fun. Did not do much all day other than part of my homework, then later that night me and 4 others went out to Outback (all expenses paid for me! Awesome, thanks Kris!). We were planning to go watch a movie but could not find anything we could all decide on.

Instead we headed back home, sat on the patio outside, smoked Hookah and watched TV through MythFrontend on Mark's laptop. It was a great night :D.

Looking for a Job

I am still looking for a job, if you know anything or anyone that is looking for a Linux/FreeBSD systems administrator, programmer or anything of the sorts that would be great. I am located in Laveen, AZ and have limited mobility as I don't own a car.

Will get a resume back online soon.

Signed up for Google Summer of Code

I have signed up for the Google summer of code submitting two applications. One is off course bsdPanel, and hopefully that will be the one that is accepted, the other is the creation of BSD licensed text processing tools. Diff, grep, and sort. Entry on the FreeBSD website.

I am really hoping for bsdPanel though. If I don't get accepted for bsdPanel or the BSD licensed text processing utilities then I will be looking for people to sponsor me working on bsdPanel. If you want the chance to sponsor me, or know someone that is willing to sponsor me, please contact me at xistence [at] gmail [dot] com. It would be in part to cover some of my tuition cost, as well as money for books for school.

Re: Should apple be making fun of Vista UAC?

Should Apple be making fun of Vista UAC? by ZDNet's George Ou -- Windows Vista UAC (User Account Control) has an additional security feature called Secure Desktop that hardens the UAC privilege escalation prompt, but some people seem to be upset with this feature because they say it's annoying. Apple has even gone as far as making a new TV commercial out of it with "PC" being bossed [...]

I disagree, what you have shown here is how UAC shows up when installing an application, however installing an application on Mac OS X can be as simple as drag and drop. Most of the software I download is downloaded in a DMG which you can mount. I can drag it into my Applications folder, and if I have Administrator rights, I won't get asked anything. If I don't have Administrator rights, I can run it right from the DMG or move it into another folder in my home directory aptly named Applications and run it from there. Mac OS X does not ask me for a user-name and password in both those cases, whereas the UAC will ask you if you want to run it as Administrator to install it, even if you would like to place it on your Desktop in a folder named Program Files.

The Mac OS X commercials also seem to refer to the Windows firewall, which asks whether you want to allow incoming or outgoing. When I ran Vista I had disabled the firewall, so I can't say if that is true or not, however I do feel that the Apple advertising is fair. Nothing about it is unfair. I as a user of Windows Vista am unable to run a setup program under any user rights other than that of an Administrator, which allows the installer full access to my entire machine, which is unacceptable to me. In Mac OS X I can drag it to any folder and execute it from there, and it won't have privileges above that of what the user is running at.

Even most .pkg's in Mac OS X can be installed in an alternate location as to not require Administrator privileges, however most if not all .pkg's are .pkg's since they need to install something in /System which is the guts of Mac OS X. For example, SMCFanControl requires this to install a kernel extension.

X11 mouse button pressed

For a Rube Goldberg device I needed a way to know if a mouse button was pressed on the root window of an X11 screen. Here is the code for it:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <unistd.h>

#include <X11/Xlib.h>
#include <X11/Xutil.h>

int main() {

        Display *dsp = XOpenDisplay( NULL );
        if( !dsp ){ return 1; }

        int screenNumber = DefaultScreen(dsp);

        long eventMask = StructureNotifyMask;
        XSelectInput( dsp, DefaultRootWindow(dsp), eventMask );

        XEvent evt;

        eventMask = ButtonPressMask|ButtonReleaseMask;
        XSelectInput(dsp, DefaultRootWindow(dsp), eventMask); // override prev

        do{
                XNextEvent( dsp, &evt );   // calls XFlush()
                if ( (evt.type == ButtonRelease) || (evt.type == ButtonPress) )
                exit(2);
        } while( 1 );

return 0;
}

Compile:

gcc -lX11 -L/usr/local/include x11.c -o x11-mousebutton

Upon a mouse button being pressed it will exit 2, so using that return value in some script you can execute a command. For example, to open a CD rom drive so a domino falls over.