nullis.net

Posts for the 'Linux' Category (Feed for this category)

Quick fix for twirssi and irssi defunct processes

I noticed just today, that I had a whole heap of defunct processes running on irssi. At first I wasn't sure the cause, but then I noticed twirssi did some fork()'ing in its script (so presumed it had to be it).

On looking, it seems that is the case, and from my calculations, occurs whenever there is a failed update from twirssi (maybe something else as well, I didn't research closely).

While I didn't find a fix for it, I did find an excerpt from a publicly hosted IRC log, which pointed once way to at least get rid of the defunct processes (without closing irssi, or restarting) It was a bit hard to come by, so I'm reposting how to fix it here, so you can run it; and hopefully find it a little bit more easily.

To get rid of all the processes, do this:

/script exec for ($i = 0; $i < N; $i++) { wait; }

Where N is the number of defunct processes you have.

The information comes from here. Thanks to exor674@OFTC for the tip!

Comments 0 CommentsAdd a comment Add Comment

New System

I know it's been a while, but I figured I should make mention to my new "rig" I got.

I decided it was time to upgrade, and for now, I will probably most likely use this as a gaming box, and eventually it will become my general desktop machine.

Specs

So far, since getting it, I have been playing games on it nearly non-stop, something I have missed doing for such a long time. Sure I had the my Console games, but nothing really beats PC Gaming -- And it's true!

Some of the games I've been playing include Assasins Creed, SWAT 4, HL2, Empire Earth and Battlefield 2142.

I did do a 3d Mark rating of it, and it seemed to perform quite well -- of course no where near what the other machine rates at!! (Yes, that's right, it is running Vista -- not because I really want to, but because unfortunately, if i want to run Windows Games, I'm going to need a Windows Install, and in my honest opinion, Cedega is yet to get you close enough not to need one..)

In the next few weeks I will install Linux on it (onto the second hard drive it has), and will post about how that performs. Hopefully I can find something that will challenge the video card under linux (oh and I will give Cedega another try under this machine to see how it goes).

For now, Adios!

Comments 0 CommentsAdd a comment Add Comment

This is Phun

Someone randomly linked to a forum post with this in it today.

Boy is it Phun!

You can check out Phun at www.phun.at. There is versions for Windows and Linux 32 and 64 bit.

Comments 0 CommentsAdd a comment Add Comment

Transition to Django

Having been working on my django based blog for some time now, (when I haven't been busy), I have finally gotten to the stage where transition is almost upon us!

I am yet to properly finish the comments system on it, as I am still unsure how to go about this, but everything else is in place, from the design, to the conversion script. The conversion script is actually quite neat. From a SQL Dump of a wordpress blog, it can successfully transform it into a python list of tuples, from which another script reads this into django.

In other news, Linode improved their value for money, so I went out and got myself one. Maybe thats where the new site will be in future :-)

Comments 8 CommentsAdd a comment Add Comment

iPod

Seems I currently have a fasination for things starting with little i's (iiNet, ideas, now iPod). That's right, now an iPod.

It's not my first iPod, my first was a 30G iPod Photo. It was great, I could listen to music, play games and read text (tho I never did read text ... ). But the problem was, it was too big and bulky, and in the end, it was annoying with other things in my pocket. Oh, and the screen was easy scratched, so it was a pain to read it at times, but you didn't have to most of the time. So for the last while, it had been delegated to just sitting around collecting dust (maybe ill play around with iPodLinux on it, one day).

The other day, however, i went and got my mum a 2nd generation iPod Shuffle for a birthday present. Was at home, setting it up with her favourite music, and decided I would order myself one. So I did, and it arrived today.

Now, when I was setting the first one up, i just plugged it in, and Linux detected it, and i could mount it. Seemed to have no partitions, so just mounted the device, and it worked fine. GTKPod had no problems setting it up and copying songs, and it seems to be working OK. When I got mine today, I decided to set it up via Windows (in a VMWare session), and see if it created a seperate partition (my original iPod did..). However, the installer did not create another partition, and the device still is just /dev/sdb in this case.

While this must be the way it works, it does make me wonder if we need at all to even do the Windows step, and just do what I did with the first under Linux. If anyone who has had a 2nd Gen. iPod Shuffle under Linux can comment on how they have their one set up, that would be great.

Comments 0 CommentsAdd a comment Add Comment

Ignorance is Bliss, apparently.

So, today on a random IRC Channel, the following definition of Django was given:

< freespace> jsp for python

The comparison seems like chalk and cheese. What I do know about JSP, is the fact that to do even little things would require a lot more code than the task was worth, where with Django on the other hand, it is simply a simple task. Create Models, views, and URLs, and you are done.

If you are wanting to know what Django really is (and what wouldn't you? It's fabulous!), have a look at: The Django Overview and Django FAQ

Meanwhile, Linux Australia, has announced that they are going to re-do their current site, and need to come up with something that better integrates, and provides a more modern, look.

Suggestions have already come up, for what should be used as a starting base. Drupal, Django and Ruby on Rails have all been mentioned, with embperl and slashcode being mentioned by people with more time than sense ;-).

Hopefully they go with something sensible (Django), and not end up with something clunky (Drupal).

Comments 1 CommentsAdd a comment Add Comment

More on Nina Reiser's disappearance

In a follow up to the post about Hans Reiser's wife going missing, it appears that things have taken a turn for the worse, and Hans Reiser has now been arrested.

It mentions no body has been found, so it will be interesting to see what evidence they do have.

Comments 0 CommentsAdd a comment Add Comment

ReiserFS wife missing

Seems Hans Reiser's wife, Nina, is missing:

http://cbs5.com/topstories/local_story_256204954.html

Comments 0 CommentsAdd a comment Add Comment

awk and sed.

Another of my subjects this semester at uni, had me using a bit of awk and sed this week just gone, and I must say, that I now do have a more understanding knowledge of both of these tools.

Before I did understand how to do rather small things with each (like change instances of words, to another word, and pull out every 4th word from a sentence to use elsewhere), I never did try and go any more into either of them.

As you can see from the following code snippets, I think I have dug a bit more into these tools.

sed: Change the order, of the first two parameters called by a function

s/somefunc((.*),(.*)(,.*))/somefunc(2,13)/g

awk: add line numbers to each line of a source file, without skipping numbers. Comments should not be numbered.

   { if ($1 ~////) { printf("%5st%sn", "", $0); next } }
   { if ($1 ~//*/) { z = 1; printf("%5st%sn", "", $0); next } }
   { if ($1 ~/*//) { z = 0; printf("%5st%sn", "", $0); next } }
   { if (z > 0) { printf("%5st%sn", "", $0); next } }
   { printf("%5st%sn", (NF? ++a ":" :""), $0) }
   

A sample output for this awk script would be:

      1:   #include 

    // main routine

2: int main(int argc, char argv[]) 3: { / Incredibly complex function here -- * it prints hello world */ 4: printf("%s", "Hello, world"); 5: return 0; // return zero! 6: }

And comparing what I did, to some other features of these tools, this is still only the beginning of their abilities.

Comments 1 CommentsAdd a comment Add Comment

Win32 API vs. Linux - Round One

Before we start today's fight, we shall introduce you to the contestants, and a bit of background on each of them.

In the Red Corner, we have code written to work well with the Win32 API. The Win32 API is known for being part of Windows, and being able to kill its opponents easily, with the sheer size and complexity of itself. In the Blue Corner, we have code written to work well on Linux. Linux code being known to be quite easy to deal with, and not having heaps of levels of abstraction when it isn't neccesary.

These two come together today, to see who can write the better program that can: * Open a file, specified on the command line, for exclusive read only access. * Report if there was a problem opening the file, with an appropriate error message. * Close the file.

We would like to thank today's sponsor for this event, namely the Systems Programming 2 class that I am currently undertaking at University, and is making me learn how to code with the Windows API.

So that is enough, talk, lets see how the fight goes.

Windows starts off first by allowing a bit more complexity to its CreateFile() routine, but this is unfortunately useless, and not able to withstand the sheer simplicity of Linux's open() call, which beats it hands down.

In an attempt to reclaim, the match, Windows tries to claim that it can give a more superior error message handling routine, for when that file open does not work. Unfortunately, while Windows was still trying to type the function name for the routine to get the error message, Linux had already finished writing code to get and display the error message, thanks to perror(). In fact, Linux was so efficient, it decided to go one step better, and customise the error message all together.

In the end, it came down to closing the handle/file descriptor, to see if Windows would get a foot in, in this round, and it seems that it was a tie. Both Windows and Linux successfully made closing the open file nice and easy.

However, it the clear winner this round is the Linux code. Score: 2.5 - 0.5 -- Linux code wins.

To see the code used in this contest, and to agree with me that Linux definately wins this round in terms of better code/less code for this task, see the code below.

Windows

include <windows.h>

include <stdio.h>

int main(int argc, char *argv[]) { HANDLE hFileToRead; LPTSTR pszErrorMessageBuf; SECURITY_ATTRIBUTES lpSecurityAtrribs;

    lpSecurityAtrribs.nLength = sizeof(lpSecurityAtrribs);
    lpSecurityAtrribs.lpSecurityDescriptor = NULL;
    lpSecurityAtrribs.bInheritHandle = TRUE;

    if (argc &lt; 2)
    {
            fprintf(stderr, "Syntax: %s &lt;filename&gt;", argv[0]);
            return -1;
    }

    hFileToRead = CreateFile(
                    argv[1], GENERIC_READ, 0,
                    lpSecurityAtrribs, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

    if (hFileToRead == INVALID_HANDLE_VALUE)
    {
            FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
                    NULL, GetLastError(), 0, (LPTSTR)&pstrErrorMessageBuf, 0, NULL);

            fprintf(stderr, "Could not open file '%s': [%d] %s", argv[1],
                    GetLastError(), pstrErrorMessageBuf);
            LocalFree(pstrErrorMessageBuf);
            return -1;
    }
    else
            printf("File successfully opened.\n");

    if (!CloseHandle(hFileToRead))
            fprintf(stderr, "Error closing file...\n");

    return 0;

}

Linux code

include <stdio.h>

include <sys/types.h>

include <sys/stat.h>

include <fcntl.h>

include <errno.h>

include <string.h>

include <unistd.h>

int main(int argc, char *argv[]) { int fd;

    if (argc < 2)
    {
            fprintf(stderr, "Syntax: %s <filename>\n", argv[0]);
            return -1;
    }

    fd = open(argv[1], O_EXCL|O_RDONLY);
    if (fd == -1)
    {
            fprintf(stderr, "Could not open file '%s': [%d] %s\n",
                    argv[1], errno, strerror(errno));
            return -1;
    }
    else
            printf("File successfully opened.\n");

    if (close(fd))
            fprintf(stderr, "Error closing file...\n");

    return 0;

}

Comments 4 CommentsAdd a comment Add Comment

no, just do it

unless of course you can find an EXTREMELY GOOD reason, please make sure you do the following:

   grep -v register_globals php.ini > php.ini.new
   echo "register_globals = off;" >> php.ini.new
   mv php.ini.new php.ini
   

that is all.

Comments 0 CommentsAdd a comment Add Comment

Broadband still sucks, atleast in Australia.

I have been on ADSL since November 2004, I guess it is time for me to talk about my thoughts on how the future of ADSL in Australia is shaping.

During this time, I have been with WestNet, on a 512/128 plan. This has suited me well most of the time, but there is often times when I want more download speed. This includes situations such as downloading Ubuntu's "Dapper Drake" Flight CD's for testing, or when I periodically <a href="http://gentoo-wiki.com/Advanced_Emerge_World">emerge world</a> on my Gentoo systems.

But most of the time my down speed is fine. However, it is usually my up speed that annoys me. Being limited to 128 kilobits (or 16 kilobytes) of upstream can be very disadvantaging when you wish to use SSH to connect to things at home. Often it can be quite slow in response, especially if I am utilising the ADSL line to do anything else.

It isn't just me who is getting feed up with things like this, it is anyway who uses depends on their broadband for either work, education or whatever other means.

Some Australian ISP's have started to roll out their own DSLAM's in an attempt to fix this situation, which is fine, but in many cases, the cost can be significantly dearer to go with these options, as there is additional cost of buying, installing and configuration of these DSLAM's by the ISP. But these options are better than what we have ATM, so I Commend ISPs such as Internode, TPG, Adam Internet and iiNet for doing so. If Telstra doesn't start to upgrade their network infrastructure, I will most likely being going with one of these companies. (For these who aren't in Australia, Telstra owns most of the ADSL infrastructure in Australia, and resells this to most ISPs, hence my ISP Westnet, relies on Telstra's infrastructure to be able to provide faster service).

A good question for Telstra at the moment is when are they going to start rolling out ADSL 2 capable DSLAM's into their infrastructure. Personally, I can't see Telstra being in a hurry to do this, especially since they have proven they don't want to share anymore. Oh and this is probably already proven by the fact that Telstra/Bigpond like to charge excessively high rates for their services, such as Bigpond ADSL, which is currently $29.95 a month for their cheapest plan, on 256/64. You are probably thinking this would be quite cheap for someone who is a light internet user, and it would be. But when you look at the fact it comes with only 200MB of quota and it costs 15 cents per megabyte after that (that's $150 per 1000 megabytes), it isn't that cheap at all, especially when my ISP, WestNet, for the equivalent price, you can get a 500MB plan, on the same speed. Not that much of a difference, but there are many more cheaper ISP's out there. Just check out this listing on Broadband Choice. So to summarise this little rant, I think it's easy enough to say that ADSL, in Australia, sucks.

Comments 0 CommentsAdd a comment Add Comment

NLD10 Videos

Here are some videos showing Novell's Linux Desktop 10 Technology Preview that were talked about on ubuntu's sounder list. Pretty cool stuff, even if it is just eye candy.

Comments 0 CommentsAdd a comment Add Comment

Being mobile

In news that can only be classified as "now I really am mobile", I took the plunge and set up moto4lin on my desktop, and now I am able to browse the contents of my mobile phone &mash excellent!

While it may take a bit longer to actually for me to actually live the dream of my phone's address book syncing with my desktop version, its definately a step in the right direction. So stay tuned for what that unfolds.

Comments 0 CommentsAdd a comment Add Comment

dosbox

Been playing around the last few days with dosbox, and I must say it rocks ;-)

I've been able to play those games that I haven't played in ages like Police Quest or Hills Street Blues.

Police Question on dosbox

Comments 0 CommentsAdd a comment Add Comment

Hoff it up

Given the idea by Tony, I hoffed up the SLUG logo.

Hoffed up Slugger

Comments 0 CommentsAdd a comment Add Comment

bzr visualise

Scott, points out a nice new feature for bzr, that came from what was in git. Looks pretty cool.

Comments 0 CommentsAdd a comment Add Comment

Race to Linux

Aaron talks about Race to Linux having the prize as an Xbox, ironically something opposite of the goal they are trying to achieve. While my feelings on the point are neither here nor there (the Xbox is a decent piece of gaming equipment, as is the playstation), I do think the race is a great idea.

Simply put, it is trying to get coders, of ASP.Net web applications, to convert examples of current ASP.Net implmentations, or designs, into an open source language, such as PHP and Mono. So if you have some free time, might be an idea to check it out. It sounds fun, and looks fun, and you can get yourself a nice gaming machine.

Race to Linux

Comments 0 CommentsAdd a comment Add Comment

Google, Talk and more.

For those that have been living in a cave this week, Google has announced it's Instant Messenger client, namely 'Google Talk'. While it is in beta (is anything at google not in beta?), thanks to its use of the Jabber/XMPP protocol, it means that already there are clients for all operating systems available (well, any that supports Jabber, naturally).

This means that you don't need to download yet another IM Client, or wait for GAIM or BitlBee, to update the source, to include the protocol and functionality for it. However, BitlBee users should note, that they will need to apply this patch to order to be able to use the gmail service, due to minor account differences in gmail's set up. See www.bitlbee.org for more info. (Yes port 5223, the default Jabber port works for me, where 5222, the google talk port, doesn't).

Meanwhile, I now have another means of contact that I will never use. I do use bitlbee for my instant message conversations, as it moulds nicely into my IRC Client, but i still converse mostly thru IRC. I guess IM is just there for the people who need to contact me and are bedazzled by all the shiny parts of IM clients (fuck you emoticons).

And while I have your attention, on a side note, has anyone noticed that Google is doing similar things to what Microsoft do, in regards to how they name their applications or services. That being, naming the product simply after the task it does, in order for it to become more "easier to remember", I would imagine. To compare:

Microsoft Products: Word, Paint, Office, Messenger Google Products: Talk, Search, Desktop Search, Alerts.

The only products which seem to have a unique names, are products they have gained due to the purchase of/from other companies.

Your thoughts on google talk and the rest are welcomed.

Comments 0 CommentsAdd a comment Add Comment

IMAP daemons

I have been thinking over the last few months about implementing an IMAP daemon to look after my mail, then my current method, which is to use POP3.

I had a look at the IMAPd from the University of Washington, and it is simple enough to implement, and set up, but I was hoping to use something with a bit more configuration (not so it is harder to set up, but so i can refine some of the options).

Anyone have any suggestions for something decent? If so, leave a comment.

Note: Someone I know did mention to have a look at Cyrus (which I will do), but does anyone have any comments on it before I do?

Comments 1 CommentsAdd a comment Add Comment

Not currently logged in.   Login.   Register?