Thursday, June 25, 2009

Fix: Ubuntu not able to use installed memory

To check how much memory ubuntu is able to use on your system, run the following command in a terminal:
free -m
For reference, I know that my PC has 4GB of physical memory installed and the result of the command above shows:
             total       used       free     shared    buffers     cached
Mem:          4012       1837       2175          0        451        722
-/+ buffers/cache:        662       3349
Swap:         9538          0       9538
If you have more than 3GB of physical memory installed and if you haven't specifically enabled PAE for your ubuntu desktop installation then I'm betting that the total Mem you'll be seeing is LESS than the actual physical memory installed in your machine. To fix this, you simply have to install a PAE enabled kernel. Run the following commands in a terminal:
sudo apt-get update

sudo apt-get install linux-server linux-headers-server linux-image-server
Reboot your system. To check if you have the correct kernel running and all your mem enabled:
uname -a

free -m
You should see an ubuntu server kernel running and the correct amount of memory is available for use. Did it work for you? You are welcome to post your comments/questions or better yet, link to this post, blog about it and tell all your friends who might find this post useful.

Wednesday, June 24, 2009

Run grails-app on the root context

USECASE: You want to run your shiny grails killer-app using the jetty server on port 80 and using the root context. Running it on port 80 is covered by providing the grails run-app command with the desired port but your app will still run on http://localhost:80/killer-app. To run it on the root context, you can do:
grails -Dserver.port=80 -Duse.root.context.path=true run-app
but first, you have to modify _GrailsRun.groovy and change an existing method to this:
private runInline(scheme, host, httpPort, httpsPort) {
    EmbeddableServerFactory serverFactory = loadServerFactory()    
    def useRootContextPath = System.getProperty("use.root.context.path")
    if(useRootContextPath)
        serverContextPath = '/'
    grailsServer = serverFactory.createInline("${basedir}/web-app", webXmlFile.absolutePath, serverContextPath, classLoader)
    runServer server: grailsServer, host:host, httpPort: httpPort, httpsPort: httpsPort, scheme:scheme
    startPluginScanner()
}
You can find _GrailsRun.groovy in $GRAILS_HOME/scripts

WARNING: THERE ARE SERIOUS PENALTIES FOR ROLLING OUT YOUR APP THIS WAY

The code seems trivial but I'll submit it anyway to the grails dev team for inclusion. Did it work for you? You are welcome to post your comments/questions or better yet, link to this post, blog about it and tell all your friends who might find this post useful.

Monday, June 22, 2009

Fixing Pidgin error on Yahoo login

Applicable to: Ubuntu 9.04 Jaunty Jackalope UPDATE: The cause of the problem seems to be a new login protocol. The guys responsible for pidgin has released a version with the fix. The only problem is that the guys responsible for ubuntu don't normally update pidgin. You can visit the official download page here or see the instructions below: Open a terminal window and run each line below:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com \
67265eb522bdd6b1c69e66ed7fb8bee0a1f196a8

echo deb http://ppa.launchpad.net/pidgin-developers/ppa/ubuntu \
`lsb_release --short --codename` main | \
sudo tee /etc/apt/sources.list.d/pidgin-ppa.list

sudo apt-get upgrade pidgin
Did it work for you? You are welcome to post your comments/questions or better yet, link to this post, blog about it and tell all your friends who might find this post useful. Hope this helps!

OLD ENTRY: It's been a week already since I was able to use pidgin to login to the Yahoo network on my Ubuntu installation. There seems to be a problem with the scs.msg.yahoo.com. To fix this problem, go to Accounts -> Manage Accounts then select the Yahoo account then click on Modify. Go to the Advanced tab and set Pager server to cn.scs.msg.yahoo.com. Click on Save and restart Pidgin.

Saturday, June 13, 2009

Fight Viruses/Trojans: Disable Autorun in Windows XP

With the proliferation of trojans and viruses that takes advantage of the autorun feature of Windows, it seems only logical to disable the said feature.

Step#1 Open a text editor like Notepad

Step#2 Copy and paste the code below into the empty notepad document
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:000000ff
"NoDriveAutoRun"=hex:ff,ff,ff,ff
Or you can download the file I made: disableAutorun.reg

Step#3 Save the file to your Desktop naming it "disableAutoRun.reg" without the double quotes

Step#4 Go to your desktop and double click on disableAutoRun.reg

Step#5 A confirmation dialog will appear, click on Yes

Step#6 Reboot your computer

Please tell your friends about this blog entry. It will be a big help in our quest for safer computing



Did it work for you? You are welcome to post your comments/questions or better yet, link to this post, blog about it and tell all your friends who might find this post useful.