40

My First Tip on using Ubuntu with Chrome OS on CR-48 Notebook (Updated)

Update (03/15/2010): Based on Dan’s comment below, I’ve updated chromeos and ubuntu aliases in the post to remove the Chrome OS partition part. According to Dan, my previous aliases raised Chrome OS partition whenever the OS was switched, which means that when Chrome OS is updated, these aliases would restore the Chrome OS to the oldest version. For more information about this update, please read Dan’s comment.

Update (12/19/2010): I wrote a post on how to use your flash/USB drive to (re)install Ubuntu on the CR-48. Check it out.

Update (12/18/2010): I just discovered that .bashrc file is never executed in Chrome OS unless running another bash after chronos is logged in, and .profile is the file which being executed after each login. Therefore I changed the following instruction to .profile for Chrome OS. If you already created .bashrc file in the chronos home folder, you just have to rename it to .profile using the command below:

mv .bashrc .profile

Introduction

I have used the newly received CR-48 from Google for two days. I enjoyed so far for web browsing, but not so for web development / programming. Since I couldn’t find any good IDE on the cloud which has support for WebDAV, I decided to following the instruction on the Chromium Project website to install Ubuntu onto this device. After several hours of installation, Ubuntu loaded to the device. However, because it comes from a VirtualBox disk image, it’s nearly impossible to reinstall Ubuntu without re-transferring the disk image from my laptop to this notebook which is a 5GB file, it would spend another 5 hours just for transferring this file over ssh. I’m trying to shorten this long waiting hours. I will post another tip if I find a way. But for now, here are the two scripts I wrote to switch between Ubuntu and Chrome OS using the alias command.

Steps

First of all, I assume you also received a CR-48 notebook and installed Ubuntu on it by following on this page.

This first script is for Ubuntu:

  1. Open the file named .bashrc in the home folder  using your favorite text editor (make sure to show the hidden files by pressing Ctrl+H).
  2. Add the following line to the end of the file:
    alias chromeos='sudo cgpt add -i 6 -P 0 -S 0 /dev/sda;echo "Switched to Chrome OS, restart the machine to take effect"'
    
  3. Open a new terminal window to load the new alias.
  4. Type chromeos and a message will be displayed stating that you need to restart to switch to Chrome OS
  5. Restart your device and you are in the Chrome OS.

Now inside the Chrome OS:

  1. Press Ctrl + Alt + -> (the Forward button in the first row) and login as chronos
  2. Since Chrome OS also uses bash, we can write to the .profile file, but this time in the chronos home folder.
    qemacs .profile
    

    The command above creates and opens a new file called .profile inside the home folder using the only text editor available in Chrome OS qemacs.

  3. Insert the following line into .profile
    alias ubuntu='sudo cgpt add -i 6 -P 5 -S 1 /dev/sda;echo "Switched to Ubuntu, restart the machine to take effect"'
    
  4. Execute bash to launch another instance of bash, or if you are confused, you could just logoff current session by typing exit command and login again.
  5. Typing ubuntu command to switch to Ubuntu on the next startup.
  6. Restart your device to begin using Ubuntu.

In the future, you could just use chromeos and ubuntu commands to switch back and forth between Chrome OS and Ubuntu without changing back to normal mode using the small switch on the back of the battery.

Enjoy the free dual-boot notebook from Google.

3

Build a Private Git Server using VirtualBox Bridged Network

Virtual Git Server with VirtualBox

I had been adjusting my new GNU/Linux environment with Arch Linux lately. Almost all the utilities that I need in Arch Linux were downloaded through the AUR and then compile and install them on demand which was pretty fast. Along with the software installation in Arch Linux, I also discovered Git version control system which I think it’s useful for version control  my website files. However, the only Git hosting provider GitHub offers 300MB of storage space which is not enough for my 600MB (and growing) website files. Therefore, I decided to build a private virtual Git server for self usage.

Virtual Git Server with VirtualBoxBackground

For a long time, I use NAT network interface as the default interface for the network when building a virtual machine with VirtualBox. Recently, I tried to build a virtual private Git server to version control my website files. I created a virtual machine in VirtualBox and customized it a little as usual, and installed Ubuntu Server as the server OS. After the installation was finished and logged into the server, I noticed that the IP address was 10.0.2.15 which can’t be accessed both by the host system and other systems on my home network. The Networking Modes section in the VirtualBox manual (http://www.virtualbox.org/manual/ch06.html#networkingmodes) explains that the NAT uses a virtual router to obtain the IP address whereas the Bridged uses a virtual network adapter to obtain the IP address which means that it obtained the IP address from my home router. This solves my problem for getting IP address for the virtual server to join my home network.

Steps

  1. Open VirtualBox.
  2. Choose the virtual machine with the network interface to be configured.
  3. Click Settings and select Network on the left.
  4. Choose Bridged Adapter in the “Attached to” list.
  5. Choose the appropriate physical network adapter in the Name list (I chose wlan0 since I’m using a netbook).
  6. Click OK to close the Settings dialog and click Start to start the virtual server.
  7. After the server was fully started and logged in, type “ifconfig” (without quote) to verify the IP address. If it’s like the format “192.168.0.x” or the format similar to your home network, the bridged networking is activated. Otherwise, visit the community forums (http://forums.virtualbox.org/) for help.
  8. Test the network – First, test on the host system: Type the IP address you got from the previous step into the browser on the host system (in my case, on the netbook). The network is working if “It works!” default web server page appears in the browser.
  9. Then, test on another system in the same network (which is my laptop): the same procedures as in the last step.
  10. If all went well, you should ssh from another system to the virtual server for remote access in order to create a Git repository.
  11. For more information on how to create a private Git server, read this article (http://tumblr.intranation.com/post/766290565/how-set-up-your-own-private-git-server-linux). The steps are the same except you are setting up in a virtual server instead of a real server.

Feel free to comment below if you have any questions regarding creating a server in the VirtualBox.

0

ISO Master – An Useful ISO Creator and Editor for GNU/Linux

If you are following my Twitter, identi.ca, or Facebook feed recently, you knew that I’m currently switching to Arch Linux on my laptop since I don’t like Unity to be the default UI for Ubuntu 11.04. Besides, I already lost interest with Ubuntu 10.10. This post is based on the upcoming post about my Arch Linux installation experience.

When I was installing Arch Linux, I have to change the ISO label in order to reproduce the following error message inside VirtualBox:

(Click to enlarge)

I never changed label for an ISO file in GNU/Linux. So I googled a bit and found an useful tool for creating and editing ISO files called ISO Master. It is on the Softpedia website, which is a software download and review site. Unfortunately, I don’t think this tool is in any of the GNU/Linux repositories. This means that I have to compile and install it myself. Surprisingly, after I downloaded the source file, the compiling and installing process went smoothly without any error.

After the installation was finished, I launched ISO Master from the Sound & Video application menu. The UI is clean and easy to navigate. I opened downloaded Arch Linux image file and click File → Properties. I then changed its volume name and saved as a new ISO. Thanks to this useful utility, I was able to reproduce the above screenshot, as well as my operation with ISO files in the future.

For the complete review of ISO Master, read the article on Softpedia: http://www.softpedia.com/reviews/linux/ISO-Master-Review-50543.shtml

0

Use Samba to Transfer Files between Fedora and Windows XP

Samba is a GNU/Linux network service that provides file sharing between GNU/Linux and Windows. One week ago, I switched my netbook from Ubuntu back to Windows XP thanks to the Google Earth plugin. I need to use Google Earth API for my ColdFusion class and it needs Google Earth plugin to test the API code. However, the Google Earth plugin doesn’t have a Linux version yet despite the popularity of Google Chrome and Google Earth on GNU/Linux. I initially thought that Google Earth plugin could work on virtualized Windows XP through VirtualBox. It failed to display the data due to the low performance of VirtualBox graphics card.

Anyway, to use Samba, you need to first install it by entering the command below to the terminal:

sudo yum install samba samba-client samba-common samba-swat

After the installation, I followed a helpful tutorial on linuxhomenetworking.com to complete the Samba setup. It provided me step-by-step instructions to setup the Samba server using SWAT web interface.

I use Asus Eee PC 1005HA, which means that it has Windows XP Home Edition. The instructions for this tutorial on how to connect Samba server with Windows XP Home confused me. I was never able to connect to the server based on it. Fortunately, I found a post on linuxforums.org that discusses about the same issue. According to the discussion, the firewall must be disabled to allow Samba to accept the connection. This inspired me to enable the Samba and Samba Client ports in Firewall setting without completely disable the Firewall. This prevents any unnecessary security issues. Windows XP successfully connected to the Samba server without any problem.

I have not yet tested with transferring files from Windows XP back to Fedora directly on Fedora, but I think it’s the same technique. Some of the Samba server security concerns would rise if Samba is used on a non-password protected network. According to the article on linuxhomenetworking.com, you need to setup a local HTTPS Certificate for the Samba server if you have any security concerns. I don’t need the certification because I only use the sever on the home network and the network is password-protected.

0

The ColdFusion website is now fully data-driven

I learned a way to write code for the menus by using database instead of using cfswich. Now the course website is completely database-driven. I used the CMS approach to redesign the links in each menu. Here is the entire code for the content page that corresponce to the menu items:

<cfquery name=”qGetURL” datasource=”DSN0111″>
SELECT *
FROM tblMenu
WHERE 0=0 AND
<cfif isDefined(“URL.projectid”)>
menuID = #URL.projectid#;
<cfelseif isDefined(“URL.pageid”)>
menuID = #URL.pageid#;
<cfelse>
menuID = 18;
</cfif>
</cfquery>

<cfoutput>
<cfset filePath = ExpandPath(“#qGetURL.linkLoc#”)>
<cfif fileExists(filePath)>
<cfinclude template=”../#qGetURL.linkLoc#”>
<cfelse>
<div id=”noVal”>Not Found</div>
<cfinclude template=”index.cfm”>
</cfif>
</cfoutput>

As you can see from the above code, the file location and the file names are stored in the database instead of the page content. This way, I can create web pages inside site directories and then include it to the website through database without change the above code.

I also plan to create a ColdFusion web application that can directly update the database without launch MS Access. Right now I’m using CFEclipse to write the ColdFusion code on my Fedora system and virtualized Windows XP through VirtualBox to modify and viewing the database. My goal for this web application is to allow me to modify or view the database with less or no MS Access usage.

For those who don’t know, my ColdFusion course is Microsoft Access based, not MySQL based. I successfully installed ColdFusion 9 on my Fedora system, but I failed to install MS Access driver onto the system. That’s why I plan to create this application in the next few weeks.

0

IE doesn’t Follow Web Standards and Make Web Developers and Customers Suffer (Updated)

Microsoft Internet Explorer (IE) discovered a big security flaw by the Chinese a few weeks ago. They used this security flaw to hack to the Google’s main server. Meanwhile, Researchers has discovered more security flaws in IE that could let an attacker to take control of targeted computer, according to an article from MashableMore Security Flaws Found in Internet Explorer“.
UPDATE: Similar article found on daniweb.com. It also mentioned about Firefox and Chrome. I like the first sentence of this article, “Another day, another IE flaw!” It means that the Internet Explorer patches that Microsoft offered are useless.

I read lots of complains about IE not follow web standard, thus web developers are frustrated about cross-browser compatibility for their websites. As a web developer and a GNU/Linux user, I test my website in Windows XP through VirtualBox from time to time. However, I do not test the cross-browser compatibility in IE. I test the functionality of my warning box in IE. If Internet Explorer is presented, the site stops loading and displays an error message in the warning box to encourage users to switch to other browsers in order to block the IE users.