CPU dynamic scaling doesn’t work… FIXED

August 19th, 2008

So, after I installed cpufreq, I somehow installed cpufreqd.  This caused my cpu to always be max no matter what cpu policy I select.  After trying everything and endless searching on google, I was getting nowhere and about to give up.  But I remember seeing this one post about setting the min and max of cpufreq.  I tried to set the min, and it worked.  Did some more digging around, and I finally can get cpu scaling.  Then I thought it was just a misconfiguration, and now I fixed it.  I rebooted the computer to make sure the settings stayed.

Fingers crossed, and nope, back to the same thing.  So, trying to figure out what was going on, I remembered I installed cpufreq and not cpufreqd on my other laptop.  So I removed cpufreqd, rebooted and everything is back to normal.

Now that I think of it, it must be because cpufreqd takes priority, so even though I set the policy in KPowerManager, cpufreqd checks its rules and says, nope, I’m this policy.

I guess I’m more of a control freak, so I want to control my CPUs and not having a daemon do it for me.

Dell M1330

August 19th, 2008

Finally got my new laptop.  A Dell M1330.

Removed Windows.

Had to boot into a live CD to remove hidden partition which is for MediaDirect.  The button which looks a “Home” button next to the power button.  Zero-ed out the whole drive…

$ dd if=/dev/zero of=/dev/sda bs=1024& pid=$!

To check status use:

$ sudo kill -USR1 $pid

After a few hours, we’re ready to install.

I like KDE, so I’m using Kubuntu.

After installing, and first boot into Kubuntu, I want to mount the iso image so I always have the discs. First install smbfs.

$ sudo apt-get install smbfs

Append fstab to mount network drive

//ip/sharename /path/to/mount smbfs username=xxx,password=xxx,rw,user,noauto,exec 0 0

Create the mount paths and change the ownership to myself so I don’t have to always do sudo.

sudo chown xxx.xxx /path/to/mount

Mount the path and transfer iso images.

Edit fstab to always mount iso images

/path/to/filename.iso /path/to/mount iso9660 ro,loop,auto,user 0 0

Add the mounted isos to apt source.  Edit /etc/apt/sources.list and add

deb file:///path/to/mount/ hardy main restricted

Only one user, so auto login

Go to “System Settings”, then “Advanced”, then “Login Manager”.  Click “Administrator Mode” and enter password.  Go to “Convenience” and check “Enable Auto-Login”.

This is specfic to M1330.  We must blacklist the driver video, this fixes with brightness being issued more than once when pushed.  Edit /etc/modprobe.d/blacklist

Change the video drivers to use “intel”.  It’s currently as “vesa”, but I want “intel”.  We don’t need to install 915resolution.  But when changing the drivers, we must select the specific monitor and say it is widescreen.

Go to “System Settings”, then “Monitor and Display”.  Click on “Administrator Mode” and type password.  Click on “Hardware” and push “Configure” for “Graphic card: VESA”.  Choose “intel” from the “driver” section.  Then click on “Configure” for “Monitor”.  Select “LCD panel 1280×800″ from “Generic” and make sure the “Image Format” is widescreen.

I like the console font for Konsole.  So lets install the console bitmap font.

$ sudo dpkg-reconfigure fontconfig-config
$ fc-cache -f -v ~/.fonts

After all this… reboot the laptop to take changes.

 I like gkrellm, so install it.

$ sudo apt-get install gkrellm

A new way of setting up the fan

http://ubuntuforums.org/showpost.php?p=4069092&postcount=6

 For some reason, the sound didn’t work… or it was muted.  So, go into right click on KMix, and select “Select Master Channel”, then select “PCM”.

http://ubuntuforums.org/showpost.php?p=5407780&postcount=8

C# - web service tip - extending web service classes

May 10th, 2008

When generating a web service class by the WSDL generator, it overrides what was there regardless of modification.  One of the thing that bugs me is that some of the classes it generates, I would put a property that would return itself (for data binding).  So, everytime I would update the web service, that property would get lost.  It wouldn’t be a problem, but it’s not just one class, its a couple classes, and this project does not just have one web service, it has many.

So, to fix this problem, I was thinking of everything… from using reflection to create the property for every web service, to creating a macro in the IDE so everytime I do an update, it would automatically create it for me.

Then yesterday, I was looking at a class for another issue.  Then I asked myself, why is there a ‘partial’ keyword for the class.  I know what partial does, but for a web service class (????)… why?  Then I pulled up MSDN and read more on partial.  It says that it can help with developers modifying the same class without modifying the same file… (hm…. the gears are going now…).  Then I think… could I have a partial file thats not in the same directory as another file… I did a test partial file in another file.  Changed the namespace to match the original namespace.  Built it… no errors…. ran it… no problems.  OH….. i have now seen the light.

So, did an update to my web service, created a partial class in another directory, created the property in that file, then buildt and ran my code.  Everything was working.  This was great, that means I can extend web service classes without having the fear of forgetting what properties I need.

Summary… let the web service class generator do it’s thing.  Create another class (doesn’t need to be in the same directory) with the same name, change the namespace to match the original generated class.  Now, you’re ready to go.

C# - web service tip - compression

May 10th, 2008

So, I’ve learned alot about C# because one of my projects I chose to go with C#. Well, here’s a little background. We have a linux server that will host the web service (using NuSoap). Then I have a windows client which is developed on C#. One thing that I know is that the data going back and forth will get large (around couple KBs). So, I’ve been trying to figure out how to use compression.

NuSoap has built in compression by checking if the HTTP headers if it supports it. So, I need to modify the clients header to tell the server it can receive compressed data. Basically for each service that .NET creates by WSDL, you need to override the GetResponseStream and GetRequestStream function.

GetRequestStream is where you would modify the headers to accept gzip.

GetResponseStream is where the decompression takes place when the server sends the data over.

I won’t write any code here, but you can search on google for some sample code. Real easy too.

After doing this, I did some analysis. Original data -> ~7KB, compressed data -> ~800B (about 90% reduced). Original data -> ~5KB, compressed data -> ~800B (about 80% reduced).

Sure… I’m not sending data that is huge, but this is for a simple case, and for future features that are intense with data, this will help.

Installing apps/games on Blackberry without OTA

May 10th, 2008

This is a tip on installing applications and games on the Blackberry without the Blackberry (BB) data service.

Without the BB data service, you will need to download the application onto your desktop, then save it to the BB. Then on the BB itself, go to the file, select it, and it will show up a download or install screen.

To download the actual package for the BB 8130, there needs to be a hack to actually download it. On Firefox, theres an add-on called “User Agent Switcher”. Install it, and lets create a new agent. For the description, I put BlackBerry 8130, for User Agent, I put BlackBerry8130-4.3.0, thats my blackberry-OS version, then for App Name, I put BlackBerry.

Now, go to whatever download section (only tested with Google Maps) with the new user agent selected, and you will be able to download the application. After downloading it, save it to the BB, get on the BB, and install it.

This tip was based off of http://www.labelme.org/family/blog/2008/02/01/a-healthy-addiction/ .

Tip: remember to switch the user agent back to default after you’re done downloading.

Dell Inspirion 700m too hot…

April 29th, 2008

Basically, since using my laptop more and more, I’ve noticed that it has been getting hot. The fan should be turning on, but it hasn’t. So after digging around… I fixed the problem.

First, I’m not sure if turning off apmd made a difference or not, but I did it because another forum told me to do it. But after the results were not successful, I kept it off. acpi is newer than apm, so I left apm off.

In this thread, it basically tells you to install the i8k packages. http://ubuntuforums.org/showthread.php?t=74578

In this thread, it basically tells you how to configure the i8k package. http://ubuntuforums.org/showpost.php?p=1325507&postcount=128

By doing both, I got my fans working.

Blackberry 8130

April 5th, 2008

At the end of March, my mobile contract ended with AT&T.  Before that, I knew I was going to be happy in switching to another carrier since the service is bad at my place.  My sister mentioned that she got Sprint and her plan is cheap.

It’s the SERO plan.  It comes with unlimited text and unlimited data for $30.

I looked at the phones they had and  I wanted to get the Blackberry 8130.  But the purchase needs to have the Blackberry Data Service (which is an extra $39.99).  But searching online, I found out that you don’t need the data service if you have a Blackberry phone.  It’s only useful if you need push email and other blackberry service.

Some say you can’t get the Blackberry without the Blackberry data service.  Some say you need to be persistent and just keep asking for the original plan without the Blackberry data service.  Basically I did the latter and now I have a $30/month plan with unlimited text and unlimited data.  I can surf the net with Opera Mini.

Since all my computers are on Linux/Ubuntu, I had to find a way to install the desktop software for the Blackberry.  I have VMware with WinXP, so I installed it.  After a couple days of figuring out why it wouldn’t work, I found out that with the CD install (Desktop Application), you need to have the Device software too (which is not on the CD).  I searched the net and found the link to getting the Blackberry 8130 device setup (you can get that directly from the Blackberry website).

But getting the software on windows to connect to the device worked like once or twice.  Then I figured that the layer between (which would be the Linux/Ubuntu) needed extra support.  So I searched again, and found out that there’s Barry, a Linux support util and library to communicate with the Blackberry.

So finally… I have a working situation where I can connect the Blackberry to my PC and install applications, backup data and everything else.  It is done by installing Barry on Linux, running WinXP on VMware, and finally install the Desktop Application with the Device setup.

It’s been a while… here’s a small update

March 11th, 2008

Haven’t been blogging for a while, but I’ve been busy. I’ve had a midterm for the circuit analysis class. Oh man, I was stressing. I took the week off to study all week. The results were good, so I guess it paid off.

So this month is personal project month. Basically I am working a web service project that logs data.

Speaking of projects… my team was going towards a digital receipt. We were planning this since last year. We were in the analysis and design stage. While doing research, then Jack contacted Visa. Basically he found out that a couple companies were already doing this. One of them is ReceiptCity.com. They started in 2000 and got like $15.5 million. I guess we’re 7 years too late for that. I looked them up and they are doing exactly what we were thinking of.

Anyways… next month is girl month. What does that mean? I don’t know. It’ll probably be me talking to more random girls. Which would hopefully make me more comfortable around them. >_< *heee hee* girls…

Last month, which was don’t smoke was a good month. Didn’t even smoke. But the last week was a test… it was the midterm week and I was stressed. I wanted one badly, but I’m glad I didn’t smoke.

I have this saved bloged called “Best Buy Girl”.  It will be a story about a girl I met at Best Buy a couple years ago.  But I haven’t had the time to write it, so oh well.  When I have time….

My beer list…

February 16th, 2008

I like beer.  Back a couple years ago, I didn’t really like it but I guess I have aquired the taste.

From the beginning, I didn’t like beer, so to drink, I would get the Hefenwesien.  It has a thick sweeter taste than some beers.  But depending on where you get it, you can get that sour/bitter mouth.  But when it’s good, it’s really good.

Then I got into Bud Light.  I think it was all the times me and my friend would go to the Bamboo and would share a pitcher.  Now I love having a Bud Light on tap drinking from a very very frosty mug.  The first sip is like a million ice particles hitting your tongue.  Then once you swallow, you can feel the ice go down to your stomach.  With Bud Light, I can drink 2 glasses and I would be good.

I then started to drink Samual Adams Summer Ale.  It could have been because me and my friends went on a trip to Maine, then stopped by Boston.  It was the summer, so they had the special brew.  Oh yeah, that reminds me that when we were in Boston, we went to this Irish pub.  We were taking shots and drinking Summer Ale.  I was talking to this girl and with every drink she got hotter and hotter.  O_O Beer goggles… never trust them.

I don’t know where this came from, but I started to like Coors Light.  Where did this come from?  I don’t know.  I think Coors Light is like Bud Light, but having a more stronger taste.

Now… here are three beers where I can’t stop thinking of…

1. Masa Honey Blonde

2. Kona Longboard

3. Kona Fire Rock

Not in any particular order, but these are my choice in beer.

Masa Honey Blonde is servered at the Masa of Echo Park place.  It’s a pizza place in Los Angeles.  We went there to have a surprise bday for another friend.  The honey blonde is sweet and has a very nice taste.  Ever since that day me and my friends went there, I’ve been craving one.

I had my very first Kona Longboard when my friends and I went on vacation to Hawaii.  We bought a six pack of long necks and we just chilled on the balcony.  It was just very relaxing.

The Kona Fire Rock… my friends and I got this at the Goat Hill Tavern in Costa Mesa.  This place has over 140 taps.  It’s insane.  What made me choose the Fire Rock to the other taps?  Well, originally I ordered the Bayback Honey (???), cause I thought it might be the same as the Masa Honey Blonde.  But they said they were out of it and I asked for the Fire Rock.  Fire Rock was a good choice cause it was good too.

Hybrid idea…

February 3rd, 2008

I’ve been looking at hybrid cars lately.  But I’m also attached to my truck.  So one idea that I have is to covert my truck to a hybrid.

Would this idea be possible?  I think anything is possible.

Would this be expensive?  I hope not…

I think if I am serious about this, I would have to buy another car first so I can work on project hybrid.

While I don’t have another car yet, I can think of what I would need to do to make it hybrid.  Basically plan my action.

Is anybody interested in doing this with me?