Smooth Migration from Windows to Ubuntu – 1

I recently installed ubuntu 11.04 and I made dual boot with windows XP – actually I didn’t make it ubuntu handled this- and I decided to switch for my personal use and @ my work environment as much as I can, I’ll try to mention here some of the issues I faced and how to resolve them to be able to use ubuntu instead of windows.

Most of those solution took about 10 mins googling to find out, when it comes to linux the Internet is very rich it’ll help you in all your problems.

Note: I’m not a Linux expert so there might be some non-precise terms used in my description also there might be better solutions, this is what I tried and worked.

Partitioning for installation

Basically you need two partitions a root partition and a swap partition, for the root you need 15-20 GB, for the swap it is recommended to be double the RAM size but I don’t think this is applicable if I have 3 GB RAM I won’t waste 6 GB of my hard disk as a swap that I’ll probably won’t need so I think that 512 MB-1 GB is enough.

In the ubuntu installer choose to install the boot loader to your entire hard disk so that the dual boot works

Auto mounting drives

In linux to access any hard disk drive you have to mount it first to some folder, it is the same in windows but the process is done under the hood, to auto mount your drives on start up, edit the /etc/fstab to add lines for your drives.

First you need to know the location of your drives, to do this open a terminal and type: df -h this will get you a list of your hard dist drives and the disk space usage of each, now this is the syntax to add a single drive to fstab file

/dev/sda1       /media/c        ntfs-3g default 0       0

Drive location, mount point the folder you want to mount your drive to, drive file system type ntfs-3g is used to access ntfs drives and make the drive read/write, other options leave them as default 0 0.

To edit the /etc/fstab file you must be root so assuming you’ll use a GUI text editor to edit the file, open a terminal (in Ubuntu 11.04 a shortcut for this is CTRL+ALT+T) and type:

gksudo gedit /etc/fstab

Type your password and you are ready to edit the file, you might want to take a copy of the file before editing incase something went wrong type: sudo cp /etc/fstab /etc/fstab.orig

Installing java

Software installation on linux might seem complex as you don’t have a .exe file to setup the program instead there’s something called package manager, this is a smart way to install software the package manager detect the dependencies for your software, installs them and configure your software so with typing only one command you can install the programs, it is something like installing an application on your iphone you just select the application and click install the operating system will download the app, install and configure it.

There’s something called Repositories in Linux, it is basically a place that contains the software you can find a repository for firefox, thunderbird, …etc, Ubuntu has some default repositories that contain a lot of software, Sun JDK is available in what’s called Canonical Partners repository in ubuntu this repository isn’t enabled by default to enable it: open synaptic package manager (in ubuntu 11.04 you can press the windows key then type synaptic and select synaptic package manager), go to Settings->Repositories->Other Software tab and select the checkbox of Canonical Partners, close the package manager.

Now open a terminal and type:

sudo apt-get update

sudo apt-get install sun-java6-jdk

Here you go JDK will be downloaded and installed

Posted in OS, Ubuntu | Tagged , , , , , , , | Leave a comment

Avoid Autorun Virus on Flash Memories

A nice trick to avoid the autorun virus on the flash memory on Windows platform without the need to an Anti-Virus

  1. Delete the autorun.inf file from the root of the flash
  2. Create an empty folder named autorun.inf on the root of the flash
  3. This way the virus won’t be able to create an autorun.inf file as there’s an existing folder with the same name or edit the contents of it as it is a folder
Posted in Security, Tips& Tricks, Viruses | Tagged , , , , | 1 Comment

Firefox 4 freezing problem

I recently downloaded firefox 4 and I installed it as an upgrade to the 3.6 version, I faced an annoying problem of freezing the browser when I open it nothing seems to be working I can only minimize, maximize or close. When I start it in a new profile – you can do that by running “firefox -p” from the run at the Windows – it’s working well and even restarting my machine didn’t solve the issue.

After some searching I found out that the problem is related to using the same profiles of firefox 3 so in order to solve the problem:

1. start firefox with a new profile (fx4) for example, this can be done by running “firefox -p” and create a new profile

2. close firefox

3. copy the data (history, bookmarks, preferences, …) of the old profile to the new, on Windows platform run “%APPDATA%\Mozilla\Firefox\Profiles” copy all the files from your old profile (if you never used profile manager this would probably be the folder ending with .default) into the new one – the folder ending with .fx4

4. delete the old profile and start firefox

 

Posted in General, Tips& Tricks | Tagged , , , | 3 Comments

Auto detect your Active Directory

Ad Explorer is an Active Directory explorer offered by Microsoft for free (you can download it at http://technet.microsoft.com/en-us/sysinternals/bb963907.aspx), most of the companies at Egypt use the active directory to keep the users and integrate it with Microsoft exchange server so probably you will have an entry on an Active Directory at your company.

If you don’t know the location (host, port) of the Active Directory at your company AD Explorer will detect it on the network, just open the program and when you are prompted for the Active Directory Database don’t enter any thing and press OK, it will detect the Active directory (I think it will log you in with your username and password, probably you will have read right over the directory – it depends on the security applied at your company- and who knows you might have some write rights).

Now you can enjoy navigating the directory, it will probably contain some interesting information like who’s the manager of whom, who has got what laptop and what’s the specifications, you can find some blocked users, … etc.

Posted in Security, Tips& Tricks | Tagged , , , , | Leave a comment

How to convert .doc files to .pdf

From my experience I found that the best way to convert .doc files into .pdf files freely and without any evaluation marks or searching for serials or cracks is to open the file with Open Office then select File –> Export as PDF. This will produce a PDF document with the same name as the original .doc file.

Posted in Tips& Tricks | Tagged , | 2 Comments

JDeveloper and Entity Beans

Steps to create an entity bean

  1. Open IDE
  2. Right click -> new -> Entity Bean
  3. Select the table and proceed

Steps to create an entity bean in Jdeveloper 10.1.3

  1. Open Jdeveloper
  2. Right click -> new -> Entity Bean
  3. Nothing happens, wait
  4. Still nothing, go to the task manager to see the processing usage of the jdevw process
  5. It’s 0%, wait again
  6. Check your mail or read some blog post
  7. Try to minimize and maximize the Jdeveloper, now you’ll get the usual grey blank space at the window
  8. Try to close the Jdeveloper window, no reseponse
  9. End the process of jdevw from the task manager
  10. Open the Jdeveloper and try step 2
  11. You’ll go through steps (3-9) again
  12. Restart your machine
  13. Try steps (1-2)
  14. Select the table and proceed
Posted in Jokes | Tagged , | Leave a comment

Using JAXB2 with JDeveloper 10g

This post describes how to use JAXB 2 on JDeveloper 10.1.3.3, by using I mean compiling the program and testing it on the embedded OC4J if you want.

The problem is that the embedded OC4J has a default implementation of JAXB 1 which varies big time from JAXB2 as the first version didn’t contain annotations. To use your JAXB2 libraries as a replacement to JAXB1 in OC4j 10 you have to make a shared library and attach it to your application on deployment, for embedded oc4j this process isn’t easy as it doesn’t have an interface to do this so you would have to manually edit some XML files to do this and some of those files may be overridden if the application is deployed automatically  that’s when you click run on a servlet, ejb , …etc. this link (http://buttso.blogspot.com/2007/09/using-jaxb-20-with-oc4j-1013x.html) shows how to add a shared library to your application in embedded oc4j (at the comments section).

JDeveloper comes with it’s own JDK  and the embedded OC4J uses this JDK, according to the application server specification the classes under java.* or javax.* will be looked up in the JDK (or JRE) first, if not found the application server will start looking up in the lib folder of your WEB-INF or in a shared library as OC4J. The JAXB2 implementation classes have the package of javax.* so simply if you want your embedded OC4J to use the JAXB2 implementation instead on JAXB1, put the jars of JAXB2 in the JRE of the JDeveloper you are using, this will be found under the directory:

<YOUR_PATH>\jdevstudio10133\jdk\jre\lib\ext

This solution is better in my opinion than adding a shared library to your embedded oc4j because why would I care to keep the implementation of JAXB1 – by adding a shared library I’m just overriding this implementation for this application – if I’m sure that I won’t be using it any more and If I have a new application that needs JAXB2 I would have to repeat the same steps for it.

Feel free to drop in a comment or e-mail me for any questions/ feedback.

Posted in Binding Frameworks, Embedded OC4J, JAXB2, Oracle | Tagged , , , | Leave a comment