How to Get Gigabit Speeds from RTL8111/8168B PCI Express Gigabit Ethernet controller on Ubuntu Linux

November 26th, 2010 by rvdavid 45 comments »

Do a quick lspci. Now do you see: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02) for your Ethernet controller?

If so and your network connection information is reporting that your speed is 100 Mb/s rather than 1000 Mb/s, then you MIGHT be using the r8619 driver rather than the CORRECT r8168!

This is what I experienced when I had recently hooked my network up at home. I bought a ReadyNas Duo and updated my network switches to gigabit speeds with two D-Link Gigabit switches.

The expected Gigabit speeds 30 – 40 MB/s did not come. Instead I was getting sh*tty performance of 8 MB/s. So I tweaked a bunch of times then discovered the the bottleneck of the whole system was my NIC which when using the r8169 driver reports that 1000M mode is not advertised when probed by ethtool.

# ethtool eth0

This is because you are using the incorrect driver. Ubuntu linux by default somehow matches this particular NIC with the r8169 driver. You can fix this by downloading the correct r8168 driver, unpacking the downloaded driver archive and installing the driver following a quick step by step how-to in the r8168 driver’s readme file.

» Read more: How to Get Gigabit Speeds from RTL8111/8168B PCI Express Gigabit Ethernet controller on Ubuntu Linux

How I refactored my Service Class to be “Separation of Concerns” Compliant.

November 23rd, 2010 by rvdavid 12 comments »

I’m developing this web application where a users actions is logged at certain places. I initially wrote the logging features into the Main Users Service. I’m currently looking at it now and will be refactoring out the functionality to separate concerns. While to me, at the time, logging a Users action is from a natural standpoint looked like it belonged to the Users service, a more thorough look at it made it clear that the Logging functionality should be it’s own Service.

Don’t see where the mix up of concerns is?

Here’s a list of functionality my Users Service class provided.

  • Creating Users.
  • Reading Users.
  • Updating Users.
  • Deleting Users.
  • Fetching a User by Id.
  • Searching through Users.
  • Counting total search results (I utilise scroll pagination for my record list and dojo datagrid needs to know the total number of records it needs to scroll up to).

Think that the Log functionality is tied in directly with Users since you can’t have one without the other? Well, I did! To the point where the Model automagically handled logging by using the DbTable for the log. At that time, I accepted in my head that Users Log was part of Users and besides, it’s logging; my focus wasn’t on that particular “minor” detail.

» Read more: How I refactored my Service Class to be “Separation of Concerns” Compliant.

Dojo’s IndirectSelection plugin for the Enhanced Datagrid is deceptively unuseful.

November 23rd, 2010 by rvdavid No comments »

One of the requirements for a project I’m working on is the ability to send emails to selected rows in the datagid. I thought no problem, the IndirectSelection plugin of the EnhancedGrid should be able to handle that semantically! Reading the API and when I initially tried it out I saw the neat little checkboxes as the first column. “Phoar! Checkboxes!” I swear those CBs had a glow around it and I could hear a choir singing in the background (“haaaaaaaaaaaaaa, easy fix for a requiremeeeeeeeeeeennnnnnnnnnnnnnt”).

Then I tried submitting with a bunch of rows selected. It was then clear to me that IndirectSelection is just that. It gives you checkboxes or radiobuttons to tell you that it’s selected, but aside from notification, it has no other use. The value in it is not configurable and neither is the name… Sad. Guess I’ll just have to insert a field for a checkbox. I’ll leave this till later. This functionality is a “nice to have” rather than critical functionality anyway.

» Read more: Dojo’s IndirectSelection plugin for the Enhanced Datagrid is deceptively unuseful.

Ubuntu CD Burning: Brassero is OUT; GnomeBaker is IN

November 21st, 2010 by rvdavid 1 comment »

I am using Ubuntu 10.10 Maverick Meerkat as my desktop OS and enjoying all the wonderful stability and great hardware support that has been steadily built by the Ubuntu Development team and Linux in general up to this point.

So when I tried to burn a Data CD of pictures to give to give to one of my colleagues who was on his way out, I was irritated by Brassero’s buggyness. Brassero, the default burning program used in Ubuntu 10.10 (perhaps other distributions before) was good before. I don’t know why all of a sudden it would burn the entire CD and then report in the end that it could not complete it and that there are corrupt files on the CD.

“This is Bullsh*t!” I thought. I tried another CD. Again, same result. “This is double Bullsh*t!!” my thought stream continued. But then I thought I’d look into the cause of the bug. I skimmed the reports and honestly had no time to look into why or how I could fix it. One comment linked to a possible solution, but I wasn’t going to go through this, go through trial and error, then have to do it again after some tweaking; I just wanted to quickly burn a CD.

» Read more: Ubuntu CD Burning: Brassero is OUT; GnomeBaker is IN

To copy and paste or not to copy and paste; adventures in unit testing

November 20th, 2010 by rvdavid 2 comments »

Yesterday evening. I started my next coding session. I contemplated the validity of copying and pasting unit tests that have similar functionality, but for totally different domains.

I have developed Service classes for a certain module and I can see this functionality the application of this functionality being similar accross the board. Functionality such as CRUD, Search and Search Result Count etc.

The only things that will be different would be the models it uses which will subsequently be using different DB Tables, but yeah… practically the same methods.

I’ll sit on this for a while, tie up some loose ends and will come back with what I’ve decided….

» Read more: To copy and paste or not to copy and paste; adventures in unit testing