Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Saturday, 19 December 2009

Changing folder rights and permissions in Vista

Recently I was confronted with a very peculiar problem. What actually happened was, I had set the permission of a certain folder to "Administrator" which was in D: drive. Later when I formatted my OS, I found that I practically did not own that folder, because it did not recognize the new "Administrator". So I was not able to work with any of the file within the folder. None of the video files opened, text files could not be modified, files could not be deleted or renamed, or in other words that folder had become useless.

Hence I tried a few things to change the permission of the folder as a whole, rather than an individual file, which is much easier, but really tedious to do. So I describe the process which was of particular help.

Before doing all this, its better that you disable UAC. Though the process given below can be done with UAC enabled. But it is recommended to turn UAC off so that you don't have to bear the pain of typing in the administrator password again and again.

Follow the following steps:
  • Right click on the folder you want to change the permission of.
  • Click on properties.
  • Click on Security tab.
  • Click on the "Advanced" button at the bottom right corner. "Advanced security Settings" opens up.
  • Click on the "Owner" tab.
  • Enter the name of the user, or even better will be "Administrator".
  • In case you cannot write in the space provided below "Current owner", Click on "Edit..." button.
  • Click on "Other users or groups...".
  • Now enter the user name, or "Administrator" in the space provided.
  • Click "OK".
  • Check the box which says, "Replace owner on sub-containers and objects".
  • Click "Apply".
  • Click "OK".
  • Click "OK" again in the present window.
  • You may be prompted with the message to continue, Click continue.
Even after doing all this, if you don't have control over your sub folders, it means that the rights of the sub folders are being inherited. So you need to change the "Auditing" for the particular folder.

To do so follow the following steps:
  • Right click on the folder.
  • Click on properties.
  • Click on Security tab.
  • Click on the "Advanced" button at the bottom right corner. "Advanced security Settings" opens up.
  • Click on the "Auditing" tab.
  • Click on "Continue".
  • Click on "Edit...". Another window opens up.
  • Click on "Add..." and enter the user name or "Administrator".
  • Click "OK".
  • Now, check the box saying, "Replace all existing inheritable auditing entries on all descendants with inheritable auditing entries from the object".
  • Click "Apply"->Click "OK".
  • Click "OK" again, and select continue if any pop up for permission comes in.

You have successfully changed the rights of the folder as well as the sub folders. In case you want to remove the garbage entries from the "Group or user names", simply open the "Security tab" and select them and click "Edit...", followed by "Remove".
That is it.

Enjoy!

Thursday, 8 October 2009

Installing Cygwin gcc manually

I've already mentioned the process of installing the Cygwin gcc compiler package directly from the internet in Microsoft Windows OS. But for those who are not able to follow it for some reason, here is a way of installing it manually, and this is a much easier process.
I have uploaded the necessary files required. So just download and install the Cygwin gcc.

The procedure:
  • Download the file from here.
  • Extract the file to any temporary folder.
  • Download the Cygwin setup file from http://www.cygwin.com/setup.exe.
  • Double click on "setup.exe".
  • If confirmation is asked, click "continue" and then click "next".
  • Check the "Install from Local Directory", then "next".
  • In "Root Directory" set the location of the Cygwin gcc installation. Recommended is "C:\Cygwin". Click "next".
  • In the "Local package Directory" set the directory of the folder you extracted. The name of the folder is "http%3a%2f%2fmirror.cs.vt.edu%2fpub%2fcygwin%2fcygwin%2f.7z". This actually is the original folder formed when the Cygwin package is downloaded from the internet.
  • This will automatically install the packages within it.
  • Click "Finish" when installation is complete.
  • You can now update the packages installed to get the latest benifits of the packages.
Setting the path for the compiler:
  • Right click on "My Computer".
  • Select "Properties".
  • The select "Advanced System settings".
  • Click on "Environment variables" at the bottom.
  • Select "Path" and click "Edit".
  • Add "C:\Cygwin\Bin”(or wherever you have located your Cygwin\bin folder) to the PATH variables list.
  • Make sure to separate it from the last path with a ";".
  • Click "Ok" and exit.

Installed packages:
  • The entire base package
  • In the development package:
  • binutils.
  • gcc core.
  • gcc g++.
  • gcc g77.
  • gcc mingw core.
  • gcc mingw g++.
  • gcc mingw g77.
  • gdb.
  • make.
  • mingw runtime.
These are the most important and sufficient packages to compile, run or debug C/C++ programs according to gcc standards.

NOTE:
This installed version of Cygwin gcc compiler can be used along with NetBeans or any other IDEs to compile programs.

Enjoy!

Wednesday, 30 September 2009

Installing Cygwin gcc in NetBeans

One of the best IDE for program or project development is NetBeans. The configurations of NetBeans for Java is much easier than C/C++. In this post I try to tell you how exactly do you install Netbeans and then configure it for use as a platform for C/C++ program development in Microsoft Windows OS. For C/C++ compiler I would use Cygwin gcc compiler.

Install NetBeans:
  • Download NetBeans from here according to your requirements.
  • Install it by double clicking on the .exe file downloaded.
Install the Cygwin gcc package:
  • Click on http://www.cygwin.com/setup.exe to download the setup file.
  • Double click on the setup file downloaded.
  • Click "Continue" in case confirmation appears.
  • Click on "Next".
  • The download has 3 options:
  • --"Install from internet (downloaded files will be kept for future reuse)".
  • --"Download without installing", simply downloads the files and you can install them later.
  • --"Install from Local Directory", in case you have the supporting files.
  • --Choose the appropriate option(recommended "Install from internet" assuming you have not downloaded the setup files) and click "next".
  • The "Root Directory" specifies the folder where the cygwin is to be installed. It is set to, "C:\cygwin", but you can change it according to your convenience.
  • Next it asks for "Local Package Directory", that is, where the files are to be stored. Choose any temporary folder.
  • Choose the connection type.
  • The package starts downloading.
  • This produces a list of download sites, choose the nearest location to get the maximum speed of download.
  • Next you get a list of packages which you can install, don't install the entire package, since they are not required.
  • According to NetBeans the following packages are to be installed:
  • --gcc-core - C compiler.
  • --gcc-g++ - C++ compiler.
  • --gdb - The GNU Debugger.
  • --make - the GNU version of the make utility.
  • To install click on the "refresh/default" button alongside the following packages:
  • --The "base" package. This is to install the total base package.
  • --In the "devel" package select only the following:
  • ----binutils
  • ----gcc core
  • ----gcc mingw core
  • ----gdb
  • ----make
  • ----mingw runtime
  • If there are certain default packages selected for installation do not uncheck them.
  • Click "Next". This will start downloading the packages.
  • After the packages are downloaded, click "Next" to install them.



Setting the path for the compiler:
  • Right click on "My Computer".
  • Select "Properties".
  • The select "Advanced System settings".
  • Click on "Environment variables" at the bottom.
  • Select "Path" and click "Edit".
  • Add "C:\Cygwin\Bin”(or wherever you have located your Cygwin\bin folder) to the PATH variables list.
  • Make sure to separate it from the last path with a ";".
  • Click "Ok" and exit.

That is all.

NOTE:
The Cygwin gcc compiler installed can be used with any other IDEs or such other software which support manual addition of C/C++ compilers.

Enjoy!

Saturday, 26 September 2009

Changing image size in blog posts

I had earlier tried to upload pictures from my laptop directly to the blogger page, http://zave-tech.blogspot.com/ using Blogger Uploader.

But there were a lot of disadvantages:
  • Irrespective of the size of the image uploaded, it always appeared with a pixel size of 400 X 250.
  • The image did not fill the width of the page, and was hence not very clear.
  • The image was actually reduced in quality to 400 X 250 pixels. So even if I tried to increase the dimensions, it only blured the image, rendering it unreadable.
  • The main image that I had uploaded would be stored in Picasa web album along with its compressed image as well.
  • Like the one given below is a 1280 X 800 image, but it appears like this without any change.

Hence I was bent on finding a solution to it. But I got options of using other photo sharing sites, which I did not want, because I love Picasa. So after trying out many things I got a way by which I could prevent blogger from compressing the image, and increase the dimension of the image according to my needs.

Steps:
  • Upload the image by clicking on the "Add image" button provided at the tool bar of the blogger post. Select the image from your computer and select the layout, in image size, choose "Large". Now click "Upload".
  • After you have uploaded the image using the standard blogger image uploader, go to the "Edit HTML" section of the "edit post".
  • Search the code of the image uploaded(generally found at the begining).
  • Now search for three things in the code:
  • --width: 400px; height: 250px;
  • --s400. This is written in the second image url under src="http:..." and before the image name, like "Vista+Desktop.jpeg"
  • Now replace the bold element "s400" with "s1600" to use the original image
  • The width and height depends on your use.
  • I prefer putting a "target="_blank"" after the a href="http:...", so that the image opens in a new page incase the user clicks on that.
  • One more advantage of this is that, only your original image is stored in Picasa web album and not the compressed one too.
  • The previous image is now displayed as below.

Enjoy!

Thursday, 24 September 2009

Advanced sharing in Windows Vista

In our college I face a lot of problem accessing the folders shared by someone using vista . The problem is that to access the shared file I am asked a user name and password. And I'm tired of telling each and everyone the process to remove it. This can be done in the following way.

To remove this and some other recommended settings:
  • Right click on the network icon and select "Network and Sharing Center".
  • Click on the down arrow beside the "Password protected sharing".
  • Check "Turn off password protected sharing". Click "Apply".
  • Turn off "Public folder sharing", "Printer sharing" and "Media sharing"(sharing by Windows Media Player), if they are not required, in the same way as the above step.
If while accessing the shared folder it still asks for a password, or the folders simply don't open, that means your "Guest" login is not enabled while sharing. In order to correct it (i.e. enable guest login):
  • Right click on the folder U want to share.
  • Choose properties & click on the sharing portion.
  • Click on the "Change sharing permissions" button.
  • You will get a list of user name on your OS or the name by which you are logged on. Above it there is a space for entering a new user.
  • Click on the arrow pointing down. Among a list of users click on the "Guest" or "Everyone" option and press the “Add” button.
  • If you do not want the others to change the content of your folder keep the rights of the guest as “Reader”, else you can change it according to your need.
In case the "Share..." button in the "Sharing properties" is not highlighted or non-clickable:
  • Click on the “Advanced Sharing” button.
  • Now, check the box for “Share this folder”.
  • Click on the "Permissions" button to set the permission of the sharing.
  • In case "Everyone" is not in the list of "Group or user names", click on "Add..." and add "Everyone" in the dialog box.
  • Click "OK".
  • In the "Permissions for Everyone" header check the box "Read" and not the others. This will provide only read facility to others, rather than give modify capabilities as well.
  • Select "Apply", then “Ok”.
Enjoy!