Planet LILUG

August 23, 2008

Justin

odd nmap timings

Back story

A section on a web application I have pings (using a background AJAX request) a list of IP addresses. Most of the time all of these adresses are up, sometimes one or two of them are down. One day I noticed that if all of them were down, nmap would take much longer to ping them all.

The odd part

Lets ping 19 addresses on my home network, none of which exist.

justin@latitude:~$ time nmap  -sP 192.168.5.2-20 

Starting Nmap 4.53 ( http://insecure.org ) at 2008-08-22 21:56 EDT
Nmap done: 19 IP addresses (0 hosts up) scanned in 4.072 seconds

real    0m4.081s
user    0m0.068s
sys     0m0.004s

Ok... now lets add the routers address, which is pingable.

justin@latitude:~$ time nmap  -sP 192.168.5.1-19

Starting Nmap 4.53 ( http://insecure.org ) at 2008-08-22 21:58 EDT
Host router (192.168.5.1) appears to be up.
Nmap done: 19 IP addresses (1 host up) scanned in 2.258 seconds

real    0m2.259s
user    0m0.048s
sys     0m0.008s

Notice anything odd?

I have experimented with the usual host timeout and max rtt time options, but I am not sure what the problem is. As soon as I get a chance I will look into the code. I am not sure if it is a BUG or just user error. A simple strace of the two commands show much different behaviour with respect to select.

August 23, 2008 02:02 AM

August 17, 2008

Josef "Jeff" Sipek

Blahg outage

As some of you may have noticed, my blahg has been down for about 2 days. The reason is, I upgraded my system, and php4 packages broke. I just installed the php5 packages, and things seem to work again.

by JeffPC at August 17, 2008 01:04 AM

August 08, 2008

dorgan

Busy Week

Well this past week has been extremely busy both @ work and after work with Andromeda. Which is funny because both are connected. The e-commerce project I have been working on for the past ~5 months now uses Andromeda, so a lot of the bugs, most in my custom code not so much Andromeda lately, that I find keep Ken a little busy.

But besides that Ken has been busy this week getting SVN(subversion) working for upgrades of Andromeda, and also deploying Andromeda applications. We will hopefully be announcing the AndroPage feature this week, it is currently available in the most recent releases of this week we just haven't announced it. I am working on getting the LIPHP site wrapped up so we can get that out there.

I have a couple of extra that I am going to work on this coming week for Andromeda which include report back features this way we can start to see how people are using Andromeda as well as where in the world people are using it.

I can actually say that I finally have used a framework that I would use for anything. And it does try to separate the code into all sort of sections and folders, my worst experience with something like that was fusebox(Coldfusion) or Mach-II also coldfusion. Drupal and Joomla both have way too much stuff to sort through to find anything, and then when you have found it, you havent it's something that just has the title that you were looking for.

Andromeda makes creating an application with logic easy, and even just a website is easy to throw together with Andromeda and is even easier since the introduction of AndroPages. I am going to also start working out my idea of creating a google chart plugin for AndroPage which will bring reports to the next level.

Well that also for now, happy programming everyone.

by Donald J Organ IV (noreply@blogger.com) at August 08, 2008 06:02 PM

August 05, 2008

Josef "Jeff" Sipek

Audacity UI feature

Although I’m filing this under the “rants” category, don’t get fooled. The rant is about UIs in general, with Audacity being the exception.

Here’s what happened…I was going to save the recordings of my radio show to my computer, and I noticed that the first hour recording started about 4 minutes after I took over aether. That meant that I needed to get the previous hour, and cut whatever short portion into a small file and keep it along the 3 1-hour long mp3s.

For audio editing, I tend to use Audacity. It works well, it’s rather intuitive, etc., etc. I did the cut, and I was going to export it as an mp3 (to keep the file format consistent with the other 3 hours of audio, otherwise I’d make it an ogg/vorbis). Audacity let me chose the new file name, the new format, but then when it was about to start the actual encoding, this dialog popped up:

Audacity needs libmp3lame

This is absolutely brilliant! And I mean it; I’m not being sarcastic as I usually am. Normally, one of these scenarios happens…

  • …the application gives you a “I can’t find the encoder” at start (if at all), and disables export to that file format
  • …the application gives you a “I can’t find the encoder” at the start of the encoding process, forcing you to abort the encoding, potentially closing the application, to installed the codec, and redoing whatever you did and trying to re-export
  • …the application gives you a “I can’t find the encoder” at the start of the encoding process, making you look through numerous preferences windows to find the one you care about - if it even exists
  • …the application gives you a “I can’t find the encoder” at the start of the encoding process, making you trying to figure out which environment variable (LD_LIBRARY_PATH, LD_PRELOAD, etc., etc.) will make the linker do the right thing, and make the application find the .so

All are sub-optimal. Asking the user for the path to the .so, while not the newbie-friendliest of things, is really the best thing the application could do. This way, if the .so isn’t installed, the user can install it anywhere - system wide or in one’s $HOME - and then point Audacity to it. If the .so is installed but Audacity couldn’t find it, you can manually point it in the right place.

I use Debian, so installing libmp3lame was a matter of making sure I have the Debian Multimedia source in my sources.list, and then running a quick aptitude install to get it on my disk. If you are using a less privileged distro (or if you don’t have root access to install it system-wide), you’ll have to quite possibly go to the project’s website, and grab a copy there. Audacity’s UI designers haven’t failed you there. A convenient way to go to the website to download the .so is right there.

Overall, seeing this dialog didn’t make me agitated that Audacity wants something I don’t have installed, but instead it made me write this post about something that makes sense, but people fail at doing things like this.

by JeffPC at August 05, 2008 08:45 PM

August 02, 2008

Josef "Jeff" Sipek

Wordpress sucks, archive.org rocks

This is a follow up post to Wordpress sucks from a week ago.

I decided to try to figure out some more category names, and then it hit me…my site is crawled from time to time by The Wayback Machine. So, I searched, and found a copy from November 2007. Not the latest, but quite new enough to have all the categories I had. A little while later, my blahg is back to its former glory. And there was much rejoicing.

by JeffPC at August 02, 2008 04:32 PM

Wordpress sucks

As I mentioned in my previous post, I decided to upgrade my Wordpress install. Every single time I upgraded it, I have no problems whatsoever. So, this time around, I didn’t make a backup of the DB tables. Well, that was quite stupid of me. I copy over the new files (2.6 release tarball), and run the upgrade script. Poop! I lost all the category labels and descriptions. Gah! Absolutely, not fun. I have 40 categories, and now they don’t have any labels. Well, not anymore, I’m trying to figure out which category id was which category (sometimes not as easy as it should be). I got some, I’m not sure about some. If you had links to any categories, they’ll still work. If you had links to any posts, they’ll still work. Things will just look a bit disorganized if you look at the list of categories on the website, or if you look at which categories a post belongs to.

Please send any and all hate mail to the Wordpress developers for breaking an upgrade from one stable release to another.

by JeffPC at August 02, 2008 04:22 PM

mbox vs. maildir

Over the past two weeks, I decided to try converting some of the mboxes I have for mailing lists to maildirs. Last time I tried to do it, I noticed an unacceptable delay when I started mutt. Not when I tried to load the largest maildir. That made me give up.

For fun (or was it profit? ;) ), I decided to try again. And again, I saw that delay. This time around, I ran strace on mutt, and I found out that my custom .muttrc was making mutt believe that every file in the maildir was an mbox. Fixing up my muttrc made the delay go away. Now, I have start up times that are the same as with purely mbox setup, but opening up these maildirs takes up WAY less time. I’m talking fraction of second instead of 5-10 seconds.

I’m considering converting all but the spam box to maildir. I really don’t need thousands of extra inodes which I’ll never use anyway, but at the same time, I don’t mind having one gigantic file full of the spam messages (I keep them because I don’t manually check that no good messages got misclassified by spamassassin). I am going to probably tell XFS to reserve some diskspace for it, to prevent lots of fragmentation from the constant open-write-close syscall cycle.

by JeffPC at August 02, 2008 04:19 PM

July 29, 2008

Tony B

Island Labs

We started this new organization called Island Labs, located at www.islandlabs.org.

The group is focusing on mechanical engineering, software engineering, electrical engineering, and even some chemical engineering.

The group is open to the public, and you can see meeting time and location on www.islandlabs.org on the top links.

The next meeting will be a cool talk about multitouch on Wednesday, July 30th, at Farmingdale State.

by tonyb at July 29, 2008 02:12 AM

July 28, 2008

Elliot



So a few of my peers have decided to launch a new organization called Island Labs, located at www.islandlabs.org. The group is focusing on mechanical engineering, software engineering, electrical engineering, and even some chemical engineering. the group is open to the public and you can see meeting time and location information on their website.


I personally have a tremendous appreciation for people who are knowledgeable in areas that can improve the human experience.

by Sir Elliot (noreply@blogger.com) at July 28, 2008 08:23 PM

July 26, 2008

Josef "Jeff" Sipek

OLS 2008 - Day 4

I’m a still a day late when it comes to writing about OLS. Here’s Friday’s list of talks, and other happenings.

The day began with A Practical Guide to using Git (From a Kernel Maintainer) - it was very crowded in the room, so much so that I didn’t really see the slideshow, but since I already know enough about how to use Git, I don’t mind all that much. Good talk.

The next talk which I kinda had to go to was SynergyFS: A Stackable File System Creating Synergies Between Heterogeneous Storage Devices. It was a disaster - and I put that mildly. The first 30 minutes of the 45 minute talk consisted of Samsung branded marketing material showing that solid state disks were better than the regular platter-based disks. Since the marketing people care mostly about Windows users, the propaganda materials consisted of things like a video thing showing Microsoft Windows Vista booting on two identical laptops - with the exception of the storage device.

Anyway, about 2/3 of the talk through, a SynergyFS got mentioned. And that’s when the one quite important bit got mentioned. At the time of the writing of the paper, the filesystem was a “proposed filesystems.” In other words, it didn’t exist. I am not certain if it exists at the moment, and if it does, what state it is in, but I do know (since an audience member asked when/where he could look at the code) that unless one signs an NDA with Samsung, he can’t even look at it. The code is not GPL licensed, since Samsung lawyers apparently see it as a way to lose some magical intellectual property, which as far as I know they never had. There has been papers published about hybrid storage, there have been papers published about fanout stackable filesystems, there have been papers published about fanout stackable filesystems which use different storage technologies (in no particular order: FiST, GreenFS, RAIF, Unionfs).

Overall, I feel like going to the talk was a waste of time. Meh.

Then I lunched.

Well, just before lunch, I was playing around with SELinux on my laptop, and after logging in, the processes weren’t getting the right context. After lunch, I went to SELinux for Consumer Electric Devices. I walked into the room, and saw the NSA/Tresys/RedHat SELinux developers (including Dave Quigley) clustered in one area of the room. I just couldn’t resist, and I said “SELinux sucks” and then proceeded to walk away. The really amusing thing was all the SELinux people turned around to see who it was that dared to say such a thing. Very amusing. I sat next to them, and mentioned my SELinux problem. Stephen Smalley tried to figure out what the problem was, and in the end, reached the conclusion that somehow, even though the targeted policy was in use, the system was using some information from the strict policy completely confusing everything. I installed the strict policy, and things started working….well, for the most part. I should file this under the Debian bug tracker since it is a bug.

The SELinux talk was ok. It was what I expect…SELinux is kinda bloated for embedded systems. Some time after the talk, I overheard Stephen Smalley talking to Dave, saying that they should look into it a bit.

The next talk which I went to was Around the Linux File System World in 45 minutes. The reason I went to it was because it was being presented by Steve French. It was interesting, as I expected, and I’m going to read through his paper to see what exactly he did for the accounting (and what his thoughts are).

After Steve’s talk, I was going to go to a BOF about MIPS kernel port, but got distracted by people (including Steve).

At first, I wasn’t sure if I was going to go to the keynote (The Joy of Synchronicity) by Mark Shuttleworth (of the Ubuntu, space travel, and other-random-stuff fame). The title alone makes it sound like a hand-wavy, dreamy thing, but in the end I decided to at least spend 5 minutes listening. It was ok. Not great, from a technical perspective, but he did have some interesting ideas…well, it was really all just one idea - open source projects should have regular release schedules. I don’t know if I agree or not. On one hand it’s a nice thing, but at the same time, schedules are quite annoying when you want to make major changes (the KDE 3.x to 4.0 changes come to mind). In the end, I did stay the entire time, but I bailed at the beginning of the Q&A session.

Some food later, I headed to the hotel room to finish up writing notes for the day before. Well, I tried to upgrade my Wordpress install…but more about that later.

by JeffPC at July 26, 2008 07:01 PM

Porcelain Incident

Earlier today, July 25 2008 at 9:35 AM EDT, in Les Suites hotel room 1614 located in Ottawa, Ontario, Canada, an unidentified Canadian national going under the alias Shawn, was caught by security moving porcelain items from one of the bathrooms into his bed.

Porcelain Incident, exhibit 1
Porcelain Incident, exhibit 2
Porcelain Incident, exhibit 3

by JeffPC at July 26, 2008 02:28 AM

OLS 2008 - Day 3, Part 2

Ok, here’s the rest of what happened yesterday.

My BOF went fairly well. Of course, I have the slides for your perusal. For the demo, I started with following the HOWTO in the Documentation directory of the guilt repository, but soon after, I just deviated, and used the demo time to show people what happens under some cases that they were asking about. I got some useful questions. I even got an email from one of the people asking a question with the details about the question he asked.

After my BOF, a former labmate, Dave Quigley had a BOF about SELinux. During it, I decided that it would be fun to try SELinux again. I installed a bunch of Debian packages, fixed up a few config files based on the SELinux Setup page on the Debian Wiki, and rebooted to have the system relabel itself. That took a looong time. Mostly because I have something close to 300 thousand files on my laptop, and each and every one of them had to get a new extended attribute => every inode had to either set up an in-line xattr, or if there isn’t enough space, a new extent for the 20-40 byte label (I guess closer to 64 bytes with the label name + value).

One amusing thing that happened during the BOF was…at one point, Stephen Smalley (SELinux master-mind), was commenting about AppArmor (a competing security system) when he said “AppArmor is better…” well, the ellipsis really is “…than nothing.” :) Someone there actually made this joke.

After the BOF, Shawn Starr, Dave Quigley and talked for a couple of hours about a ton of random topics. Fun, fun, fun.

When Shawn and I got to the hotel, I mentioned the fact that he moved parts of the toilet the day before at an ungodly hour (something like
7:45am)…but for whatever reason I said “you moved the porcelain” … that’s where things took a strange turn… The endless stream of porcelain jokes just kept on going on and on.

by JeffPC at July 26, 2008 01:49 AM

July 25, 2008

Josef "Jeff" Sipek

OLS 2008 - Day 3

Yeah, I really wanted to write this yesterday - since it is about yesterday, but I was too tired when I got to the hotel. Either way, here it is.

The day started at 10am again - I love it. Previous years, presentations started at 9am (except the first day that was 10am). The first talk I
attended was a about kernel documentation - where it resides, and why the current state is bad. The talk was a bit confusing. At one point, the presenter decided to read some text right from a HTML file - opening it in a text editor instead of a browser. He also seemed to contradict himself a bit … at one point he seemed to have said that HTML was better than plaintext docs, and then some time later, he said the other thing - plaintext docs were better than HTML.
I kinda gave up understanding what his point was.

I decided to be lazy, and stayed in the same room for the next talk: On submitting kernel features. I zoned out for quite a bit - I knew a bunch of things already, and it was a bit hard to lex what Andi Kleen (the speaker) was saying.

I was going to go to the ext4 talk. Unfortunately, I got distracted by people on my way to the talk, and before I knew it, I missed most of it. I guess I’ll just have to read the paper.

After lunch, I went to Virtualization of Linux servers: a comparative study. The talk was interesting, and I will read the paper. It showed exactly how much x86 virtualization sucks (at
least compared to what’s on the mainframe). I can’t wait to have some time to hack on HVF some more. :)

Then, I got distracted by people, preparation of slides for my BOF about Guilt, pondering about trying SELinux again, etc., etc.

Anyway, I’m going to finish a summary of what happened yesterday later today. Until then…

by JeffPC at July 25, 2008 07:45 PM

July 24, 2008

Josef "Jeff" Sipek

OLS 2008 - Day 2

Day 2…well…day 1 of the conference. The first talk (a keynote, actually) started at 10am. Unfortunatelly, I couldn’t use my phone as an alarm clock as the LCD broke earlier this weekend…

Broken LCD

…and yesterday before going to bed, I forgot to set the time on the alarm clock in the hotel room. So, I got up when it felt like a good time to get out of bed. Well, oddly enough, that turned out to be something like 7:30. A bit scary actually.

Anyway, a croissant and some orange juice later, I was at the conference center, with about 45 mins to spare. I ran into Bruce Fields (one of the NFS guys; working at University of Michigan).

The keynote was ok. First, there were some technical problems (the mic and the projector didn’t work), once those got out of the way and the actual talk began. The speaker was a bit too quiet - not sure if that was his fault or if the amplifier wasn’t set to the right level.

After the keynote, as people started pouring out of the room, I saw Dave Quigley (a former lab mate from FSL) hanging around some SELinux guys (makes sense, since that’s what he’s working on). We talked for a little, and then headed down to one of the talks in the next time slot: Confining the User with SELinux. It wasn’t bad…but being no fan of SELinux, I probably didn’t get all the fun out of it. I am somewhat tempted to give SELinux a try…again.

Seeing that there were no interesting looking talks, Dave, I, and 5 people doing SELinux work went out to get lunch. I had some pretty good burger with blue cheese…I think I’m on a blue cheese binge.

After lunch, it was time for another talk to attend. I decided to check out the “Real Time” vs. “Real Fast”: How to Choose?. It wasn’t bad at all. Not being into real-time systems, I learned a few things here and there.

For the next talk, I just stayed in the same room. It wasn’t much fun. The presentation wasn’t the best, and about 15 minutes into it, I realized
(talking with some people on IRC) that there was another talk in the other room that I wanted to see. So I left.

The other talk (Tux meets Radar O’reilly - Linux in military telecom) was good. Well presented, and while obvious, it made a couple of thoughts explicitly stated.

The last talk (A Runtime Code Modification Method for Application Programs) for the day was quite interesting. I am going to check out the project website and read the paper in the proceedings.

After talks, there were BOFs… I went to the ones about Kernel.org and iSCSI HBA with Linux OpeniSCSI.

The kernel.org BOF was much like last year - and it was a good update to see what’s going these days with the services they provide. The summary: things work. :) And more will work.

The iSCSI BOF was interesting. I got to hear about some iSCSI offload stuff that Broadcom is working on.

After the BOFs, I waited around for a little bit with Christoph Lameter, Pekka Enberg, and Bruce Fields. Then a bunch of people from the conference (I guess something between 25-35 in total) headed to a rather fancy place for some food. The soup was good. The salmon was good. The ice cream was good.

Anyway, it’s getting late, and I should get some sleep tonight.

by JeffPC at July 24, 2008 02:57 AM

July 23, 2008

Josef "Jeff" Sipek

OLS 2008 - Day 1

Times has come once again to talk of Ottawa Linux Symposium. Yep, that’s right it’s that time of the year again (ok, I’m posting it a little bit late).

Today was mostly uneventful. I woke up just before 6, got to the airport, flew to Ottawa, got to the hotel, realized I was about 4 hours early for check-in. I left my bag at the hotel, and went to the conference center. There I ran into Christoph Lameter. Having nothing better to do, we decided to pick up our registration and then go eat something.

When I got to the airport (LaGuardia) in the morning, I went on to continue reading a book I was about 2/3 of the way through - Princess Bride. My reading got briefly interrupted by the boarding call. After boarding the plane, I resumed reading. There is one really nice property these paper things have over electronic ways of eating up time…they don’t need to be turned off for take off and landing. Anyway, I fished the book while waiting for the hotel shuttle at the Ottawa airport. For what it’s worth, it’s a good book that everyone should read.

Around 6pm, a bunch of people I know (but probably shouldn’t associate myself with them in public ;) ) got to the hotel…about 2 hours later, one
of them, a weather-loving KDE code monkey (yeah, that’s you Shawn) and I ordered pizza. It was quite tasty, as were the chicken pieces in the
blue-cheese sauce.

Anyhow, time to run to the next talk….I’ll try to post at least once a day with random stuff…we’ll see how that goes.

by JeffPC at July 23, 2008 06:51 PM

July 22, 2008

binarydigit

BIND zone file management

Anyone out there have any recommendations for managing zone files in BIND? It seems the general consensus is that people just end up using home grown systems. A lot of the web based projects out there are either abadoned or use strictly a database backend which is nice but it adds another layer of complexity, and a failure point. I'd like to be able to switch back and forth between using the management system and being able to do an inline search and replace if need be , on my zone files.

by anonymouscoward (noreply@blogger.com) at July 22, 2008 10:22 PM

Nate Berry

First open phone

Linux

The first open phone is already out (for developers) called the Neo Freerunner. By “open” I mean that the OS is fully documented, and customizable by those with the skills to modify it. It is using Openmoko which is the competing open mobile operating system (OS) to Google’s Android mobile OS (still no phones with that yet as far as I know). Both projects are leveraging the linux kernel which makes this exciting to me. You can use the new $400 device (which is currently sold out) on the AT&T network, but its mainly going to Universities for use in computer science classes right now.

To be fair, these types of devices are really a lot more than just a “phone”, they are really true mobile computing devices with touch screen input, nice screens (relative to the little Motorola RAZR screens if not the iPhone ;) and enough OS horsepower to actually be useful for real computing. While I don’t expect anything as amazing as the iPhone to secretly emerge, I would be more interested in an open phone than a closed source one on principle as well as potential. (disclaimer: I don’t currently have a cell phone).

Two good websites to watch for news as the 700MHz spectrum opens up next year are:
http://www.openmoko.com/
http://code.google.com/android/documentation.html
We will either see a whole lot of new open phones appearing next year, or a whole lot of nothing since the ‘open spectrum’ was gobbled up by AT&T and Verizon (Google didn’t get any), and neither company probably has any real interest in allowing the other’s customers to operate over their network.

by Nate at July 22, 2008 12:42 PM

July 20, 2008

Josef "Jeff" Sipek

Marion’s Attic

Today, while spending some quality time on IRC, a link to Marion’s Attic appeared on my screen. Instead of describing what’s going on, I’ll just quote the website:

My show features recorded music with the original records from the 1890’s to the early 1930’s. The theme of the show varies each week. One week may feature early brown wax cylinders and another week may have 20’s dance music. Two-minute wax, Blue Amberols, and Diamond Disc Recreations are featured frequently.

I listened for about 30 mins, and it was quite interesting to hear recordings over 100 years old.

by JeffPC at July 20, 2008 02:53 AM

July 13, 2008

binarydigit

Instruction booklets for furniture

Since moving into the city I've had to assemble a lot of furniture from ikea and other various places. Today while putting together snack tables from bed bath & beyond I believe I discovered my source of why I hate putting this crap together, the instructions.

You see in order to save money on printing costs places like Ikea use picture only instruction manuals so they don't need to translate every booklet into every language where they ship to. Ok, that's fine , and anyway you don't need much verbal explanation when it comes to fitting round pegs into round holes, you just need to know which is the proper hole to place said peg in.

Here is where Ikea, and all those other places fail , they lie to you in the number of steps it takes to assemble. "This drawer assembles in 3 easy steps!", fuck you, step 1 has me placing 10 screws in and involves 5 separate pieces , step 1 should only involve one smooth motion of me inserting one item into another, bam step 1 is over with, now lets take a look at step 2. Got 5 screws? 5 separate steps. Stop with these shortcuts. When you have 453 things happening in step 1 the picture becomes a massive scribble of fail. I have yet to completely assemble anything 100% correctly that involved picture steps , my ikea draw has a piece on backwards and one of my side tables is missing a few screws, but as long as they don't collapse on me without warning, I'll feel mildly content.

by anonymouscoward (noreply@blogger.com) at July 13, 2008 08:47 PM

July 07, 2008

John Lutz

Scala, XSLT, Java, JSTL, XML

Well, since last thursday I have been reviewing this new super language called Scala it sits on top of Java or .NET (which means you can use all of the libraries of these two platforms). This is great! I have another 3 words for it: I Love it. One big reason it's such a plus for me is because you can mix Scala code and XHTML (or xml)  at the same level so for instance:

var aVarName = insert html code here (the blogger won't allow it); 

Thats right, it's that easy. There is even a full online XML book for Scala available. Just follow the links off of scala-lang.org and you'll find it. Anyway, I found that I wasen't getting much work done so I started work under XSLT on Sunday which made be feel better again. I think I'll just save Scala 's tutorial for times I need to wait for things in real life. Otherwise, It's onwards with the programming languages for the masses. I really enjoy programming and all the varieties of languages. But when I'm not implementing my head goes dry and I get depressed not good. Always good to bounce ideas and plans with those you know so you can ingrain this knowledge.

I'm about to make a simple program to weed out defintion text from wikipedia.org's site using XSTLproc. The example I have works fine , but the implementation I wrote doesn't , so the solution is just a matter of blending both together (I get no errors either).

Until next time,

JohnnyL

by JohnnyL (noreply@blogger.com) at July 07, 2008 06:43 PM

Trials and Tribulations (mental health)

Well, it has indeed been awhile since I last wrote you. Short span regressions and longer healing time were needed to get the author to where he is now. At home writing XML , going to program and making sure I take medications for hallicinations. I have to say, my delusions can go rather deep and seem oh so logical. For example the premise that there are people from the future planting people I know with DNA based robots (Carbonite Based) and that there mission is to support me but not with any Love. My memories past sorta shuts off when these things occurs. It doesn't just stop there. I may as add a weekly delusion as time goes on to let your creative juices fly. I have enough for maybe 10 volumns. Check in to see.

    I have spent more than 4/5ths of the last two years in hospitals, the latest Pilgram State Hospital. And let me tell you it is awe-ful. The food easily generate the gag response. The staff has to act all rough and loud (or the patients will have their way with them) and the staff gets enough time to just get enough done (easy upkeep for them). The interns work their bleeding hearts out. There was one women there who was supposed to have a meeting almost everyday and the only time I saw her was in the hall ways, probably picking up a check.

The only time she talked to me was when she was impressed by one of my many paychecks (as a computer programmer). Anyway, thems the pitts. Some of the staff was actually cool (usually the younger ones). Anyway I spent 4 1/2 months at that facility and I'm going to do my damn hardest to stay out. Just today I had another anxiety attack. I get voices in my head that over lap and are very negative. I counteract them by suggested positive thoughts or concentracting on my breath. This helps. They have been getting lighter. I can function while i'm going under one. Which is alot more than I can say about 2-3 years ago. Anyway, It's such a relief when I'm done with one. Like a heavy lift has been taken off your head.

I have been to Stony Brook, Brookhaven Memorial Hospital, Pilgram State, New Brunswick and thats it. I have had enough of all of them and want to stay out for good. So let it be written so let it be done!

by JohnnyL (noreply@blogger.com) at July 07, 2008 06:08 PM

July 01, 2008

dorgan

ExtJS

I've been working with ExtJS lately, and I must say I am highly impressed. For those of you not familiar with ExtJS (Ext), Ext is a crossbrowser javascript framework that allows for the creation of RIA (Rich Internet Applications).

Ext uses the latest and greatest web 2.0 methods, such as ajax, which has built in parsers for JSON, XML, text and possibly some other formats. Ext allows for the creation of desktop looking interfaces with just som simple notation(Ext is probably not the first project to do this)...this in my opinion is one of the greatest things Ext has to offer. The simple notation way of creating these interfaces allows for rapid deployment of interfaces, and takes the GUI creation out of the hands of the developer, and allows the developer to focus on getting the data to the front end.

Alot of chatter has been generated in the past couple of months on the decision to change the licensing model. The most current version of Ext uses the GPL 3.0 model in my opinion it may have not been the greatest of choices for a license however it still allows you to create open source applications. And if you want to build an application that you will be selling for $ you can purchase a license which will ultimately help support the project and only make it better.

There is one negative aspect to Ext, the documentation....yes all the information you need is there and they even give some basic code in the documentation however in my opinion the examples of interfaces/widgets are all given in the notation format of creating objects however the examples in the docs all give examples of referencing things or adding eventlisteners via old sytle javascript. This i think determs alot of people, they do have a community support forums but that can also at times be discouraging, as it may take a couple of bumps to get a question answered.

In my opinion the Ext documentation could take a lesson from the PHP documentation and add common examples in this notation style format, for the various things you may want to do with an object/widget/datastore.

In the end Ext is a great product with a bright future and just needs to polish its documentation as well as it has its interface objects.

by Donald J Organ IV (noreply@blogger.com) at July 01, 2008 10:54 AM

June 22, 2008

Justin

Python Evolution: From Script To Program

The Evolution of a Python Programmer is funny, but it only covers one aspect of programming. Many times I will see code that is fine from a CS point of view, but absolutely horrible when it comes to program structure and module organization.

You often see people saying things like "Hello World in python is just 'print "Hello World"'", and that is true. It is very easy to get started writing python, but if you don't structure your modules correctly, you will be in a world of pain later on. It is something that can be hard to explain, since the results in the short term are the same, and it may not be clear at first why one way of doing things is better than the other.

Instead of Hello World, let's take the example of a program to get stock quotes. The actual implementation here is not relevant, pretend it contacts a web service or database or something.

A common case is the "python script". I HATE python scripts. "script" almost always ends up being a single file with no entry points, no main function, and mixes IO with logic.

s = raw_input("symbol:")
if s == 'MSFT':
    print 'price=', 28.23
elif s == 'GOOG':
    print 'price=', 546.43

The first step in fixing this is to define an actual function. Now you can import the module and run get_price().

def get_price():
    s = raw_input("symbol:")
    if s == 'MSFT':
        print 'price=', 28.23
    elif s == 'GOOG':
        print 'price=', 546.43

The (hopefully) obvious problem with this is that the IO is mixed in with the logic. What if you wanted to get the stock price for 1000 stocks and output a nice summary? This next version is slightly better, here the input is a proper parameter, but you still have no control over the output. You could get your 1000 quotes, but you would have no way to report on the output. Again, this should be obvious, but I come across code that does this way too often.

def get_price(s):
    if s == 'MSFT':
        print 'price=', 28.23
    elif s == 'GOOG':
        print 'price=', 546.43
###
if __name__ == "__main__":
    s = raw_input("symbol:")
    get_price(s)

The first respectable version adds a main() function that handles the input and output. The main function should also get the stock from the command line arguments, rather than interactively. I think you tend to see things like this more often from windows users, who like to double click on things rather than run them from a shell. You could probably write a whole book on this subject though :-)

def get_price(s):
    if s == 'MSFT':
        return 28.23
    elif s == 'GOOG':
        return 546.43
###
def main():
    s = raw_input("symbol:")
    print 'price=', get_price(s)

if __name__ == "__main__":
    main()

The final steps are to make a proper python package out of this module, but I'll save that for a later post.

June 22, 2008 03:12 PM

June 18, 2008

dotCOMmie

Photo on Linux

I've gotten into a photo mood lately. Both shooting editing and organizing. With it I've discovered some new useful tools as well gotten to know the ones I've used before better.

The first and foremost is digiKam its a photo manager. Its primary job is maintain a database of all your photos. Photo-managers are not something most people have used so it might need some getting used to. The interface for digiKam is quite intuitive and easy too pick up. And for the average photo junkie it will have everything they need. But it certainly lacks some features which I think a self respecting photo managers must have. Here are some things I wish it had:

  • Way to flag a photo as a different version of another. (They should share all meta-data such as tags and description)
  • Split into a backend/frontend for centralized photo management. (KDE4 version supports multiple database roots so this can be used as a workaround)
  • Multi user support. If your whole family goes on a trip being able to collaborate on an album is essential
  • Export/import album with all meta-data (so one can share a whole album with someone else)
  • Save export options of raw images along with raw image.
  • HTML album generator needs to include meta-data (description, tags etc..)
  • Better gallery2 integration
    • better support for raw images (does not scale raw on upload).
    • Automatically fill out gallery title and description using local info.
    • Ability to preview pictures on select.
    • Better error messages.

Most of these issues are not major, especially since some of these will be solved with the multi-root support of the KDE4 release. I started with the negatives but it has a lot of cool features also. One of my favorite is calendar view. Regardless of how your galleries are organized it will use the EXIF date tag to arrange all your photos by date. It really helps when organizing photos. Tagging is also very useful, you can tag any photo and then you can view all photos by particular tag really make it easy to organize data. DigiKam also has a slew of semi-functional export features such as gallery2, flickr, and picasa. These are provided through the kipi framework, they are nice but most require some more work to become completely feature-full and userfriendly.

Almost forgot, digiKam is also an excellent tool for downloading photos from cameras. Most cameras are not plain UMS devices so they need special software to fetch the pictures out of them. If you are on windows you can usually use the manufacturer software to do this, but on Linux this is a tad complicated. Unless of course you use digiKam -- which turns the process into a magic "detect [the camera type] and download" single click operation.

To share my photos with the world I use a web based photo-manager as a front-end to my local database. Its called gallery. I have tried this tool in the past and it was just too cumbersome to use (I ended up writing my own PHP gallery system). But with the kipi export plug-in to digiKam and the remote plug in to gallery life just become easy.

The last few tools are only important for someone who is seriously into photography. The first is a gimp plug-in called ufraw, its basically a frontend to dcraw. It allows you to preform advanced raw editing before you import your photo to gimp -- you can adjust almost any aspect of your raw file conversion (lightness, white balance, hue, saturation..). UFRaw is a bit daunting but you don't always have to use all the features it provides, lightness is probably the only one you'll have to adjust on a regular basis. Another tool is called exiftool its used to read and manipulate EXIF information in pictures. There are times where you can loose the EXIF data while editing a photo (IE when saving to png in gimp) and using this tool you can quickly clone the EXIF info of one file onto another using the -TagsFromFile option. It even supports batch mode, for example "exiftool -TagsFromFile IMG_%4.4f.CR2 *.png" will copy the EXIF information to all PNGs from its parent file using the file name as mapping (sample file names: IMG_2565.png IMG_2573_1.png IMG_2565.CR2 IMG_2573.CR2)

So that's it for now, shoot away. And if you like, you can check out my public gallery.

by dotCOMmie at June 18, 2008 03:19 AM

June 13, 2008

Tom "supertom" Melendez

Things that annoy me in computing

Even to this day, these things exist. What gives? Browser inconsistencies - please, don’t get me started Non-secure login - there is NO GOOD REASON as to why I should need to log into your website without SSL. Most of you have it, why isn’t it the default? By you not redirecting me to [...]

by SuperTom at June 13, 2008 10:35 PM

June 10, 2008

Justin

erlang basic distributed application

Erlang with OTP is a fairly powerful framework for creating distributed redundant applications. The basic gen_server behavior can easily extended to create a redundant server with built in failover. With Mnesia you also get a replicated Database.

I've been trying to figure out how exactly this is supposed to work, so I've been working on a quick application to demonstrate this. It's nothing fancy, just a simple set(k,v) and get(k) API.

The files are available as a tarball from here ddict.tgz

-module(ddict).
-behaviour(gen_server).
-export([start/0,stop/0,terminate/2]).
-export([init/1, handle_call/3, handle_cast/2,handle_info/2]).
-export([create_schema/0]).
-export([get/1,set/2]).


-define(GD,{global, ddict}).

-include_lib("stdlib/include/qlc.hrl").
-record(rec, {key, value}).


init_mnesia() ->
    mnesia:start(),
    ok = mnesia:wait_for_tables([rec], 2000).

init(_Arg) ->
    process_flag(trap_exit, true),
    io:format("dict server starting~n"),
    init_mnesia(),
    {ok, []}.

start() ->
    gen_server:start_link(?GD, ddict, [], []).

stop() ->
    gen_server:cast(?GD, stop).

terminate(Reason, State) ->
   io:format("dict server terminating~n").

%"model" methods
do_get(Key) ->
    Res = mnesia:dirty_read({rec, Key}),
    case Res of 
        [] -> undefined;
        [Rec] -> Rec#rec.value
    end.

do_set(Key, Value) ->
    F = fun() ->
            Row = #rec{key=Key, value=Value},
            mnesia:write(Row)
        end,
    {atomic, ok} = mnesia:transaction(F),
    ok.

%"controller" methods
handle_call({get, Key}, From, State) ->
    Rec = do_get(Key),
    {reply, Rec, State};

handle_call({set, Key, Value}, From, State) ->
    Rec = do_set(Key, Value),
    {reply, Rec, State}.

handle_cast(stop, State) ->
    io:format("ddict server stopping~n"),
    {stop, normal, State}.

handle_info(Info, State) ->
    {noreply, State}.


%"client api" methods
get(Key) ->
   gen_server:call(?GD, {get, Key}).

set(Key,Value) ->
   gen_server:call(?GD, {set, Key, Value}).


create_schema() ->
    mnesia:create_schema([node()|nodes()]),
    mnesia:start(),
    %this is defnitely wrong
    lists:foreach(fun(N) ->
        io:format("starting mnesia on ~w~n", [N]),
        rpc:call(N, mnesia, start, [])
    end, nodes()),
    mnesia:create_table(rec, [
        {disc_copies, [node()|nodes()]},
        {attributes, record_info(fields, rec)}
    ]).

download file "main gen_server file"

The key to this server being distributed is the use of {global, ddict} as the server name, instead of {local, ddict}. This enables other nodes in the cluster to see this server.

do_get() and do_set() are the "model" like methods that deal with mnesia. handle_call defines the gen_server api. get() and set() are helper functions that call the remote gen server. If there was more to this module, it would be a good idea to put these methods in separate modules.

The one thing I am not sure about is the create_schema() method. I'm sure there is a propper way to initalize mnesia on a cluster, I just have no idea what it is yet :-)

To make this into a propper gen server the supervisor and application needs to be defined with the following three files:

-module(ddict_sup).
-behaviour(supervisor).

-export([start_link/0]).
-export([init/1]).

start_link() ->
    supervisor:start_link(ddict_sup, []).

init(_Args) ->
    {ok, {{one_for_one, 10, 60},
          [{ddict, {ddict, start, []},
            permanent, brutal_kill, worker, [ddict]}]}}.

download file "/ramblings/files/erlang/ddict/ddict_sup.erl"
-module(ddict_app).
-behaviour(application).

-export([start/2, stop/1,go/0]).

start(_Type, _Args) ->
    ddict_sup:start_link().

stop(_State) ->
    io:format("ddict server terminating~n"),
    ok.

go() ->
    application:start(ddict).

download file "/ramblings/files/erlang/ddict/ddict_app.erl"
{application, ddict,
[
    {mod, {ddict_app,[]}}
]}.

download file "/ramblings/files/erlang/ddict/ddict.app"

To get erlang to start this application on boot, a config file for each node needs to be written:

[{kernel,
  [{distributed, [{ddict, 3000, [one@media, {two@media}]}]},
   {sync_nodes_optional, [two@media]},
   {sync_nodes_timeout, 5000}
  ]
 }
].

download file "/ramblings/files/erlang/ddict/one.config"
[{kernel,
  [{distributed, [{ddict, 3000, [one@media, {two@media}]}]},
   {sync_nodes_optional, [one@media]},
   {sync_nodes_timeout, 5000}
  ]
 }
].

download file "/ramblings/files/erlang/ddict/two.config"

To create the initial database I ran the ddict:create_schema method, which I'm sure is completely incorrect, but it works:

erl -sname one -config one.config
erl -sname two -config two.config

(one@media)1> ddict:create_schema().
starting mnesia on two@media
{atomic,ok}
(one@media)2> mnesia:info().
...
running db nodes   = [two@media,one@media]
disc_copies        = [rec,schema]
[{one@media,disc_copies},{two@media,disc_copies}] = [schema,rec]
...
ok

download file "/ramblings/files/erlang/ddict/create_db.txt"

Once that is done, the application can be started with

erl  -pa . -sname one -config one.config -s ddict_app go
erl  -pa . -sname two -config two.config -s mnesia start -s ddict_app go

I have to start mnesia separately on the second VM because I haven't yet figured out how mnesia should be started when dealing with distributed applications. mnesia needs to be running on both nodes, but not the ddict application itself.

Once it is running, you can call ddict:set("Foo","bar") and ddict:get("Foo"). You can also kill either VM, and it will restart the server after 3 seconds on the other node.

Comments here

June 10, 2008 11:56 AM

June 05, 2008

Tom "supertom" Melendez

My Commute via Public Transportation

I decided that I was going to take public transport (or, not use my car) to work, for several reasons: Inject a little activity into my life (as I use my bike or a scooter to get to and from the stops, etc) See if I can do anything productive during that time. FYI, I wrote [...]

by SuperTom at June 05, 2008 12:13 AM

June 04, 2008

dotCOMmie

CenterIM; History format

My instant message client of choice is centerim (a fork of centericq). It does everything I need, send and receive messages in a very simple interface. Now this might sound like any ordinary client out there. But its special in that it runs completely in the terminal (ncurses based) -- and its good at it. I've tried some other terminal based clients and they all feel very cumbersome.

One major inconvenience with ncurses applications is the lack of clearly defined text areas. So copying text out is not trivial in fact its nearly impossible. So usually if I need to get text out of the application I just look in its log files. Unfortunately centerim has not-so-convenient history log format. It looks something like this:

IN
MSG
1212455295
1212455295
pong

OUT
MSG
1212455668
1212455668
pong

(each message entry is separated by "\f\n" not just "\n")

So using a little awk magic I wrote a simple converter which parses history file into something more readable and something you can paste as a quote.

gawk -vto=anon -vfrom=me 'BEGIN {FS="\n";RS="\f\n";}{if (match($1,"IN")) a=to; else a=from; printf("%s %s:\t %s\n", strftime("%H:%M:%S", $4), a, $5);for (i=6; i<=NF;i++) printf("\t\t%s\n", $i);}' /PATH/TO/HISTORY/FILE

You need to modify the -vto and -vfrom values to correspond to your name and the name of the person you're talking to. You obviously need to also specify the path to the file. If you don't like the time stamp you can alter the string passed to strftime (man 3 strftime for format options).

Sample output of the above sample looks like this.

21:08:15 anon:   ping
21:14:28 me:     pong

by dotCOMmie at June 04, 2008 06:25 PM

May 31, 2008

Will

Forum topic opener bookmarklet

When I'm reading forums, I usually just open all unread topics. I made a bookmarklet using dojo to do this for me. It works with PHPBB, and SMF.

You have to click on the 'unread topics' link before running the bookmarklet.

Open unread topics
Drag the link above into your bookmarks toolbar to save the bookmarklet.

You may be yelled at for not having popups allowed for the site. Just enable popups and try it again.

Get the source code here

by psychcf at May 31, 2008 03:04 PM

Justin

using nmap for network monitoring

The problem

You need to know if any of 900 IP addresses are unreachable. You also need to know this within about a minute of any outages. Nmap is primary a security tool, but it can be very helpful when it comes to monitoring as well.

fping

For years I used fping for this, here is an example of what it can do:

$ wc -l ips.txt 
900 ips.txt
$ time fping < ips.txt 
...
real    0m41.347s
user    0m0.028s
sys     0m0.248s

Not too bad.. 41 seconds to poll 900 devices. It actually seems to finish at around 35 seconds, and then sits there for a bit before exiting.

nmap

Now lets try with nmap. Nmap needs to be ran as root to allow it to send icmp packets, otherwise it will use connect(). In my tests it is actually faster when running in tcp mode, but some devices only respond to ICMP. (It would be best for security to put this into a nmap_ping helper script and put that in sudoers instead of allowing all nmap commands to be ran as root. It is probably also possible to use the capabilities system to just allow a normal user to send ICMP packets.)

$ time sudo nmap -n -sP -PE -iL ips.txt
...
real    0m3.961s
user    0m1.072s
sys     0m1.780s

Not bad at all, about 10 times faster than using fping!

Note in these examples, all of the addresses are pingable, so timeouts and retry times do not come into play. My monitoring system maintains separate lists of the reachable and unreachable devices, and pings them from different processes. This prevents unreachable devices from slowing down the normal process of making sure everything else is working. Currently the time between pings to a single device is about 8 seconds.

May 31, 2008 02:50 AM

May 29, 2008

Mark Drago

rPath, Foresight, Conary

I first started speaking about rPath Linux and their Conary package management tool a little over a year ago.  But, I just want to get it down in writing that I think this is the future of linux packaging and indeed distribution management in general.  They took traditional package management (think rpm w/ yum or dpkg w/ apt) and made it look antiquated.  That’s right, apt-get is not the end of the line for package managers.

Conary really takes the problem of managing the software that is installed on your system and fully maps it out.  I feel like they broke the problem down in to small chunks and solved each one of the problems well.  rPath’s main goal is to create tools and a distribution that can be customized and modified by down-stream distributors to create software appliances.  There are a lot of features designed for this task in Conary, but they can benefit other users who may not feel like they have their own customized distribution.  For example, do you have a farm of machines that are running the same software with your own customized configuration files?  Why not create a package that shadows the upstream apache package for example, but includes your own configuration files in the apache:conf component?

One of the other wonderful features of Conary is that the repository is kept in version control and branches are supported by all of the supporting tools.  Imagine if Debian was using a tool like Conary to track and manage their entire distribution.  All of the Debian derivative distributions would be able to have their own branches of the distribution.  This would make it a lot easier for derivative distributions to use Debian’s existing packages and for them to make contributions back to Debian.

There is one problem with the Conary story.  All of the server-side distribution management tools are closed-source.  I do see this as a show-stopper.  Well, a lot of things are using rPath and Conary, and rPath as a company seems to be doing alright, so maybe ’show-stopper’ is a bit harsh.  But, this will absolutely keep other major distributions and large chunks of the open-source community from getting on the bandwagon.  All I can say is that I hope this will eventually be remedied by the open-sourcing of the server-side components.  The technology feels like such a good thing for the community and for distributions in general, but it’s the kind of thing that can not be entrusted to one company.  Hopefully someday rPath will be willing/able to release the server-side stuff.

Regardless, the feature-set exposed by Conary is, to me, the clear future of package management.  Whether it ends up being Conary that makes it big or some other (possibly completly open source) implementation is yet to be seen.  But I wanted to get this article out there with a date on it so that when it happens I can say, “I called it!”  If you want to play around with Conary on your desktop I would highly recommend Foresight Linux.  It’s pretty bad ass.

by Mark at May 29, 2008 12:30 PM

May 28, 2008

Tony B

May 23, 2008

Mark Drago

OpenID Delegate Plugin for Wordpress

I just upgraded my wordpress installation to 2.5.1 from 2.3.3 or something like that.  2.5 is very nice.  The upgrade was really simple and the new administrative interface is pretty slick.  I decided it was time for me to manage my wordpress installation with subversion so that later upgrades are a simple ’svn switch’ away.  The process of switching was pretty easy because I had scripts in place for backing up and restoring all of the custom parts of the site.

As part of the upgrade I had to make sure that all of the plugins I was using were moved over properly.  The one plugin that I really use is the openid delegation plugin.  This plugin lets you use your wordpress URL when logging in to a site using openid.  All it does is put extra <link> tags in the <head> of your home page that redirect the open id request to your real open id server.  I use claimid.com for this purpose.

I had made a change to the plugin at one point because it would not put the tags on my home page because my home page is a ‘page’ and not a ‘post’ in wordpress terms.  When I originally made the change I sent a patch over to the original author hoping that he would incorporate the change and put the improved version on his page.  He never did.  While moving the plugin today I almost over-wrote my changed file with his original.  Now, my changes amount to 6 or 7 lines of code, but I really didn’t want to have to go finding out which wordpress objects and hooks I had to use to recreate my change.  To avoid this problem in the future I decided to throw it in to my repository.  So, if you use wordpress and you’re looking in to open id, check out the slightly improved openid delegation plugin for wordpress.

by Mark at May 23, 2008 11:23 PM

May 16, 2008

Justin

building pig on debian

I've been playing with Hadoop and Pig. It is some really neat technology.

I had a bunch of trouble getting pig to build though, it seems that this error from ant:

Could not create task or type of type: jjtree

Is caused by missing the 'ant-optional' package.

May 16, 2008 03:52 AM

May 07, 2008

Nate Berry

Ubuntu on Thinkpad R32

Linux

ThinkPad R32 2658-N3U
Original description: P4-M 2GHz, 256MB RAM, 30GB HDD, 14.1 XGA(1024×768) TFT LCD, 8x-3.3x DVD-ROM, Modem(CDC), Ethernet(LOM), Li-Ion battery, WinXP Pro, Wireless upgradeable

I like to try out laptops once in a while and put Linux on them to see if how easy it would be to do everything I need to do without paying a Microsoft of Apple tax. Since I “switched” to a Mac (from Linux) in 2002, I still use Linux at work, and have a family PC set up with Linux and I’ve been thinking it might be time to switch back. I’m not a big fan of Apple’s move to Intel, and while Macs are really slick, setting up house in Linux is a lot more fun. This is not a comprehensive report, but just my personal notes as I attempt to use the machine.


I’ve taken this machine home before and put FreeBSD on it (I had never played with that OS and it offered a good excuse). A Pentium 4 mobile, it’s quick enough for what I do with a computer. It’s missing some things I’ve grown accustomed to though. I have firewire devices (external hard drive and lightscribe DVD burner), this machine doesn’t have a firewire port. I like to plug my powerbook into the TV frequently to display slide shows of images, or watch Youtube videos, etc. This machine has no TV out capabilities. The battery may be shot as I only get an hour and a half of useage out of a charge. It runs hot. It has no touchpad, it just has the standard little red IBM nubbin in the middle of the keyboard (basically a strain gauge), and I think I’m the only one at work that actually likes that at all anyway.

Video
There’s nothing in the xorg.conf file about what driver X is using, but the R32 has an ATI mobility M6 and it seems to be autodetected. The display only does XGA, and so can only do 1024×768 which is a bit too small for most folks today (are our eyes getting any better?), but then my G4 powerbook is only XGA also, so it’s actually a treat for me since the screen is a lot bigger (14″ screen as compared to 12″ on the powerbook).

Wireless
Since the last time I had this laptop at home it’s been sitting in a closet and because it doesn’t have the optional built in wireless card, nobody really wanted it. I actually went so far as to start to order an internal wireless card for it, but the BIOS only accepts certain types and for whatever reason that didn’t work out through work so I eventually just brought it back in and there it sat. Recently I had purchased a Linksys wireless adapter for another machine at work, and luckily for me and unluckily for that machine’s user, it stopped working. I decided to bring it home to “test it” in the old Thinkpad. It seems to work fine (with the setups described below), which indicates the problem is with the other machine. Hopefully I can get that person another machine so I can hang onto the card, though to be honest I’d rather have an internal wireless card than the PCMCIA.

At first I tried to get the Linksys adapter working in Redhat Fedora 7 (before I returned it last time I wiped FreeBSD and tried out Fedora for abit) but I was stymied quickly. After figuring out what I had to do to get the Broadcom chip in the Linksys to work, I must admit it would probably have worked just as easily in Fedora, but I ended up installing Ubuntu 8.04 from CD, with gnome desktop leaving a 4G partition for Windows 98 which I need to put on later to run some windows only programs. There’s about 20G for Ubuntu. A PC2700 512Mb ram chip that I had recently replaced in my G4 Powerbook fit in this machine without issue and brought it up to 768Mb. This actually was the move that made it possible to load Ubuntu in the first place, because before I added the extra memory I was trying to boot the Ubuntu live CD and it was just reading from the CD for what seemed an eternity and I eventually just gave up.

The Linksys WPC54G PCMCIA card didn’t work out of the box in Ubuntu either. Network manager in Ubuntu was nice enough to let me know that the driver wouldn’t work till I had aquired the proprietary firmware which was the key piece of info I needed. I plugged in a regular network cable, and issued “apt-get install b43-fwcutter” which downloaded the open-wrt firmware, and cut out the files needed, and copied them into the right place. The network-manager icon then showed my local wireless and I could join. Connection speed is reported as 1Mb (abyssmal) though I haven’t tested it and it seems snappy enough for normal work. Others have complained about the same thing though, so will have to keep an eye on that thread for possible solution. There was another option (ndiswrapper) but my eyes glossed over reading up on that route.

[update 5/7/08: found a post in Bug#205114 that suggested
aptitude purge b43-fwcutter
aptitude install bcm43xx-fwcutter

Speed tests at speakeasy.net are now reporting somewhat faster download speeds, but not sure if it's just faster tonight or if something really improved. Update2: nah, it was no faster. Im back on b43 which gives me anywhere between 80KB/s and 120KB/s (down) where I usually routinely get 4 to 500KB/s on the Powerbook]

Shutting Down
Getting the wireless working introduced a new problem shutting down. Shutting down normally actually brought me to a black screen after the process, but didn’t shut the laptop OFF actually. To shut off all the way I’d have to hold in the power button for 5 seconds. I found that turning off the PCMCIA slot first allows Ubuntu to shut down completly. F Just have to add “/sbin/pccardctl eject” to the shutdown scripts: I wrote a little bash script
#!/bin/bash
/sbin/pccardctl eject

and saved it in /etc/init.d (and chmod to 755 so its executable)
Then in /etc/rc0.d, I made a symlink to my script named S22ejectcard
with ln -s ../init.d/ejectcard S22ejectcard

I have no issues with Suspend which works just like it does in windows. The little green Thinkpad moon lights up and it goes to sleep. I haven’t tried just closing the lid yet (I’ve been too busy wanting to keep working on it ;)

Mouse buttons
The R32 has three thumb buttons right below the space bar, in perfect location if you’re using the little red rocket pointer gizmo. The middle of these three special thinkpad buttons didn’t do anything out of the box. However, I remembered that I was able to get it to act like the middle mouse button or a scroll wheel (of sorts) in FreeBSD and I had notes from that install. These pointed me over to the xorg.conf file. I modified mine with the following tidbit to get the center button working. I just rebooted after modifying /etc/X11/xorg.conf although I could probably have just restarted X windows I guess.
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "Auto"
Option "Device" "/dev/sysmouse"
Option "Emulate3Buttons" "true"
Option "Emulate3Timeout" "80"
Option "EmulateWheel" "on"
Option "EmulateWheelButton" "2"
Option "ZAxisMapping" "4 5"
Option "Buttons" "3"many
Option "CorePointer"
EndSectionAudio

Audio
Ubuntu had no problem detecting the Intel audio. Rythymbox needed gstreamer codecs installed before it could play mp3s (a non-free software requirement of mine for podcasts). Also, I needed to install “bad” codecs for .wmv, .pls, .ra support which are obviously needed since I like listening to live streaming radio and so it’s not really “bad” that it works now. One wierdness was that the .pls for liveireland.com while streaming the audio OK, wasn’t actually dislaying the names of the tunes for very long before it was crapping out but kept displaying the first song. I had to keep restarti ng it so that it would edisplay the song I was listening to.

Printing
My Brother HL-1440 is shared on my Apple Airport (a nice feature of the Airport), but got some strange error when attempting to connect to it. I used Avahi (a rendezvouz browser) and found my printer was at 10.0.1.1:9100, so I just went to System-Administration-Printing and selected New Printer. I picked AppSocket/HPJet Direct. Then I entered the IP address above into the Host box; Port 9100 was automatically entered into the box for port. Clicking forward, I chose Brother and selected the driver for the HL-1250 which was the recommended driver, and clicked Forward. That was it - working good.

Software
Most of what I spend time doing can be found right in a browser, so since Ubuntu came with Firefox 3, I was just a few short addons away from my normal working environment (mainly Gmail based workflows including Document creation and calendar). Del.icio.us plugin brought in all my links.
Pidgin connected me to my instant messaging systems (including work where I chatted with the guy with the broken laptop ;) There were a number of programs that aren’t in the default Ubuntu install that I can’t live without, including qlGo, xchat, gftp, and a CVS client as good as LinCVS. An aside: I found tkcvs, but struggled for a long time with the right CVSROOT setup till I found :pserver:username:password@myserver.org:/usr/local/projects. Installed apache2, mysql-5, and php after I realized I couldn’t work on the sites I just downloaded from CVS! phpmyadmin was just as easy to install as everything else and made setting up my database driven sites easy. I had taken some pictures with my Canon S30 digital camera which was autodetected by F-Spot photo manager, and downloading the images and storing them away was as easy as Picasa is on Windows.

I’ll probably update this post again if I find some more time to play with this machine.

by Nate at May 07, 2008 12:38 AM

May 02, 2008

dorgan

jQuery

Well I've been using jQuery from quite some time now, and I must say they have a great product. It is a extremely easy to use as well as makes things such as alternating row colors in a table so easy, with two lines of code you can have alternating row colors on a table. The plugin support is great and pretty much anything you can think of you can find a plugin for.

Andromeda is rocking along and from what I here from Ken there may be some news coming in the next couple of weeks or so.

by Donald J Organ IV (noreply@blogger.com) at May 02, 2008 03:11 PM

April 24, 2008

binarydigit

Guest Rant - Leaners

What's the deal with the leaner's on the subways? You know who I mean, the dude who can't be bothered to hold on the support poll, instead he has to lean against it. In order to hold on and keep yourself from falling all over the place, you have to wedge your fingers in between the poll and his sweaty back.

I understand sometimes we all don't want to stand on the subway. I also understand that those polls can be nasty and sticky and the last thing you want to do is touch them with you hand. But come on! I am 5'4" tall when lying down flat, I can't hold on to the ceiling or the horizontal support poles that are up high, which leaves the poll you, in all your laziness, are lounging against.

I choose to be as obnoxious as possible when dealing with the leaner. I shove my fingers into the fat of their back as I make a grab for the poll. Then I try to make my hand stick out as much as possible to make it clear that I am holding on here. When I get home, I go boil my hand.

by anonymouscoward (noreply@blogger.com) at April 24, 2008 08:40 PM

April 22, 2008

Will

My new favorite shell command

Click "read more" to see the whole thing :D

psychcf@psych4:~$ banner -w35 BOO\!|wall
Broadcast Message from psychcf@psych4
        (/dev/pts/2) at 9:32 ... 
                                 
        ##                      #
        ##                      #
        #########################
        #########################
        ##            #         #
        ##            #         #
        ##            #         #
        ##           ##        ##
         ##         ####      ## 
         ####      ### ######### 
          ###########   ######   
            #######              
                 #######         
              #############      
           ###################   
          ###               ###  
         ##                   ## 
        ##                     ##
        ##                      #
         #                     # 
         ###                 ### 
          #####           #####  
            #################    
               ###########       
                 #######         
              #############      
           ###################   
          ###               ###  
         ##                   ## 
        ##                     ##
        ##                      #
         #                     # 
         ###                 ### 
          #####           #####  
            #################    
               ###########       
          #             #####    
        ####   ################# 
         ###        ###########  
                                 
psychcf@psych4:~$ 

by psychcf at April 22, 2008 01:43 PM

April 19, 2008

Josef "Jeff" Sipek

Memory Leaks

Alright, I think I’ve had just about enough. Why does Amarok eat up 22% of my RAM (1GB) after 4 days of running (and playing music for maybe 18 hours of those 4 days)? Why does Firefox use up 33% of my RAM in 4 days?

Why is it that when I shut down the app, and restart it, the usage is 4-5 times less?

  Amarok Firefox 2
before app restart 225 MB 338 MB
after app restart 58 MB 72 MB

The only reason I can think of is application being buggy, or having really crappy defaults.

Buggy Applications

Dear developers, believe it or not, when you allocate memory, you also have to free it when you are done with it. If you don’t, you are committing a crime against humanity known as a "memory leak". This memory is unusable, and essentially becomes dead weight the process carries around. Since it is not used, the OS may swap it out, and before long, your swap file/partition becomes full of memory that has been leaked.

Contrary to popular belief, freeing memory is really simple.

For you C++ coders (yes, that includes you Amarok folks), you simply use the delete keyword followed by a pointer of what you want to free. For example,

delete some_pointer;

If you are using C, the free function is your friend. Just call it, and make the one argument you give it the pointer to what you want to free. For example,

free(some_pointer);

Now, if you are working on a larger project, there might be wrappers around the memory management (malloc/free, new/delete) functions, but whatever the "free this memory" function is called, USE IT.

I can almost hear all the managed languages fans yell: "Just use a language that does garbage collection, and you won’t have to worry about freeing memory." Well, you are WRONG!

Garbage collectors maintain graphs of memory allocations, and whenever they notice that some piece of memory is unreachable, they mark it as garbage, and free it. Here’s my favorite example for causing leaks in a garbage collected language:

Suppose that you have implemented a class that works as a stack. You implemented it as a list of elements, and an index into the array to mark the top of the stack. Pushing an element is trivial, you just increment the index, and set the reference in the array to the object you want to store. Popping is really easy, you just decrement the index, and you’re done. Right? WRONG! Decrementing the index changes that one integer variable, but that reference in the array is still valid, and therefore the object is still reachable as far as the garbage collector is concerned. Sure, next time you push into that slot, the previous reference will get broken, and the previous allocation will get freed (assuming that there are no other references). But what if you never push that many elements back onto the stack? What if you experienced some high-load spike? You’ll have a large number of objects incorrectly referenced, tieing up memory, and quite possibly making the entire system slower.

How can you solve this? Pretty simple, just reset the reference to some "null" quantity. In Java, that means using the null literal. For example,

some_reference = null;

In Python, None is the proper keyword to use:

some_reference = None

The lesson is, free the memory you allocated when you are done using it.

Crappy Defaults

Many large applications (Firefox included), have many options you can set that affect its behavior. The default options should cover 95% or more of the users (or at least the greatest majority possible). Why such a high number? Well, suppose you settle for making 90% of your users happy out of the box…that means that 1 in 10 people that try your app will not be happy with the defaults. How many will bother checking if there even are knobs they can turn to make it work the way they want? Not all. Some will just try to install another open source app written by someone else that does pretty much the same thing. So, the default options should make as many people happy as possible.

How does this tie into a third of my RAM being used by Firefox? Simple, I do not know if there are any knobs that would "fix" the problem I am seeing. For all I know, someone decided that it was a great idea to be really aggressive about caching web page content in memory - something that’s fine if you have 16GB RAM, but guess what most people don’t.

Whatever it is (defaults that don’t make sense or memory leaks), Firefox and Amarok have problems that must get addressed. What is one of the reasons people complain about Microsoft Word? It takes up tons of memory. Well, I don’t feel like throwing over 200 MB of RAM at an application that plays MP3s, displays a playlist, and cover art.

And before someone suggests that I use Firefox 3… I realize that it is all super-duper-better-than-ever, but let’s think for a second. When the original Firefox was released, it was hailed as the non-leaky, light-weight Mozilla. Then, things started to get slow again. Firefox 2 was supposed to be the super-fast, non-leaky browser. What happened? What happened to my >300 MB of RAM? Now, Firefox 3 is all the rage…do you see the pattern yet?

I think this brings up a larger issue. It’s no secret that I do some Linux kernel coding from time to time. In the kernel, there are leaks at times, but it seems that the kernel leaks are effectively non-existent compared to applications like Firefox. Don’t believe me? How come you can have a server run for over a year and it responds just as well after the year as it did when you booted it? Imagine running Firefox for a year without restarting it? Can you even imagine that? The Linux kernel doesn’t seem to be the only “non-leaky” (there are leaks, but they are very rare, and probably mostly in the ugliest parts of the kernel - device drivers), Apache performs quite well even after running for a while, PostgreSQL, and the list goes on and on.

Why is it that Firefox and other projects seem to have so many problems? The only thing I can think of is the quality control that goes into checking new code before it’s committed. In the kernel community, a patch may get rewritten a dozen times, submitted to mailing lists for review, get comments from people familiar with the subsystem, but also from other developers (and budding developers trying to understand the existing code). It takes a lot of effort to get a piece of code into the kernel, but in the end, that code is well written, well reviewed, and it should benefit most users. Do the Firefox, et. al., communities do this? I do not know, but somehow, I suspect that it isn’t the case.

by JeffPC at April 19, 2008 06:23 PM

No Gas

As I have mentioned to many of you, this was my first week of interning at IBM (this is my second year). Well, on Monday, after I got out of work, I realized I needed to get gas if I wanted to get home. I stopped at the first gas station (just down the road), and there were signs on all the pumps saying “No Gas”. Strange, I thought to myself, and so I drove to the next one (about 100m), and guess what…that one also had “No Gas” signs. Somewhat puzzled, and a bit worried (what if all of Westchester was out of gas?!). Lucky me, the 3rd station which was mere 50m further down the road, had gas…$3.64 for a US gallon of regular (compared to about $3.40 at home - yes, I realize, that’s still nothing compared to what the folks in Europe are paying).

by JeffPC at April 19, 2008 05:17 PM

April 14, 2008

Tom "supertom" Melendez

Hiring Developers and the Big Picture

I’ve been sitting on this for about a year and now that it has come up yet again, I just have to comment. This got started when I got caught up in reading the recent thread on the NYPHP mailing list about interviewing developers and its reference to Joel Spolsky’s, “The Guerrilla Guide to Interviewing” (v. [...]

by SuperTom at April 14, 2008 08:07 PM

April 10, 2008

Tony B

Live LILUG Stream: The aftermath.

Streaming last nights LILUG meeting (see last post) did not go as well as I had hoped for it to go. I guess the main problem was that I had never actually tried it on my laptop - so there was not a trace of gstreamer on the whole dang system… I ended up even having to compile gst-entrans to get it working. I had a nice placeholder looping intro video (a rickroll with some overlayed text) that lasted for most of the meeting streaming from my desktop computer. My laptop wasn’t powerful enough to encode the video in real time at the quality I had it set to, by the time I thought to lower the settings it was already the end of the meeting. The stream at the end of the meeting (of people just sitting and talking) apparently worked very well, varied from 60-100kbit (I believe, according to vlc) and was quite watchable. Next time I’ll borrow someone elses laptop (configured before!) probably, and use that to stream it.. Next meeting should go better. =]

by tonyb at April 10, 2008 01:53 AM

April 08, 2008

Tony B