“mount_smbfs: kldload(smbfs): Operation not permitted” SOLVED!!!!

When I tried to mount a windows share from FreeBSD:

sudo mount_smbfs -I WindowsBoxIPaddress //[email protected]/WindowsShare /mnt

I always got this error:

mount_smbfs: kldload(smbfs): Operation not permitted

After searching this error message on Google, I found that all suggested solutions were related to running this command using sudo, which I already did. Today morning, I tried a different way and the problem is solved!

In /etc/rc.conf, I disable the following configurations:


After I rebooted the machine, and mounted the Windows share again, it worked! That’s simple, isn’t it?

Note: These two lines are for making the FreeBSD box more secure, and I highly recommend to put these in a public accessible server. I don’t think it is safe to make a public accessible server to access to any Windows box because there are not many protections you can do on a Windows box. In case the public server got hacked, the connections to other internal servers should be blocked, i.e., other internal servers can always access the public server, but not vice versa.


Our sponsors:

Bandwidth Tester Add-on for Firefox 3.5+

I always go hunting the Wi-Fi networking using my laptop. Everytime I got on a new Wi-Fi network, I like to measure its bandwidth. I found that Bandwidth Tester is pretty handy and I can get a result easily. If you are looking for this tool to work on Firefox 3.5+, here is a work-around version I created:

Download Bandwidth Tester 0.5.9 Add-On for Firefox 3.5+ here.


…And if you want to use any Firefox Add-on on Firefox 3.5+ but it is not available, feel free to let me know! Don’t forget to include the link. Thanks!

Our sponsors:

CopyPlainText Add-On for Firefox 3.5+

CopyPlainText is one of my favorite Firefox add-ons because it can filter out all of the formatting and leave the text alone. It is an amazing tool especially when editing non plain-text editor such as Microsoft Word etc.

After I upgrade to Firefox 3.5, I found that this add-on is no longer available. Therefore, I created my work-around version here. No functionality has been changed, except it works fine in Firefox 3.5+ šŸ™‚

Download CopyPlainText 0.3.4 for Firefox 3.5 from here.


…And if you want to use any Firefox Add-on on Firefox 3.5+ but it is not available, feel free to let me know! Don’t forget to include the link of the apps.

Our sponsors:

BlockSite Add-On for Firefox 3.5+

Please visit here if you are looking for BlockSite for Firefox 4.0.


I love using BlockSite along with AdBlock Plus to filter the unwanted content in my Firefox. However, after upgrading to Firefox 3.5, I found that the BlockSite is no longer supported in this version. After waiting for a month, I found that the new supported version is not available, and therefore I created my own version.

Here you are, and enjoy it!
Download BlockSite 0.7.1 for Firefox 3.5+

…And if you want to use any Firefox Add-on on Firefox 3.5+ but it is not available, feel free to let me know! Don’t forget to include the link. Thanks!

Our sponsors:

Tokyo Cabinet is 31 times faster than MySQL!!!

Today I was comparing the performance of Tokyo Cabinet, MySQL and Memcached using PHP. The result of Tokyo Cabinet is really impressive!

(Note that these results are generated from my computer. If you perform your own benchmarks, then you might find different results due to different system configurations. In fact, I encourage you to perform your own benchmarks. )

1. Quick Result

Total time used to write 10000 records and retrieve them back by each candidateĀ  (The lower the better):
Tokyo Cabinet: 18.87s
Memcached: 11.309s
MySQL: 562.21s

A completed result will be given below.

2. Testing environment


  • Intel Pentium II 450MHz
  • 160 MB RAM


  • FreeBSD 7.2
  • Apache 2.2.11
  • PHP 5.2.9
  • Tokyo Cabinet 1.4.20
  • Tokyo Tyrant 1.1.26
  • MySQL 5.1.34
  • Memcached 1.2.6

3. Test scenario

For each candidate, I measure its performance using the following strategies through PHP:

1.) The time used to create all of the necessary objects.

2.) The time used to connect to the database.

3.) The time used to store 10000 randomly generated data.

4.) The time used to read 10000 randomly generated data.

5.) The time used to close the connection.

4. Test results

Tokyo Cabinet

time index ex time %
Start 1243136772.72818600 0.00%
create 1243136772.72838700 0.000201 0.00%
connect 1243136772.73224200 0.003855 0.02%
vanish 1243136772.73526800 0.003026 0.02%
put 1243136781.53287200 8.797604 46.60%
get 1243136791.60574800 10.072876 53.35%
close 1243136791.60755900 0.001811 0.01%
Stop 1243136791.60782300 0.000264 0.00%
total 18.879637 100.00%


time index ex time %
Start 1243131185.86078100 0.00%
create 1243131185.86092500 0.000144 0.00%
connect 1243131185.86688300 0.005958 0.05%
put 1243131191.49702900 5.630146 49.78%
get 1243131197.16868100 5.671652 50.15%
close 1243131197.16982400 0.001143 0.01%
Stop 1243131197.17003400 0.000210 0.00%
total 11.309253 100.00%


time index ex time %
Start 1243136138.19049000 0.00%
create 1243136138.19064700 0.000157 0.00%
connect 1243136138.22529900 0.034652 0.01%
put 1243136150.70760600 12.482307 2.22%
get 1243136700.40063700 549.693031 97.77%
close 1243136700.40078900 0.000152 0.00%
Stop 1243136700.40104500 0.000256 0.00%
total 562.210555 100.00%

The overhead time (create objects, making connections, closing connections etc) of all candidates are about the same. The only difference is storing the record and retrieving the record. Both Tokyo Cabinet and MySQL took about 10 seconds to store 10000 records in the database. However, Tokyo Cabinet took about 10 seconds to retrieve the records while MySQL took about 550 seconds! That’s about 31 times longer!


5. Materials

Here is the material I used to make this benchmark test.
Click here to download the package.

Please feel free to let me know if you have any question or comment.

Our sponsors:

Oracle, MySQL and Berkeley DB, what’s next?

When Oracle acquired Berkeley DB, the quality of Berkeley DB has gone worse after that.

Now Oracle acquired Sun who owns MySQL, will the history repeat again?

(By the way, I am going to fall in love with Tokyo Cabinet.)

Tokyo Cabinet is now the new black.

Our sponsors:

Thoughts on Quality Assurance on Software Testing

Recently I developed several projects using Ruby on Rails.Ā  One of the cool features of it is the built-in test tools. With this amazing tool, I can test my web page such as data validation in few seconds by myself. It reminds me the time how a software was tested in the company I worked for previously.

In the formal company I worked for, they had a very well Quality Assurance Team for testing the software functionality(The ratio of developer to QA is about 3:2). Usually we (developer) need to come up many test cases for them (e.g., testing the data field with positive, negative or invalid value) because the QA team does not have any technical background. Other than that, the QA team would only focus on the GUI level testing, such as whether this control is aligned with the label or not etc. One of the key components that has been ignored is the stress test.

I still remember that I developed a resource-consuming feature, and I was worrying about its impact of overall performance when many uses are using this feature at the same time. So I talked with my QA and see what he think. Initially I expected that he would run a stress test (e.g., simulating 100 thousands of users to use the feature at the same time), and guess what his answer?

I can schedule an appointment with the rest of the QA team, we can sit down together and try to use your feature at the same time.

No, this is not a joke. In fact, about a month later, someone from other application team really does something fancy about it. They sent out a mass email and ask people to sign up. They end up having about 900 uses to use the application at the same time. That’s about 1/3 of the whole population in the company!

I think it is kind of stupid to ask 1/3 of the whole company to do a simple test, which can be done using computer automatically! Think about how expensive is the test:

900 people x $40/hr x 2 hour = $72,000

With this amount of money, they can probably hire one to two QAs to work on the test for a year!

Our sponsors:

Performance Benchmark: FreeBSD vs Ubuntu vs OS X, which one is better?

If you cannot decide whether you should go with FreeBSD or Ubuntu (or Linux), check out this article: FreeBSD or Linux in 6 Simple Questions

Recently I am working on building a web farm which is formed by three ancient time computers (The sum of their ages is older than me). Therefore, I need to pick an operating system to make them running efficient enough. Basically here are my criterias:

  • It must be secure. (Sorry, Microsoft Windows, I tried installing Windows Server and the OS got infected by virus in 20 minutes after connecting to Web.)
  • It must be stable and require no reboot. (I have a very good experience with FreeBSD. My longest record of uptime is 6 months so far.)
  • It must be efficient and effective on performance.

So after trying different operating systems, I ran down to three choices: FreeBSD 8, Ubuntu 10 and OS X.

And I finally go with FreeBSD 8. Before I talked about why I kick the Ubuntu and OS X away, let me discuss what methodology I used.

First Test: Extreme Computation

I write a program to calculate the value of pi using Monte-Carlo simulations. For those who are not familiar with this simulation method, basically it try to repeat a calculation for n times and try to determine the value of pi based on the results of calculations. This calculation will use all available CPU resources.

Here is the result from a computer: Pentium II 400MHz + 160MB

  • FreeBSD 8.1 ~ 5 seconds
  • FreeBSD 4.11~ 10 seconds
  • Ubuntu 10.04 ~ 8 seconds
  • OS X 10.3.9 ~ 11 seconds

The result is very obvious, FreeBSD 8.1 is the best candidate in this test. However, the result of my program only gives a very small portion of the picture. So I decide to run another test:

Second Test: Apache Benchmark

No test is better than the real world test drive. Since my primary purpose is for web server, so I decide to test the performance on how Apache perform on different operating systems. My test is pretty simple, I basically ask the Apache Benchmark client to download a page from the test server. The page does three things:

  1. Display a picture
  2. Insert a record into MySQL database
  3. Retrieve the current count from MySQL database

This way I can test the overall performance on how the system handles the file I/O, database I/O and computations.

So the result is pretty interesting (1000 total requests and 100 concurrent requests)

  • FreeBSD 8.1 ~ 200 requests/sec, no failure
  • FreeBSD 4.11~ 150 requests/sec, approx. 20% failure.
  • Ubuntu 10.04 ~ 180 requests/sec, no failure
  • OS X 10.3.9 ~ 160 requests/sec, approx. 50% failure.

I am not surprised with the result because FreeBSD 8 really does a very good job in kernel optimization. Since kernel is the heart(or brain) of all computations, an OS with good kernel is expected to give good results always.

So, I finally pick FreeBSD 8 as the core OS of my web farm, and I am loving it.

Our sponsors:

WolframAlpha.com – A fun way to search in math

Recently I found that Wolfram Research (The maker of Mathematica) released an online Math search engine. It is way much more powerful than the Google Calculator. It gives you not only the math result, but also a graphical expression on the result.

Solving a math problem:
Suppose I want to find out the value of x, where sin(x)cos(x) = 0.5. Oh wow, I got the answer right the way!
Try to find out the result of sin(x)cos(x) = 0.5 here

Or let’s say I want to know the populations of California:

Try to find out the result of California population here

Now something more interesting. I want to know what’s the result of sin(x)=2:
I got the result in 2 seconds!!!! I still remember that I’ve spent over 2 hours to work on this problem back in freshman year. (See My Presentation on Sin(x)=2)

Try to find out the result of sin x = 2 here

Want to have more fun with Math? Try it yourself here!

Our sponsors:

Shit is priced differently in different region.

I was experimenting the salary search engine at Indeed.com today, and I found some interesting result…

“The salaries of Shit in different locations in US”

Here is the result:


Or you can try to click here to repeat the test….

What makes me couldn’t stop laughing is the statistical conclusion below…

Average shit salaries for job postings in New York, NY are 68% higher than average shit salaries for job postings in Hawaii.

Does it mean a shit worth more value in NYC than in Hawaii?

The reason why I want to put this interesting result is not for making fun on Indeed.com, but I want to understand why the QA at Indeed did not notice this bug, and why the engineer of this search engine is using such a poor algorithm? I am pretty sure NO job has the keyword “shit” in the job title! Where did the search engine get this information? How does it get these numbers?

Do you think your salary is high enough? Try to compare your salary with the result using these keywords: Unemployed and Do Nothing.


Want to know the solution and prevent this embarrassing result? Shoot me an email and we can talk.
(It will require you sometime to find out my email but it is not that hard, huh?)

Our sponsors: