March 2006 Archives
March 29
DocRead
This evening I managed to get my
program into an actual installable .deb and to my surprise it built
with no lintian
errors.
It's basically a little program to find and display README's or Changelogs, TODO's, NOTES etc etc, usually Debian gzips these files and many new users don't know about zless or some shell tricks to pop open a file on a whim.
You can download it here and see some screenshots there too. It is a pretty simple program but it was fun to do, I learned a ton of things that were not covered in my C books, and actually have some confidence now about the types of things you can do with C.
I still have lots of improvements to make but I wouldn't mind adding a few things to bzflag that have been on my TODO list for far to long. So I might take a small week or two diversion. My bzflag contributions, by the way, are minor in comparison to some, but they have a tremendous instant gratification aspect to them, partly because it is a game. You get to see it in action right away and can say stuff like "oh, nifty!"
The word on the bzflag grapevine is that Trepan is about to make one of his colossal commits... I am not sure what it is but I am keeping a close eye on things :)
I am having some problems sleeping lately and have tried a radical new approach called Going To Bed At a Sensible Time. I know, it sounds very suspicious, like Viagra Spam, but I am desperate and will give it a try. (the sleep thing...not the Viagra :P)
It's basically a little program to find and display README's or Changelogs, TODO's, NOTES etc etc, usually Debian gzips these files and many new users don't know about zless or some shell tricks to pop open a file on a whim.
You can download it here and see some screenshots there too. It is a pretty simple program but it was fun to do, I learned a ton of things that were not covered in my C books, and actually have some confidence now about the types of things you can do with C.
I still have lots of improvements to make but I wouldn't mind adding a few things to bzflag that have been on my TODO list for far to long. So I might take a small week or two diversion. My bzflag contributions, by the way, are minor in comparison to some, but they have a tremendous instant gratification aspect to them, partly because it is a game. You get to see it in action right away and can say stuff like "oh, nifty!"
The word on the bzflag grapevine is that Trepan is about to make one of his colossal commits... I am not sure what it is but I am keeping a close eye on things :)
I am having some problems sleeping lately and have tried a radical new approach called Going To Bed At a Sensible Time. I know, it sounds very suspicious, like Viagra Spam, but I am desperate and will give it a try. (the sleep thing...not the Viagra :P)
March 24
clickable links in urxvt
I have had terminal envy when seeing
Gnome terminal and Konsole display URL's as click-able links. Now
my favorite terminal rxvt-unicode
can with the help of a perl module do the same thing. This is
really handy, especially for irc and email where I used to drag
select a URL and then navigate to whatever virtual
desktop my browser (firefox) happens to be on and then middle
click to open the URL. Now I can just click on a URL and it opens
in a new firefox tab and I choose to go look at it now or later.
urxvt now looks like:
You need to have perl support complied in:

in ~/.Xresources:
URxvt.urlLauncher: firefox
then:
urxvt -pe mark-urls
You will have to use middle-click to launch urls unless you edit
/usr/lib/urxvt/perl/mark-urls and change line 46
From:
if ($event->{button} == 2 && ($event->{state} & $mask) == 0) {
To:
if ($event->{button} == 1 && ($event->{state} & $mask) == 0) {
March 20
From hating to loving Valgrind...
I spent much of last week using
Valgrind on my program code.
First I actually had to learn how to use it, and then how to
interpret the results.
Luckily a patient mentor wasn't far off and I was soon informed that all the memory I had asked the kernel to lend me for my program had to be returned when I was finished with it. This came a surprise somewhat to me as I was under the impression the kernel cleans up anyway when you close the program but I hadn't considered non normal cases like the program is left running for weeks or someone uses it to open a huge huge file, etc etc
My C book had touched on malloc, alloc and free in one of the last chapters but it didn't warn me about allocating in a loop, then trying to free, or allocating in one function but then freeing the memory in another function and all the joys of corrupting your memory, nice subtle, impossible to find corruptions.
I had also used functions from 3 different libraries, and not noted that the library function calls malloc and its up to me to free it. Once all theses things were understood I was able to transform:
This week, time permitting, I will take a stab at making a Debian Package which requires reading large chunks of Debian Policy and also bits and pieces of the Maintainers Guide which I thought, until I started reading it, would be a nice break from C :-)
I am also quite happy that today is the first day of spring.
Luckily a patient mentor wasn't far off and I was soon informed that all the memory I had asked the kernel to lend me for my program had to be returned when I was finished with it. This came a surprise somewhat to me as I was under the impression the kernel cleans up anyway when you close the program but I hadn't considered non normal cases like the program is left running for weeks or someone uses it to open a huge huge file, etc etc
My C book had touched on malloc, alloc and free in one of the last chapters but it didn't warn me about allocating in a loop, then trying to free, or allocating in one function but then freeing the memory in another function and all the joys of corrupting your memory, nice subtle, impossible to find corruptions.
I had also used functions from 3 different libraries, and not noted that the library function calls malloc and its up to me to free it. Once all theses things were understood I was able to transform:
==14391== LEAK SUMMARY:
==14391== definitely lost: 39920 bytes in 239 blocks.
==14391== indirectly lost: 387840 bytes in 5426 blocks.
==14391== possibly lost: 0 bytes in 0 blocks.
==14391== still reachable: 0 bytes in 0 blocks.
==14391== suppressed: 0 bytes in 0 blocks.
into:
==14571== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 19 from 1)
==14571== malloc/free: in use at exit: 0 bytes in 0 blocks.
==14571== malloc/free: 11057 allocs, 11057 frees, 701138 bytes allocated.
==14571== For counts of detected errors, rerun with: -v
==14571== No malloc'd blocks -- no leaks are possible.
Which made my day, actually made my week as I was getting quite
bummed out over it (as usual).This week, time permitting, I will take a stab at making a Debian Package which requires reading large chunks of Debian Policy and also bits and pieces of the Maintainers Guide which I thought, until I started reading it, would be a nice break from C :-)
I am also quite happy that today is the first day of spring.
March 18
#debian irc.freenode.net
21:26 <fsaf> Hi, I am having problems with my computer, can anyone help me. 21:27 <abrotman> fsaf: you need to ask a better question 21:27 <fsaf> My computer doesn't work 21:28 <fsaf> The question is, how do I Fix my computer
March 16
most is better than less which is better than more
I have switched from using bash to
using zsh, now before
you go off all "You don't have time to learn another shell"
on me, let me just say that I haven't really learned much in bash,
and what I have learned transfers to zsh with little effort. All my
alias's for example work without alteration, the paltry 3 bash
functions I use work just fine too, and the real reason behind this
is the completions for lazy typists like me are much better in zsh
I find than in bash. I also love not having to type cd to umm cd
into a directory.
Most distributions install at least the pager 'more' by default and some install 'less' which is a of course a better version of 'more' but I recently discovered 'most' which tops them all.
With 'most' you can split the window with C-x 2 and jump to the
other one with C-x o just like in a certain editor you all love.
And oh yeah it has configurable colors which the others don't
have.
Most distributions install at least the pager 'more' by default and some install 'less' which is a of course a better version of 'more' but I recently discovered 'most' which tops them all.

March 08
the problem with wiki's
Last week I had the opportunity to
take format Lars's
python tutorial for the D-W wiki. This was the first time I had
actually added something to a wiki so I had to read the syntax
rules first to get some idea of whats going on.
It wasn't really a difficult task but the wiki software actually made it much harder. First and foremost is that you cannot upload a file. This means you cannot edit the plain text version in your favorite editor, which is a major drawback.
Once I knew the syntax it took me very little time to add the formatting in Emacs but then I had to paste it into the edit box manually, which is error prone as the paste lands where your mouse contacts the edit box, not where you edit cursor is. Tsk tsk.
Also it seemed to dislike pasting the entire file at once, maybe it has a buffer length, but if so, it didn't tell me that. The other problem is the edit box size. It is only 60 columns wide, yet when the page is rendered its much wider.
I was told last week my sense of humour is odd when I showed someone a book cover that made me giggle. His reaction was 'Hmm'. I said 'what you don't find it amusing?'. Maybe he is right but if you saw someone, lets say on the subway, ac cross from you reading this book I am certain your reaction would be similar to mine.
It wasn't really a difficult task but the wiki software actually made it much harder. First and foremost is that you cannot upload a file. This means you cannot edit the plain text version in your favorite editor, which is a major drawback.
Once I knew the syntax it took me very little time to add the formatting in Emacs but then I had to paste it into the edit box manually, which is error prone as the paste lands where your mouse contacts the edit box, not where you edit cursor is. Tsk tsk.
Also it seemed to dislike pasting the entire file at once, maybe it has a buffer length, but if so, it didn't tell me that. The other problem is the edit box size. It is only 60 columns wide, yet when the page is rendered its much wider.
I was told last week my sense of humour is odd when I showed someone a book cover that made me giggle. His reaction was 'Hmm'. I said 'what you don't find it amusing?'. Maybe he is right but if you saw someone, lets say on the subway, ac cross from you reading this book I am certain your reaction would be similar to mine.
March 05
target alert
This Firefox Extension
is one of the few that I have bothered to install. Target alert
gives you a nice visual cue as to what the link your about to click
actually is, and if its a new window. I try to keep the extensions
to the minimum number as possible as some of them are quite buggy
and probably insecure. Think Active X.
The other two I have installed are Flashblock which obviously blocks the abomination that is Macromedia Flash, and Add Bookmark Here which I find indispensable and should really be built in to any browser.
I was talking to someone about certifications and how little they actually mean and he pointed me to this CISSP sample examination page. Some of the sample questions are quite difficult
The other two I have installed are Flashblock which obviously blocks the abomination that is Macromedia Flash, and Add Bookmark Here which I find indispensable and should really be built in to any browser.
I was talking to someone about certifications and how little they actually mean and he pointed me to this CISSP sample examination page. Some of the sample questions are quite difficult
Others are not so hard, anyway I got 18 out of 29 correct which would mean I failed :-) But!...I don't work in the tech industry and I didn't do anything in the way of preparation so all in all its not a bad result. Take the test yourself, and if you score lower than me, let me know, so I can post your result here to make me feel better :-)14. The fact that it is easier to find prime numbers than to factor the product of two prime numbers is fundamental to what kind of algorithm? a. Symmetric key b. Asymmetric key c. Secret key d. Stochastic key
March 04
lost some email
Last night I set spamprobe to learn
some new spam that had gotten by the filter but I didn't check its
status and went to bed. When I got up there were no emails in any
of the mailing list folders which seemed not normal to say the
least.
The process had hung overnight, so when cron fires up every ten minutes it invokes fetchmail, which gets my mail to the spool, then invokes procmail which simply invokes spamprobe to insert a header to say its either spam or not, and places it back on the spool.
Then Gnus sorts the mail. But because spamprobe was still hung, it wouldn't run again so no mail got through, worse though was that 130 emails were lost. So if you have sent me something important I am afraid you will have to resend :-\
The process had hung overnight, so when cron fires up every ten minutes it invokes fetchmail, which gets my mail to the spool, then invokes procmail which simply invokes spamprobe to insert a header to say its either spam or not, and places it back on the spool.
Then Gnus sorts the mail. But because spamprobe was still hung, it wouldn't run again so no mail got through, worse though was that 130 emails were lost. So if you have sent me something important I am afraid you will have to resend :-\