Thursday, May 31, 2007

Moam-CD update; A new font



    Well, I have updated Ace of Penguins to use the first 32,768 hands for the difficulty levels. Since hands that need four freecells to solve are fairly rare, I have updated the program to have only three difficulty levels; "Hard" is now all of the hands that need three or four freecells to solve. The hands that fc-solve could not solve are now black-listed, and will not be dealt to the user.

    I am also working on a screen font that is easy on the eyes. Here is a sample of the screen font:



    The name of this font is "Sandals", and it is strictly a screen font.

    I am mostly done with the 16pt version of this font; I will then make a 14, 12, 10, and 8 version of the font in the roman typeface. Then I will make bold and italic typefaces.

    Anway, Sandals can be downloaded here (Post-May-2007 Fontforge source). Today's snapshot of Moam CD is available at http://www.samiam.org/moof/moam-cd-20070531.tar.bz2 (10 megabyte file).

    - Sam

    Wednesday, May 30, 2007

    Freecell difficulty calculating finished; Vista annoyance



      I have finished calculating the basic difficulty for the first 32768 hands of Freecell using my particular shuffling algorithm. Before I terminated the process this morning, it had calculated 37052 hands. I don't think the calculation is completely accurate, but it's good enough for giving the Freecell that my live CD comes with difficulty levels.

      Here is the final breakdown of difficulty


      0 75
      1 6637
      2 21849
      3 7756
      4 535
      5 200


      In this chart, the left column is the number of freecells, and the right column is the number of hands solvable with that many freecells. "5" indicates that the hand could not be solved with four freecells.

      I am sure a lot of those 200 hands which fc-solve couldn't solve are, in fact, solvable.

      Here is the final list of hands solvable with zero freecells:

      116 497 1195 1762 2330 3175 3380 3417 4187 4325 4361 5061 5394 6188 6552 6569 6642 7208 7253 7298 9836 10181 10377 10393 11211 12106 12637 12762 12832 13458 13632 13710 14928 15017 15900 16182 16303 16411 16820 17733 17990 18439 18663 18906 19168 20233 20928 21038 21837 21979 22051 22150 23417 24394 25195 25469 26458 27405 27854 28057 30783 30790 30914 31713 31828 33272 33437 33570 34105 34902 35018 35189 35493 35938 37011

      And the final list of hands fc-solve could not solve:

      30 228 459 508 673 714 1081 1257 1288 1464 1567 1792 2235 2362 2386 2484 2715 2880 3022 3194 3267 3322 3861 4230 4287 4530 4791 4873 4874 4908 5030 5195 5396 5809 5820 6140 6227 6408 6523 6737 6761 6796 7073 7077 7269 7383 7530 7853 8009 8417 9113 9155 9640 10076 10110 10117 10294 10338 10567 10809 10961 11060 11151 11239 11991 12122 12360 12432 12433 12439 12978 13000 13345 13365 13595 13769 14234 14243 14314 14509 14574 14673 14871 14880 15182 15280 15316 15418 15477 15723 15798 15890 16280 16319 16399 17514 17823 17856 18057 18327 18570 18764 18837 19140 19286 19862 19924 19926 19965 20133 20429 21130 21320 21535 21628 21920 22091 22264 22597 23095 23099 23127 23233 23327 23625 24132 24519 24619 24660 24871 25067 25069 25246 26381 26584 26640 26667 26806 26816 26970 27015 27183 27223 27333 27572 27932 27970 28000 28245 28482 28486 28499 28556 28645 28765 28989 29142 29173 29243 29320 29538 29589 29644 30009 30346 30539 30651 30739 30959 30984 31320 31532 31951 32381 32625 32647 32672 33495 33707 33728 33835 34049 34203 34865 34889 35028 35211 35320 35779 35867 35902 35934 36066 36331 36348 36425 36465 36508 36633 36720




      OK, the other night I was teaching English to a student who just put Vista on a new laptop. Everything was enabled: Aero, translucent window bars, the whole nine yards. As you can imagine, this computer was S-L-O-W. Anyway, so we open up Word 2007 so I can start typing a lesson for him (I use client's computers so that I don't have to lug my laptop everywhere, and so that clients can have notes on their computers). After installing my special font with IPA symbols, I get to work and type. Then Word incorrectly underlines something I wrote in Spanish, because the document was in English.

      No, problem. Go to tools->set language and change the language. This is how it's done in Word 2000 and 2003. Well, except, Microsoft has completely changed the interface in Office 2007. My client says "OK, let's figout out where it is". With over 10 years of Linux experience, I know to RTFM (read the fancy manual) when I'm lost. We decided to take the RTFM route.

      I open up the help, type in the Spanish for "set language" (the client's system, like all computers I see here in Mexico, is in Spanish), and go through until I find the document telling me where it is hidden. The manual said Spanish words to the effect of "Go to tools -> set language to change the language the selected text is in". Well, except there is no "tools" menu item in Office 2007. So I'm thinking that some magic will restore the tools bar. Google searches don't reveal anything helpful. My client, at this point, is calling up a friend and we're trying to figure out how to change the !@#$ language in Office 2007.

      We finally found it. Below the text, it tells you what language Word thinks the document is in. You can select text and pull this up as a menu item to change the language. No tools bar in sight.

      In order words, the documentation Office 2007 was out of date. To the point where it did more harm than good. I guess Spanish-speaking Microsoft users have too much pride or whatever to RTFM when lost.

      Tuesday, May 29, 2007

      Freecell solving update



        As of this morning, the Freecell solver was almost at 32,768 hands. It has lareayd passed that point. There are, so far, 60 hands that can be solved with zero freecells: 116 497 1195 1762 2330 3175 3380 3417 4187 4325 4361 5061 5394 6188 6552 6569 6642 7208 7253 7298 9836 10181 10377 10393 11211 12106 12637 12762 12832 13458 13632 13710 14928 15017 15900 16182 16303 16411 16820 17733 17990 18439 18663 18906 19168 20233 20928 21038 21837 21979 22051 22150 23417 24394 25195 25469 26458 27405 27854 28057. There are also 166 hands that we the solver couldn't solve with four freecells; some of these are undoubtably solvable: 30 228 459 508 673 714 1081 1257 1288 1464 1567 1792 2235 2362 2386 2484 2715 2880 3022 3194 3267 3322 3861 4230 4287 4530 4791 4873 4874 4908 5030 5195 5396 5809 5820 6140 6227 6408 6523 6737 6761 6796 7073 7077 7269 7383 7530 7853 8009 8417 9113 9155 9640 10076 10110 10117 10294 10338 10567 10809 10961 11060 11151 11239 11991 12122 12360 12432 12433 12439 12978 13000 13345 13365 13595 13769 14234 14243 14314 14509 14574 14673 14871 14880 15182 15280 15316 15418 15477 15723 15798 15890 16280 16319 16399 17514 17823 17856 18057 18327 18570 18764 18837 19140 19286 19862 19924 19926 19965 20133 20429 21130 21320 21535 21628 21920 22091 22264 22597 23095 23099 23127 23233 23327 23625 24132 24519 24619 24660 24871 25067 25069 25246 26381 26584 26640 26667 26806 26816 26970 27015 27183 27223 27333 27572 27932 27970 28000 28245 28482 28486 28499 28556 28645 28765 28989 29142 29173 29243 29320 29538 29589 29644 30009 30346 30539

        Monday, May 28, 2007

        MOAM-CD update



          I am in the process of moving MOAM-CD from using CentOS 3 as a base system (The X server is too old to support modern video cards) to using DeLi Linux. My goal is to have a tarball that is 100% self-contained. Extract the tarball on a full install of DeLi 0.7.2 with Firefox, run "make", and you will get a Live CD iso image the size of a business card CD (50 megs) about an hour later.

          I'm not there yet, but I have made the following improvments this weekend:
          • Busybox 1.5.0 now compiles in DeLi Linux 0.7.2.
          • Freecell (Ace of Penguins) now has difficulty levels.
          • Xsetup updated for Xorg 7.X
          • Firefox now runs in the live CD envronment (This took hours of troubleshooting).


          Anyway, here is a snapshot: http://www.samiam.org/moof/moam-cd-20070527.tar.bz2

          - Sam

          Friday, May 25, 2007

          Freecell solver update




            Well, the only thing I was able to accomplish last night was to continue running the freecell solver on the hands generated by the Freecell shuffler I posted here yesterday.

            Here is distribution, as of early this morning, of how hard the hands are:


            Freecells Number of hands
            0 20
            1 1361
            2 4705
            3 1669
            4 121
            5 or more 48


            The left column is the number of freecells needed to solve a hand, and the right column is the number of hands solvable with that many freecells. Here is a list of the hands solvable with zero freecells: 116 497 1195 1762 2330 3175 3380 3417 4187 4325 4361 5061 5394 6188 6552 6569 6642 7208 7253 7298.

            And the hands fc-solve (the name for the freecell solver program) could not solve with four freecells: 30 228 459 508 673 714 1081 1257 1288 1464 1567 1792 2235 2362 2386 2484 2715 2880 3022 3194 3267 3322 3861 4230 4287 4530 4791 4873 4874 4908 5030 5195 5396 5809 5820 6140 6227 6408 6523 6737 6761 6796 7073 7077 7269 7383 7530 7853

            Thursday, May 24, 2007

            MaraDNS snapshot released




              I have released a new MaraDNS 1.3 snapshot today that applies the memory leak patch I mentioned yesterday. It's at http://www.maradns.org/download/1.3/snap/200705

              MaraDNS.org is 99% back





                MaraDNS.org is 99% back. The only thing not working is my email me page; some permissions got changed and I may have to implement Blowfish encryption in PHP to get this page to work again.

                I have uploaded MaraDNS 1.3.05 and Daniel's Slackware port of MaraDNS 1.2.12.06 to the web page.




                My current project for the next version of MOAM-CD is the have difficulty levels implemented in the Freecell game. So far, I have standardized the shuffling code to always shuffle a given hand when given a certain RNG seed. The next step after that was to standardize the RNG used, so that the same hand is given, regardless of operating system. The RNG code is as follows:


                /* Public domain; this generates a freecell hand
                * suitable for use by fc-solve (A Freecell solver)
                * that is the same as the freecell hand
                * generated by the version of Ace of Penguins
                * that I have hacked to always generate the
                * same hand with a given seed
                *
                * Usage is straightforword:
                ./gen_hand | fc-solve
                * Where is the seed for the freecell
                * hand in question */

                #include

                static uint32_t n = 0;
                int deck[52];

                uint32_t zrand(void) {
                uint64_t z;
                z = n;
                /* These numbers are from page 6 of "Tables
                * of Linear Congruential Generators of
                * Different Sizes and Good Lattice
                * Structure" by Pierre L'Ecuyer */
                z *= 279470273;
                z %= 4294967291U;
                n = z;
                return (int)(n & 0x7fffffff);
                }

                void deck_init() {
                int a;
                for(a=0;a<52;a++) {
                deck[a] = a;
                }
                }

                void deck_shuffle(uint32_t seed) {
                int a, b, c;
                n = seed;
                for(a = 0; a< 52; a++) {
                b = (zrand() % (52 - a)) + a;
                c = deck[b];
                deck[b] = deck[a];
                deck[a] = c;
                }
                }

                char *num_to_card(int card) {
                char *out;
                int a;
                char suit[4] = {'H', 'D', 'C', 'S'};
                char face[13] = {'A', '2', '3', '4', '5',
                '6', '7', '8', '9', '0', 'J',
                'Q', 'K'};
                out=(char *)malloc(4);
                if(card >> 2 == 9) {out[0] = '1'; a = 1; }
                else { a = 0; }
                out[a++] = face[card >> 2];
                out[a++] = suit[card % 4];
                out[a] = '\0';
                return out;
                }

                int main(int argc, char **argv) {
                int a, b;
                char *c;
                int s;
                if(argc != 2) { s = 394; }
                else { s = atoi(argv[1]); }
                deck_init();
                deck_shuffle(s);
                deck_shuffle(s+1);
                deck_shuffle(s+2);
                for(a=0;a<4;a++) {
                for(b=0;b<7;b++) {
                c =
                num_to_card(deck[51 - a - (b * 8)]);
                printf("%s ", c);
                free(c);
                }
                printf("\n");
                }
                for(a=0;a<4;a++) {
                for(b=0;b<6;b++) {
                c =
                num_to_card(deck[47 - a - (b * 8)]);
                printf("%s ", c);
                free(c);
                }
                printf("\n");
                }
                }


                The next step is to run a large number of hands through a freecell solver in order to see how many freecells it takes to solve a given hand. A hand that can be solved with 0 freecells is a novice hand. A hand that needs 1 freecell to solve is an easy hand; 2 freecells (the most common) is a medium hand; 3 freecells is a hard hand; 4 an expert hand; and more than 4 is an impossible hand.

                As of this morning before I left home to go to work, it found five novice hands (116, 497, 1195, 1762, and 2330), 438 easy hands, 1557 medium hands, 549 hard hands, 44 expert hands, and 16 hands that it thinks are impossible. I am sure some of the "impossible" hands are, in fact, solvable. For example, the Freecell solver couldn't solve hand 30:


                2D 3H 3D 9S 8S 3C JD
                AD 7H 2H 4D 6H KC KD
                JH QD 8C QH 5C 8D KH
                9D JC 5H TC 5D AC QS
                TD 3S AS 9C 4C TH
                4S AH 9H QC KS 7D
                6D 7C 2S 5S 6C 6S
                TS 8H JS 2C 7S 4H



                Here are some other hands the solver could not solve:


                228
                KH TH AH 2D QC 6D 7D
                TS 6S 5S QH 9C 4S KS
                3D 5C AS 7C 8S JD 5H
                9S KD 2C 2S 3H 9H JS
                TC 8H QS 8D 9D AD
                4C JH AC 3S QD KC
                TD 5D 6H 4D 3C 6C
                2H JC 7H 8C 4H 7S

                459
                7D JH TD 2C 9H 4D 6S
                TS 9C 3S 2H AD 4C 6C
                QS TH 7S QC 2S 8C KD
                KH 7H 5D AH QH JD 9S
                6H 5H JS 8D 4H 5S
                4S TC KC 2D KS 5C
                AS AC 9D QD JC 7C
                8S 8H 6D 3H 3C 3D

                508
                KS 2C 3S 6H 6S QH 6C
                7S 3H KH JH 7C QS 3C
                7H 7D 9H 5C TD 8C AD
                4H 8D 4D JD AH TS 4S
                6D 4C 2D 9S TH 9C
                8S AC AS KD KC QC
                QD 9D 5S 3D TC 2H
                JS 2S 5D JC 8H 5H

                673
                TS 5D 6S 3D 4S 7H 6D
                QD JH 7D 8C 2C TD JD
                KD 9S 9H QS QC 9D 5C
                8H JS 8D QH AD 6H KH
                5S 9C AS 6C KC KS
                2D 2H AC 2S 3C 3H
                TC 5H 8S 4D 4C 4H
                3S AH 7S JC TH 7C

                714
                9H 4D 4S 2C 8H JC 6H
                3D QC QS 3S AC KC 2H
                5C 7C 8S 8D 6D 4C TD
                5S 8C JD QD KD TS AD
                AS KH 6C 2D 5H 7S
                AH KS 4H 9S 6S 7D
                7H 5D 2S TC 3C JH
                9C TH QH 3H 9D JS

                1081
                QC AC JD AS 3H 2C 7S
                3D 3C KD 5S 6S TD 7H
                3S QS 7C AH 4H 8S 6C
                4D 9C 2H 9S KH 8C QH
                JC AD 8H JH 6H TC
                8D QD 5D 9D 4S KC
                JS 4C 5C 5H KS TS
                6D 7D 2D TH 2S 9H

                1257
                8D AH 4S QD 7H 3H 8C
                KD JH 5D 2D KC 3C 9D
                5S 6S JC AD TH 7S QS
                2H 5C AC QH TD 8H 6H
                4H 3D KH 8S 2S 5H
                2C QC JD AS 6C 4D
                3S 6D KS TS JS 4C
                7D 9H 9C 7C TC 9S

                1288
                5H 2D 8H JS 4H JH QH
                6H 7S 5D 7C 4S 2H 9D
                6S TD 7H TC 7D 3C 2S
                QS 5C 9S 3D AH JC 8S
                2C 3S 9H JD KC 6C
                6D QD QC KH 8D 5S
                9C KS AC 3H TH 4C
                KD 8C AS AD TS 4D


                My laptop, at home, has been spending all day solving hands. It will take the laptop about a week to give me the 65000 hands I want to have.

                Wednesday, May 23, 2007

                Non-critical memory leak plugged



                I have plugged a non-critical memory leak in MaraDNS 1.2.12.06.

                I introduced this memleak in 1.2.12.06. This memleak will only be manifested if bind_star_handling has a value of 2. Since this is a feature that isn't even documented in 1.2.12.06, this memory leak is not critical enough for me to make a new release before the scheduled release of MaraDNS 1.2.12.07 on August 17, 2007.

                Basically, if you need anally 100% RFC1034 section 4.3.3 compliance with star records, before setting bind_star_handling to two apply this patch:

                maradns-1.2.12.06-star_collision_memleak.patch

                1.3.05 also has this memory leak; the above patch *should* apply cleanly to the 1.3 branch of MaraDNS.

                - Sam




                P.S. While 1.0.40 is available on on the official MaraDNS download page, it is also available on Sean's server.

                MaraDNS.org up again; DeLi Linux is nice



                I'm letting everyone know that MaraDNS.org is up again. Some things are still broken; I won't be able to upload files (notably MaraDNS 1.3.05) until tomorrow and the link with my email address is broken. However, people can now download 1.0.40 and 1.2.12.06 from the MaraDNS.org web server, and 1.2.12.06 and 1.3.05 from Sean's server (see the last blog entry for hotlinks).




                I installed DeLi Linux last night. I like this distribution a lot; it's a full Linux system complete with X built on top of uClibc. I was working on something myself, but it's nice to see someone already did all of the hard work for me. One annoyance is that Busybox 1.5.0 didn't compile. I have fixed this and have a fixed Busybox on Sean's server.

                Tuesday, May 22, 2007

                MaraDNS.org down; RedHat liberation fonts




                MaraDNS.org is currently down. We are aware of the problem and we should have the site up again in a day or two. It looks like we will be able to get most of the site back, but no guarantees. In the worse case, I will just restore the website based on files in the 1.2.12.06 and 1.3.05 MaraDNS tarballs.

                In the meantime, people can download MaraDNS 1.2.12.06 at sourceforge and MaraDNS 1.3.05 on Sean's server. Should Sourceforge not work, you can also download MaraDNS 1.2.12.06 on Sean's server. MaraDNS 1.0.40 is currently not available online; I will upload MaraDNS 1.0.40 to Sean's server tomorrow.




                I just discovered that RedHat has, earlier this month, made some more open source fonts available. These fonts, which are work-alikes (but not look-alikes) for Microsoft Arial, Times New Roman, and Courier New, are available on RedHat's site. It's good to see some more open source fonts released.

                This font is ideally licensed. In particular, while the font is GPL, there is a special "pdf exception" which allows you to make pdf files with these fonts without having to worry about whether doing so forces the pdf file to be licensed under the GPL.

                This is a better license than Bitstream Vera's license because it allows people to make pdf files without needing to include the entire license in the .pdf file. Actually Vera's license is even worse--not only do you need to include the license in the .pdf file with the Vera font, but you also need to engage in technical measures to make the license part of the font in the .pdf file.




                Update: A while ago, I downloaded and installed Ubuntu 6.06 LTS on my laptop. Tonight, I will delete Ubuntu and replace it with a distribution called DeLi Linux (Wikipedia entry). Why? Because Ubuntu has two problems that make it not practical for my laptop:
                • It takes about five minutes to boot
                • There is a kernel bug that causes the entire system to freeze for about 1/10 of a second every three or four seconds
                I also feel DeLi linux will work as a better system for the long term; it's good to see a Linux distribution that cares about running well on older computers, such as my PIII/450 with 460 megs of memory.

                Monday, May 21, 2007

                Cosmic ray bugs



                I have, in the last month or two, have had three "cosmic ray" bugs reported to me. These are bugs reported by different users (each person being the only one to report the bug in question) that I have been unable to reproduce. The bugs are:

                • Someone saw records that should not rotate get rotated in the 1.0 branch of MaraDNS. I detail this bug here
                • Someone else saw that MaraDNS would not always return all of the NS records for a given request, even though it appears their request does not go past the 512-bite limit.
                • And finally, we have this bug report sent to the list.


                I have already responded to all three people, and have had to report their bugs as "Unreproducable". However, I'm not 100% comfortable closing a bug that someone has reported to me as really happening.

                The first two reports involve code in udpsuccess(). That code is a little messy. I may have to rewrite it for the 1.3 release, which I want to release on June 21.




                MaraDNS 1.3.05 has been done. The MaraDNS.org webpage currently has minor technical difficulties, but people can look at MaraDNS 1.3.05 on Sean's server.

                Friday, May 18, 2007

                MaraDNS 1.2.12.06 released ; MOAM-CD updated



                MaraDNS 1.2.12.06. This is a bugfix-only release for the stable branch of MaraDNS.

                • Bugfix: Whether to give a NXDOMAIN or a "not there" reply with star records fixed to be RFC1034 and RFC4074 compliant.
                • Bugfix: Hosts in a csv2_default_zonefile now correctly return a "not there" instead of a NXDOMAIN (unless there is no host of any RR type that matches the desired name).
                • Bugfix: João Antunes Predator tool found two memory leaks. Fixed.





                I have also updated MOAM-CD to use MaraDNS 1.2.12.06, and haver fixed the XMMS problems MOAM CD has, and have other minor bug fixes. http://www.samiam.org/moof/moam-cd-0.3.tar.bz2




                My plans for MaraDNS 1.3 is to finish the bind2csv2.py script (BIND zone file convertor), then test the 1.3 branch. I want to release a stable version of MaraDNS 1.3 on June 21, 2007.

                Monday, May 14, 2007

                MaraDNS update



                I have a new release of MaraDNS that fixes the following two bugs posted on the MaraDNS mailing list last week:
                • MaraDNS did not completely follow RFC 1034 section 4.3.3 with wildcards. Fixed; but bind_star_handling now needs a value of 2 to follow the RFC to the T
                • Queries for a host in a csv2_default_zonefile incorrectly returned a NXDOMAIN when one asked for an RR type not in the default zonefile
                The release can be downloaded here
                http://www.maradns.org/download/1.3/snap/200705/
                http://www.maradns.org/download/1.2/snap/2007/



                Looks like MOAM-CD doesn't work with USB mice. Since I don't have a USB mouse to test this on, all I can do is add support for USB mice as documented in linux-usb.org. However, looks like the documentation is, as typical of Linux kernel documentation, incomplete, and I can't figure out the secret incantation to get mice to actually work. Here is what I do:


                #!/bin/sh
                rm /dev/mouse
                mknod /dev/mouse c 13 63
                mount -t usbdevfs none /proc/bus/usb


                I will have to do some troubleshooting next time I deal with a computer with a USB mouse. They're actually pretty rare here in Mexico; just like DVD-ROM drives, the technology is only very slowly catching on.

                Friday, May 11, 2007

                MOAM CD work



                After realizing the need for an FTP client and a MP3 player for my MOAM-CD project, I rebuilt MOAM-CD last night with these two applications added. For the FTP client, I compiled the NetBSD FTP client in Linux. For Xmms, I just snarfed the binary from my install of CentOS 3. FTP works fine. I also recompiled the kernel to have sound card modules. XMMS works, but its sophomoric default configuration is to have XMMS output a .wav file instead of letting you listen to the song. This can be worked around by editing ~/.xmms/config, but I may have to patch XMMS.

                In order to make room for all this, I removed the DRI code; I don't need 3d graphics and I can use the room. This made enough room that I still have over four megabytes free, even after adding XMMS, FTP, aumix, and Nano to the code base. I will try to add Xpdf, but it looks like the t1 rendering lib will make this too big to use.

                One thing that doesn't work is Opera 9.20. Opera 9.10 has been working fine, but Opera 9.20, for unknown reasons, seg faults immediately before showing the use the EULA. Since its closed source, I can't debug. Strace didn't help either.

                So, MOAM CD is updated again. This MOAM project has made me lose sleep again--I was up past 1am dealing with all of this. And, again, I have some open MaraDNS issues I haven't had a chance to look at yet.




                Oh, I forgot to mention this: I figured out how to make the important stuff (the boot image, the Linux compressed image, etc) be near the beginning of the CD, and have the less important stuff (the music, etc) bear at the edge. It involves using the -sort option of mkisofs. Very useful, that. I also now set up the file permissions on the CD-ROM (with Rock Ridge, yes, CDs have UNIX-style permissions) to have the account I use for web browsing be completely unable to read my SSH private key.

                I'm working on MaraDNS right now. Having a full UNIX script environment, a C development environment, a web browser, a music player in only 50 megs is really nice.


                Update #2: Useful undocumented busybox feature: You can have Busybox's init applet reload /etc/inittab by sending init (process #1) a HUP signal.

                Monday, May 7, 2007

                MaraDNS stable updates




                As I just posted to the MaraDNS mailing list, I have a non-critical bugfix that fixes star record handling when bind_star_handling has a value of 1. Updated snapshots:

                http://www.maradns.org/download/1.2/snap/2007/

                http://www.maradns.org/download/1.3/snap/200705/

                For people with star record problems, and have bind_star_handling, try out these patches. Everyone else can wait until I release 1.2.12.06 later in a couple of weeks.

                - Sam

                Friday, May 4, 2007

                MOAM-CD 0.2 release; Linux documentation is evil



                Linux kernel documentation is evil. For example, lets look at the Linux 2.4 packet filtering HOWTO. It mentions, and I quote: "This means you need kernel 2.3.15 or beyond, and answer `Y' to CONFIG_NETFILTER in the kernel configuration.". What the documentation does not mention is that you need to enable some other things in the kernel to get the example basic firewall to work. In more detail:


                CONFIG_NETFILTER=y
                CONFIG_IP_NF_CONNTRACK=y
                CONFIG_IP_NF_FTP=y
                CONFIG_IP_NF_MATCH_STATE=y
                CONFIG_IP_NF_FILTER=y


                It took me hours to figure this out; I finally found the hidden "netfilter configuration" submenu, which is nowhere near the part of the menu where you enable netfilter. Grrrr....

                After doing that, I was quickly able to set up X to use an international keyboard. It was a simple matter of adding a single line to my awk script that customizes X, and a /var/lib/xkb directory to the ramdisk.

                I was able to make some more room on the disk by removing all duplicate files in my huge set of English lessons. With the extra room, I was able to have a kernel with full built-in iptables support and the iptables program (about 200k when all was said and done); and a zipfile with the the entire Bible in HTML (about 1.6 megs), and one English lesson I had to delete from yesterday's version of MOAM-CD. All of this is in my private 200meg MINI-CD; the public version only has some programs MOAM-CD uses and script to make a CD image on a CentOS 3 system with Opera installed.

                I was up until 2:30 AM deal with all of this. I think I am done with the MOAM-CD project for now; I now have a system that has X refreshed at 70hz (easy on my eyes), a recent Web browser (that is reasonably secure as long as I don't install earlier versions of Flash), and even a full C development environment for developing MaraDNS. Not to mention Freecell (Ace of Penguins is so tiny, this is a freebie: 200k including the PNG library Ace of Penguins uses)

                The public version is here:

                http://www.samiam.org/moof/moam-cd-0.2.tar.bz2 (sig)

                So now that this is done, I can deal with MaraDNS again. I will look at those two issues this weekend. Hopefully.

                - Sam

                Thursday, May 3, 2007

                MOAM-CD 0.1 released



                I have released MOAM-CD 0.1 today. This is still an early developers-only release. It took me over a day to figure out how to get initrd to work. Not only must it use a filesystem with a 1024 byte block size, but the documentation on how to get out an initrd forgets to mention that the kernel will panic unless you do this before the pivot_root() then chroot() commands:

                echo 256 > /proc/sys/kernel/real-root-dev

                I only figured this out from looking at the initrd included with KNOPPIX/DSL. Can you say crappy documentation?

                Once I got past that hump, it was fairly easy to get other things to work. DNS resolution doesn't work in GLIBC unless you have a /lib/libnss_dns.so.2 file; the libnss documentation explains all this very clearly so it was tirivial to resolve. I also now have a development environment; I can use MOAM-CD to compile and test MaraDNS. This allows me to perform MaraDNS development when I am out and about, and hopefully allow me to more quickly respond to MaraDNS bug reports and support requests. I also added the real version of wget for downloading web pages. The entire system is still smaller than a business card CD--about 48 megs in size.

                It's really easy on the eyes. I like being able to look at 800x600 refreshed at over 70hz. Doesn't give me the headaches a 60hz screen gives me. If it were only possible to have Vesa refresh at 70hz.

                The next thing I will work on is security. Basically, I need to get iptables to work so the X server can not be remotely accessed. Once I do that, some other things I need to do:
                • Fix X so I can start X as a non-root user
                • Fix Xkb so I can have a non-US keymap so it is possible for me to type in accents (This one is important; right now I have to write to my Latino friends in Spanish without accents. Ugh)
                • Add a real version of the patch program (for MaraDNS work)
                • Maybe add a MSN-compatible IM client so I can chat with my friends who prefer IMs over email


                MOAM-CD can be downloaded at http://www.samiam.org/moof/moam-cd-0.1.tar.bz2 (sig)


                Yes, I'm neglecting MaraDNS. I promise to look at the two bug reports before the end of this weekend. I've been neglecting a lot and working really hard on getting this mini distribution of Linux going.

                Tuesday, May 1, 2007

                MOAM-CD update



                Last night, I set up an initrd filesystem. However, when I tested it, the kernel did not see it; it acted like the initrd was not there and tried mounting the normal root filesystem. This morning I found out the reason: initrd systems need to have a 1024 byte block size with their filsystem. Minix, I presume, doesn't have this. I used a minix filesystem to save space; however it looks like I will have to have the bloat of an ext2 filesystem in order to have the 1024 byte blocks the kernel wants for the initrd. I was recompiling the kernel to have built-in ext2 support this morning the the kernel just infished compiling before I had to run out the door to teach English.

                I still have two MaraDNS issues to look at.

                - Sam