Cogito, ergo sum

Here's hoping my musings can help you out!

Archive for February, 2009

Removing a Linux installation (dual boot with Vista)

Posted by mnshankar on February 20, 2009

A couple of days ago, I had installed Ubuntu on my computer to see what all the fuss was about. Now that I am done exploring most of the cool themes, effects, compiz/emerald settings etc, I wanted to get rid of it . I was also constantly trying to modify my Ubuntu install to resemble Vista (changing themes, fonts, colors, browser skins etc).  Here are the steps to roll back the Ubuntu install :

Step 1: Removing GRUB

The first step is to remove the “Grand Unified Loader” and put back the vista installer. EasyBCD is a freely available program that makes it a snap. Download the software from here.

Once the install process is complete, Open the application and click on the ‘Manage Bootloader’ button

image

Next, click on the ‘Write MBR’ button (By default,the ‘Reinstall the Vista Bootloader’ radio is selected)

image

Thats it! Now, when you restart your computer, Vista boots normally. We now have to deal with removing the partitions that were created during the linux install process (Swap space and Ext3 partitions). 

Step 2: Removing the unwanted partitions and merging them with the Vista partition.

This is easily accomplished using the Disk manager utility provided in Vista. Right click on the ‘Computer’ icon on your desktop and select ‘Manage’

image

Select ‘Disk Management’ under storage. I have highlighted the partitions occupied by Ubuntu on my computer:

image

Right click and select ‘Delete Volume’. You may need to do this multiple times until the partition shows up as unallocated space as shown below:

image

Next, Right click on your vista partition ‘C’ and select ‘Extend Volume’. Congratulations! you have successfully gone back to your pre-linux configuration!

Posted in Computers and Internet | Leave a Comment »

Forward Vs. Redirect

Posted by mnshankar on February 20, 2009

This is with respect to the Zend Framework (but the concepts pretty much apply to all web systems)

Forward

  1. The browser is unaware that a change of address has taken place. So, the URL remains the same. Note that if using PHP, the value of $_SERVER[REQUEST_URI] remains unchanged
  2. If the ‘Reload’ button is hit after a forwarded request, the original request is sent (as url has not changed)
  3. Forwarding is always faster than a redirect

Redirect

  1. The application instructs the browser to go to a second URL (browser address bar displays the new url)
  2. If the reload button is hit, the second URL is fetched
  3. Contents of the buffer are flushed before a redirect

The Zend Framework has a cool action helper to help with redirects –’redirector’. Always use this instead of using the redirect command with relative paths embedded as parameters:

$this->_helper->redirector(‘action’,‘controller’);

The controller parameter is optional – it defaults to the current controller if omitted.. Sweet!

Typically, if a database change is done, use ‘redirect’.

This is logical too.. After you do a database update operation and display a confirmation page to a user, you do not want a refresh to mess with the database again. So, use a redirect to display the result of a processing.

Posted in Zend Framework | Leave a Comment »

Securing an MS Access database with User level security

Posted by mnshankar on February 19, 2009

1. Create a new workgroup file to control access to the database

Open Microsoft Access. Click on Tools->Security->Workgroup administrator

image

Click on the ‘Create’ button to create a new .mdw (Microsoft Database Workgroup) file

image image

Then, select the location where you want the security file (.mdw) stored. Note that once you have created this file, the workgroup administrator automatically links to the newly created workgroup file. Hit the ok button to quit the workgroup manager.

2. Securing the ‘Admin’ user and creating a new administrator account

By default, access logs people into databases as ‘Admin’. Once a password is assigned to this account, the user is prompted with a username and password dialog box.

Click on the ‘Change Logon Password’ tab and enter your new password (and verify)

image

When we are done with the whole process, we will remove the user ‘Admin’ from the ‘Admins’ group. So, go ahead and create an administrator account for your database.

Click on ‘Tools’ ->’Security’->’User and group accounts’. Clicking on the  ‘New’ button will allow you to enter a new username.

 image image

Then, make the newly added user a member of the ‘Admins’ group

image

There.. this step completes the ‘preparatory’ activities for establishing workgroup security on your database.

3. Starting the securing process with a clean slate

Now, we will create a brand new database, import ALL objects from the database that we wish to protect and assign our privileges. Note that all the time we are ‘connected’ to the newly created mdw file from step 1.

The easiest way to create a new MS Access database is to rightclick on the target folder and select ‘New’=>’Microsoft Access Application’

image

When you doubleclick on the newly created mdb file, you will be prompted for a username and password. Now, login using the administrator credentials that you just created (‘phhpadmin’ in this case). Note that the default password is blank. After you login, click on the ‘Tools’->’User and Group Accounts’ option. You will now be able to change the administrator password from blank to something more secure.

image

4. Importing ALL objects to the new database

Double click on the new database and login as the administrator (phhpadmin in my case). Right click on the database window and select ‘Import’ to bring up the import wizard to help copy over all your objects from the database you wish to protect. Note that after the securing process is complete, you will be using the newly created database (and abandoning the unsecured access file)

image

image

(Note that sometimes the import process just hangs.. do and end-task and reopen the db if it happens.. The objects normally get imported)

The next step is to create the groups that we require. It is always a good idea to assign privileges to groups rather than users. In our case, we will create a new group called ‘advisors’.

Click on ‘Tools’->’security’->’user and group accounts’. Click on the ‘Groups’ tab and click on the ‘New’ button

Create your new group and hit the OK button:

image

5. Running the MS Access user level security wizard. Although it is possible to do the entire configuration by hand, this wizard makes it so much more easier and streamlined.

Login to the newly created database as administrator (phhpadmin). Click on tools->security->user-level security wizard

image

 

Click on ‘Modify my current workgroup information file’ and hit the ‘Next’ button

image

On the following screen, All database objects are selected by default. Verify and hit the Next Button.

The next step involves selecting groups for inclusion in the workgroup file. MS Access provides 7 default groups. But we are only interested in the group that we created (advisors). Select it and hit the ‘Next’ button

image

The next step of the wizard asks whether the ‘Users’ group should be assigned any permissions. Make sure that ‘No’ is selected on this page.  All users belong to the users group by default so it is best to deny all privileges first then assign as required

image

Add the new users that you would like to have access to the database in the next step. Note that entering a password is not mandatory

In the next step, click on ‘Select a group and assign users to the group’. This way, you can assign all the newly created users to the ‘advisors’ group. This is shown below:

image

Access will create a backup of the database (.bak). This is for archival purposes only. you will not be using this file. Close MS Access

6. Granting rights to the newly created group (advisors)

Open the secure database file and login as administrator. Click on ‘Tools’-’security’=>’user and group permissions’

Click on the ‘groups’ radio option and select ‘advisors’ group. From the Object type drop down list, select ‘Database’. Then, check the ‘Open/Run’ permission. Note that without doing this, your newly created users will not be able to open the database!

 

image

Next, select ‘Table’ from the object type drop down, Select all the tables in the ‘Object name’ list box and check the ‘Read’, ‘update’,'insert’ and ‘delete’ (since I want all advisors to be able to read, update, insert and delete data to/from all tables)

image

You may want to do the same for ‘Query’.

For Forms, Reports and Macros, I like to restrict the users to just ‘Open/Run’ privileges (so they wont be able to modify design)

When you are done tweaking your database permissions, close out the database. Now, try logging in as one of your users (note that the password defaults to blank) and testing the newly assigned permissions.

Your database is secure at this point. However, one crucial step remains – Forcing the user to open the database using the workgroup file that you created (secure.mdw)

7. Creating a shortcut that incorporates the workgroup file

As creator of the workgroup file, I remain connected to it until I connect back to the default system.mdw workgroup. Let us do that and see what happens. Open MS access, click on Tools->security->workgroup administrator

Click on the join button and join the default workgroup file at:

C:\Documents and Settings\<username>\Application Data\Microsoft\Access\System.mdw

Now try opening our newly created database.

image

So, what just happened? The users and groups that were granted access to the database objects are not present in system.mdw!

The fix is easy. We need to create a shortcut that links the mdw file to the mdb file.

Right click the secure mdb file and select ‘Create shortcut’.
This creates a shortcut to the database in the same directory. right click on the shortcut file and select ‘Properties’

 

Change the "Target" field so it looks like:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"  "C:\Secure_Advisors.mdb" /wrkgrp "C:\Secure.mdw"

Note the ‘/wrkgrp’ switch that is used to reference a workgroup file.

You can now distribute the shortcut file to the users of your database and they should be able to login using their credentials.

Posted in Database | Leave a Comment »

Ubuntu 8.10 (Intrepid Ibex) on my Gateway GT5628

Posted by mnshankar on February 17, 2009

Last night I ended up installing the most recent version of Ubuntu (64 bit) on my new gateway Quad core computer. For some reason, Neither Ubuntu 8.04 nor 7.10 installed on it (the status bar would just hang at 3%)

Anyways, I think 8.10 is *the* defining version of Ubuntu. It installed effortlessly, did not present any driver issues, and most importantly did not break the suspend or hibernate! It still maintains an incredibly small footprint and is blazing fast. It accomplishes in about 3 GB much more than what Vista and Office do in about 50 GB!

One of the first things I did is to install segoe font. I think the default ubuntu font leaves much to be desired. I’m also not a big fan of the default wallpaper and theme (I have mine set to clear looks glossy with the green earth wallpaper). Ubuntu automatically prompted me to install a restricted driver for my Nvidia card which I did. No problems on my 24 inch DVI screen.

Later.

Posted in Computers and Internet | Leave a Comment »

Odd border line on resume from hibernate or suspend in Ubuntu 8.10

Posted by mnshankar on February 15, 2009

On resuming my computer from Hibernate/Suspend (Ubuntu 8.10), a weird second line used to appear right alongside the panel and menu borders. This troubled me for quite some time..  Finally, I was able to get rid of it by turning off the "lock on hibernate/suspend" setting.
Configuration editor ->Apps->gnome power manager->lock
Uncheck both the hibernate and suspend settings.

Posted in Computers and Internet | Leave a Comment »