Wednesday, November 11, 2009

Fix the Monitor from xorg.conf

Share Orkut

Most Linux distros have some sort of control centres from where we can change display settings and make it optimum for our monitors or graphics cards. Sadly sometimes we come across a distro which doesn't support the resolutions native to our card or monitor, in such cases we can directly modify the 'xorg.conf' file which is responsible for the changes in the display.

Before you proceed, back up your old 'xorg.conf'

$sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup

Now, open up 'xorg.conf' in any text editor you have, I'll use gedit for this example.

$sudo gedit /etc/X11/xorg.conf

Here's an example xorg.conf file from my machine, only the section corresponding to the monitor is shown


Section "Monitor"
Identifier "0-CRT1"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
Option "PreferredMode" "1280x1024"
Option "TargetRefresh" "60"
Option "Position" "0 0"
Option "Rotate" "normal"
Option "Disable" "false"
EndSection

Take care before you change any value, its very tempting to try a high resolution, but it might damage your monitor permanently, so always get the specs right from the manufacturers before you change any value.

Tuesday, November 10, 2009

FGLRX driver problem in Ubuntu

Share Orkut

After successfully in getting my ATI/AMD FGLRX drivers on Ubuntu 9.10, I'm finally loving the visual effects.

Earlier whenever I tried to install the drivers from, System>>Administration>>Hardware drivers; the installation of the driver would be successful, but my screen would keep flickering, as if it were some CRT screen being disturbed by radio frequencies.

I decided to try and install the FGLRX drivers one last time, I encountered the usual flickering which, not surprising now, vanished when I changed the refresh rate, from the default 75Hz to 50Hz.

So if any of you are facing flickering after you have installed your drivers and rebooted, try fiddlng with the refresh rate.

Another workaround that has worked for a few Nvidia Cards is to disable Compiz, from System>>Prefrences>>Appearence and in the Visual Effects, select the 'None' option. A restart will resolve this problem.

The last solution I have found to this after scourging the net for hours is to edit the 'xorg.conf'in '/etc/X11/xorg.conf'; which I will be posting later.

Tuesday, November 3, 2009

Microsoft Windows user authentication, is it a Joke ?

Share Orkut

A Microsoft Windows computer cannot be called 'secure' in the least bit, at least as far as the user authentication is concerned. I'll tell you how this is true.

  • Boot your computer with any live CD / DVD that supports mounting a NTFS drive (preferably live CDs of any Linux) .
  • Proceed with mounting the Windows root drive from your live CD session and navigate to the "%WINDIR%\System32" folder.
  • Here, create a backup copy of 'utilman.exe' by renaming it as 'utilman.exe.bak' and rename 'cmd.exe' to 'Utilman.exe'.
  • Now restart the computer and boot the Windows OS, when you are at the login screen you have to invoke the Utility manager by pressing 'Ctrl+U'; but instead of the utility manager in this case you are presented with a 'no holds barred' command prompt, with SYSTEM privileges.

And that is how your lil bro can pwn Windows.
Surely a brand of operating systems thats almost getting its seventh version out must do something about this scenario, considering that it is a major player in the business.


EDIT: LOL ... even windows 7 is not secure against this; and this works even if 'cmd.exe' replaces other applications like the onscreen-keyboard(osk.exe), which are accessible from the login screen; you just have to follow the procedure to start whatever 'exe' you replaced with 'cmd.exe', to be able to access the prompt.

I'm trying to come with a workaround to this problem, been tinkering with the registry. I'll post the solution as soon as possible.

Sunday, October 18, 2009

VI Improved - Tutorial

Share Orkut

How many people using unix like system do you think, have atleast a basic knowledge of using one of the most powerful editors of the platform? There are many who don't like to use VIM, purely due to its 'UN-GUI'ishness; they tend to go in for other simple to use and comparatively less geeky alternatives like 'nano'. What will you do when you are faced with a scnerio where there are no options other than using it ?

This tutorial aims to let you understand the extremely basic stuff you should know about VIM; bewarned that this is not even worthy of being mentioned as the 'Tip of the Iceberg'. VIM is an extensive tool which might take months to master.

To start VIM & open a file, say 'new.txt'; we type the following at the terminal,

'vim new.txt'

now you will see the contents of the file new.txt on your screen, at the last line will be written, "new.txt" 9L, 45C; this means that the filename is "new.txt" having 9 lines of data & size 45bytes (1 char {C}= 1 byte). This mode is called normal mode or command mode.

Now you want to edit the file, go to the character from where you would like to 'insert' text and press either 'a' or 'i'. If you press 'a' the cursor will advance 1 character forward and start inserting and if you type 'i' the cursor will start inserting at the current position. This mode when you insert data or text is called as 'insert' mode, to come out of the insert mode to the command mode, press 'Esc' key.

If you wish to delete some text then follow the same steps for editing to enter the 'insert' mode and use 'Backspace' key to delete charecters, again using 'Esc' key to exit the 'insert' mode and enter the 'command' mode.

Now that you have edited the file, you have to options; either save the changes done to the file or discard the changes and quit VIM.

To save a file type ':wq' in the 'command mode', (Note: - ':wq' will not work in the insert mode), if you want to save the file with another name use ':W FILENAME' in the 'command' mode, but in this option VIM will save the file with the name you specified and continue to edit the old file, and another command is ':saveas FILENAME' which is the same as ':w FILENAME' but it will now edit the new file after saving.

To quit the VIM editor use the command ':q', which is only allowed if the file has not been modified. If you wish to discard the changes and quit type ':q!'.

These are just 'dirt basic' that you need to know if you are going to use a Unix machine, VIM is too extensive to be covered in a few blog posts. Hope it helps even if its a bit. If you have any queries, feel free to post them as comments and I will surely try to clarify them.

Saturday, October 17, 2009

pppoe configuration in Ubuntu Linux

Share Orkut

Yesterday after getting irritated with the '$ sudo pon dsl-provider' command for my pppoe connection, I decided to shorten the length or atleast make it simpler, something like '$ sudo pon bsnl' or simply '$ sudo pon'.

According to the MAN pages on pon it requires a parameter to specify the provider which has to be dialed, on absence of provider it executes the file '/etc/ppp/pppoe_on_boot', if it is existing and executable.

Again on lack of arguments to the '$ sudo pon' and absense of the '/etc/ppp/pppoe_on_boot' file (which is created when you specify that the connection be automatically dialed up at startup), in such a case the '/etc/ppp/peers/provider' file is executed' which is often the cause of error to most people.

If you have a look at the file '/etc/ppp/peers/dsl-provider' you'll realise that copying the contents to a new file will enable you to use a command such as '$ sudo pon isp'

Steps for '$ sudo pon isp' - Run the following commands in a terminal:
  • $ sudo cp /etc/ppp/peers/dsl-provider /etc/ppp/peers/dsl-provider.bak (optional)
  • $ sudo cp /etc/ppp/peers/dsl-provider /etc/ppp/peers/isp
Now a command like '$ sudo pon isp' will dial your pppoe connection.

Steps for '$ sudo pon' - Run the following commands in a terminal:
  • $ sudo cp /etc/ppp/ppp_on_boot /etc/ppp/ppp_on_boot.bak
  • $ sudo cp /etc/ppp/peers/dsl-provider /etc/ppp/ppp_on_boot
Now a command like '$ sudo pon' is sufficient for conecting to the internet.