&
Advertise Here with Today.com
 

Archive for December, 2008

Dec 31 2008

Mounting a Windows (NTFS) partition

Published by dipinkrishna under Uncategorized Edit This

If you have a dual-boot Windows and Linux machine, you may find it helpful to mount the NTFS Windows partition from time to time. The Linux kernels, however, do not come with NTFS support enabled as a rule. This is probably a good thing since the read/write issue between ext3 (Linux) and ntfs (Windows) filesystems is not evident to all users. The following example demonstrates how to mount the ntfs Windows partition in read-only mode so you won’t corrupt the filesystem. What this allows you to copy over files from the Windows-side of the machine to the Linux side. Clearly helpful examples of such copying include: MS Word documents and PowerPoint files, music, pictures, etc.

The following example is not difficult to follow. There are only a few steps, but you will have to be logged in as root (su) to perform the necessary operations.

1. You need to figure out what kernel version you are currently running. From command line, type:
#> uname -r
2. Download the NTFS RPM from the Linux-NTFS project homepage (click here). We are running CentOS 4.x on our machines, which is equivalent to RedHat Enterprise Linux 4. You should have been taken to the appropriate download page. Based on what the ‘uname -r’ command (step 1) returned, select the appropriate version to download from the first block of files (under NTFS RPMs (*.rpm)).
3. You can either choose to download the RPM and then install it using #> rpm -ivh kernel-blah_blah_blah, or just select the ‘Install’ option in the Download Manager. (It worked for me.)
4. By installing the RPM, you have just added the ntfs module to the kernel. You need to insert the module now so run:
#> /sbin/modprobe ntfs
If you get a ‘FATAL’ message, you probably downloaded/installed the wrong version. Check your current kernel version again and go back to the download page (get the right one this time, stupid).
5. As an additional check, run: #> cat /proc/filesystems and make sure that ‘ntfs’ is listed.
6. Now it’s time to mount the drive! You need to do two things first, though, before we mount anything. First of all, you need to create a directory—or mount point—for the NTFS partition. So, do something like: #> mkdir /windows/C or whatever you’d like the mountpoint to be. Secondly, you need to figure out which partition has the NTFS volume on it. A good way to look at the list of partitions on a particular harddrive is to use the ‘fdisk’ utility. For instance, if your primary harddrive (the one with Windows and Linux OS) is /dev/hda then you would run: #> fdisk -l /dev/hda. You are looking for the partition that has HPFS/NTFS under the ‘System’ category. For this example, let’s say that it is /dev/hda2.
7. Yeah, now it’s time to mount it—in read-only mode—to the mountpoint that we created in the last step:
#> mount -t ntfs -r -o umask=0222 /dev/hda2 /windows/C
8. That’s it… go check it out and make sure you can see your data.

Advertise Here with Today.com

No responses yet

Dec 31 2008

Change GRUB Menu Timeout on Ubuntu

Published by dipinkrishna under ubuntu Edit This

When Ubuntu boots, grub gets loaded and will display the OS for only 5 sec, now if you want to increase this time or to decrease it.

Open up the /boot/grub/menu.lst file in your favorite text editor. you can use gedit:

sudo gedit /boot/grub/menu.lst

Now find the section that looks like this:

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

The timeout value is in seconds, specify the time you required. Save the file, and when you reboot you will have that many seconds to choose the menu item you want.

This is how my file looks

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         15

please note that the above text is only part of my menu.lst.

If you want grub to wait for you to take an action before continue, comment the timeout line, or erase it.

No responses yet

Dec 30 2008

Booting into a read-only environment

Published by dipinkrishna under Uncategorized Edit This

This situation presents itself infrequently, but when it does you cannot modify any files.
Here is an example of an occurrence…

A linux box wouldn’t boot properly and reported a problem with an ext2 filesystem on one of the partitions it was trying to mount.
The only option was to drop into a ‘repair shell’ to run e2fsck/fsck on the various partitions to see which one was having trouble.
As it so happens there were other problems that prompted this to happen: the only listings in /etc/fstab were for the cdrom and floppy drives.
Nothing else was being mounted, with the exception of the root partition / .It was impossible to mount filesystems or edit files (like /etc/fstab) in the read-only environment, but there is a way around it…

#> mount -o remount,rw /dev/hdb# / , where hdb# is the logical mount point of the root (/) partition. For instance, if your root partition (/) is actually /dev/hdb1 then hdb# is hdb1.

This mounts the root partition / as a read-write filesystem and by doing so you should be able to edit files and mount other filesystems…ugh!

One response so far

Dec 29 2008

Force fsck run during the next reboot

Published by dipinkrishna under Uncategorized Edit This

Here is a quick tip that will show how you can tell your Linux system to perform a fsck on its partitions on the next reboot. Normally this will happen by default, after some time as configured in the filesystem at creation time (or changed later): after a number of days or a number of filesystem mounts. If you are using ext3 filesystems you can check these intervals configured with:
tune2fs -l

Mount count: 5
Maximum mount count: 37

Last checked: Sat May 17 16:39:18 2008
Check interval: 15552000 (6 months)
Next check after: Thu Nov 13 15:39:18 2008

If for some reason, you want to force the system to run fsck on the next reboot just create an empty file called forcefsck in your system / like this:
touch /forcefsck
During the first reboot the system will run fsck and after completing this it will also remove the /forcefsck file from the system.

No responses yet

Dec 25 2008

Grub Options

Published by dipinkrishna under Uncategorized Edit This

The following example shows the structure of a GRUB menu file. The example installation has a Linux boot partition under /dev/sda5, a root partition under /dev/sda7, and a Windows installation under /dev/sda1.

gfxmenu (hd0,4)/boot/message
color white/blue black/light-gray
default 0
timeout 8

title linux
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda7 vga=791 resume=/dev/sda9
initrd /boot/initrd

title windows
rootnoverify (hd0,4)
chainloader(hd0,0)+1

The first block defines the configuration of the splash screen:

gfxmenu (hd0,4)/message
The background image message is located in the top directory of the /dev/sda5 partition.
color white/blue black/light-gray
Color scheme: white (foreground), blue (background), black (selection), and light gray (background of the selection). The color scheme has no effect on the splash screen, only on the customizable GRUB menu that you can access by exiting the splash screen with Esc.
default 0
The first menu entry title linux is the one to boot by default.
timeout 8
After eight seconds without any user input, GRUB automatically boots the default entry. To deactivate automatic boot, delete the timeout line. If you set timeout 0, GRUB boots the default entry immediately.

The second and largest block lists the various bootable operating systems. The sections for the individual operating systems are introduced by title.

* The first entry (title linux) is responsible for booting Linux. The kernel (vmlinuz) is located in the first logical partition (the boot partition) of the first hard disk. Kernel parameters, such as the root partition and VGA mode, are appended here. The root partition is specified according to the Linux naming convention (/dev/sda7/), because this information is read by the kernel and has nothing to do with GRUB. The initrd is also located in the first logical partition of the first harddisk.
* The second entry is responsible for loading Windows. Windows is booted from the first partition of the first hard disk (hd0,0). The command chainloader +1 causes GRUB to read and execute the first sector of the specified partition.

The menu file can be changed whenever necessary. GRUB then uses the modified settings during the next boot.

No responses yet

Dec 25 2008

Recovering Grub after installing Windows

Published by dipinkrishna under Uncategorized Edit This

I reinstalled my vista, i found that my ubuntu grub was lost..

These are the steps i took to get back my ubuntu grub..

1. Boot the Desktop/Live CD.

2. Open a terminal (Applications -> Accessories -> Terminal)

3. Start grub as root with the following command :

$ sudo grub

I got the output as

[ Minimal BASH-like line editing is supported. For

the first word, TAB lists possible command

completions. Anywhere else TAB lists the possible

completions of a device/filename. ]

grub>

5. Now type these :

grub> find /boot/grub/stage1

i got it as (hda0,10)

6. Use the information from the above to set the root device:

grub> root (hd0,10)

7. Now install the grub:

grub> setup (hd0)</strong>


8. Now quit


grub> quit

No responses yet

Dec 24 2008

Ruby on Rails

Published by dipinkrishna under Uncategorized Edit This

(Rails is a full-stack framework for developing database-backed web applications according to the Model-View-Control pattern. From the Ajax in the view, to the request and response in the controller, to the domain model wrapping the database, Rails gives you a pure-Ruby development environment. To go live, all you need to add is a database and a web server.)
http://radrails.org
(Aptana IDE + Rails is an environment for building Ruby on Rails applications.)
http://change.org
( Change.org is a social network for social activism, incorporating nonprofits, politicians, and people across the globe.)
http://www.ruby-lang.org
(A dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write.
The famous Hello World
program is trivial in Ruby.
puts “Hello World!”)
http://www.ruby-docs.org
http://www.manuals.rubyonrails.com
http://www.rubyonrails.com/screencasts
(for video tutorials)
http://www.wiki.rubyonrails.org/rails/pages/gettingstartedwithrails
(for introduction and installation )

http://www.macromates.com
(for text editor textmate)
http://www.tryruby.hobix.com
http://www.johnwlong.com
http://www.api.rubyonrails.com
http://www.hyperionreactor.net
http://www.wiki.rubyonrails.org/rails/pages
http://www.slash7.com
http://www.ar-versioned.rubyforge.org

Books
Pragmatic programmer :-the ruby book
Pragmatic programmer :-agile web development with rails
Speaker
Warren.noronha@gmail.com
Warren Noronha, Senior Consultant, Change.org. He is one of the early adopters of Ruby on Rails and other open source software and projects.
Sample applications
http://www.wiki.rubyonrails.org/rails/pages/opensourceprojects
Text editor
http://www.textdrive.com
Engine  yard
http://www.engineYard.com
Report
http://www.dev.rubyonrails.org/report/
Nginx load balancer
http://www.wiki.codemongers.com
http://www.wiki.rubyonrails.com
http://www.agilewebdevelopment.com/plugins

http://www.hasnoinfo
http://www.sporkmanager
http://www.bioruby.org/rdoc
http://www.raa.ruby-lang.org
Sites used for development
http://www.dev.rubyonrails.org
http://www.flickr.com/photos/factory/joe
http://www.openid.net
http://www.myopenid.com
http://www.livejournal.com
http://www.tadalist.com
http://www.backpackit.com/api
http://www.2checkout.com/documentation/usersguide2/third-party-carts
http://www.tomayko.com/articles/2004/12/12/rest-to-my-wife
http://www.script.aculo.us
http://www.gucci.com/us/index2.html
http://www.jabber.com
http://www.pipes.yahoo.com/pipes
http://www.netvibes.com
Igoogle
Microformats
http://www.microformats.org
http://www.microformats.org/wiki/hcard
http://www.factoryJoe.com
Hcard implementation
http://www.tantek.com/microformats/hcard-creator.html
Hcalander implementation
http://www.gmpg.org
http://www.aayush.name/blog
http://www.jasonwong.org
XFN 1.1 creator
http://www.gmpg.org/xfn/creator
Hatom creator
http://www.kpumuk.info
Yahoo pipes
http://www.ourcity.yahoo.co.in
http://www.developer.yahoo.com
http://www.wikimaps.com
http://www.digg.com
http://www.apidoc.digg.com
http://www.flicker.com/services/api/flicker.interestingness.getlist.html
Flickr services
http://www.flicker.com/services/api/flickr.tags.getrelated.html
http://www.code.google.com
http://www.developer.yahoo.com
Cmaps
http://www.cmap.ihmc.us
Yarv
http://www.atdot.net/yarv

interative Ruby shell see http://tryruby.hobix.com

13th place in the Tiobe index(see http://www.tiobe.com/tpci.htm

No responses yet

Dec 23 2008

List empty directories using the command ‘find’

Published by dipinkrishna under Uncategorized Edit This

This is what i tried to list all empty directories :

~$ find . -type d -empty

and this is what i got

./.config/transmission/torrents
./.config/transmission/blocklists
./.config/transmission/resume
./.gnome2/eog
./.gnome2/panel2.d/default/launchers
./.gnome2/file-roller
./.update-notifier
./.dosemu/drive_c/tmp
./Templates
./.themes
./.kde/share/mimelnk
./.kde/share/servicetypes
./.kde/share/apps/amarok/albumcovers/cache
./.kde/share/apps/amarok/undo
./.kde/share/apps/konqueror
./.kde/share/applnk
./.kde/share/services
./.gimp-2.6/tmp
./.gimp-2.6/gfig
./.gimp-2.6/scripts
./.gimp-2.6/plug-ins
./.gimp-2.6/gimpressionist
./.gimp-2.6/tool-options
./.gimp-2.6/curves
./.gimp-2.6/themes
./.gimp-2.6/fonts
./.gimp-2.6/levels
./.gimp-2.6/interpreters
./.gimp-2.6/templates
./.gimp-2.6/modules
./.gimp-2.6/gflare
./.gimp-2.6/brushes
./.gimp-2.6/fractalexplorer
./.gimp-2.6/environ
./.gimp-2.6/patterns
./.gimp-2.6/palettes
./.gimp-2.6/gradients
./.icons
./.adobe/Flash_Player/AssetCache/K2USXEKE
./Public
./Videos
./Pictures
./.gvfs
./Documents/My Music
./Documents/KMPlayer/PlayList
./Documents/KMPlayer/Logo
./Documents/KMPlayer/Capture
./Documents/My Videos
./Documents/My Pictures
./.gegl-0.0/swap
./.amaya/5
./.amaya/libwww-cache
./.amaya/3
./.amaya/7
./.amaya/13
./.amaya/11
./.amaya/17
./.amaya/0
./.amaya/6
./.amaya/18
./.amaya/10
./.amaya/15
./.amaya/19
./.amaya/9
./.amaya/1
./.amaya/12
./.amaya/8
./.amaya/annotations
./.amaya/2
./.amaya/16
./.amaya/14
./.amaya/4
./.java/deployment/tmp/si
./.emerald/themes
./Music
./.gnome2_private
./shovell/tmp/sockets
./shovell/tmp/pids
./shovell/tmp/sessions
./shovell/tmp/cache
./.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
./.mozilla/firefox/vkuuxfit.default/extensions
./.gem/ruby/1.8/specifications
./.gem/ruby/1.8/gems
./.gem/ruby/1.8/doc
./.gem/ruby/1.8/cache

A long list….hmm..

No responses yet

Dec 23 2008

Change the background color during startup

Published by dipinkrishna under Uncategorized Edit This

Originally a brownish color to match the Ubuntu theme, it does not quite fit with other themes and might want to be changed. Enter the gdm.conf file (sudo gedit /etc/gdm/gdm.conf). About two-thirds of the way down you will see the lines:

BackgroundColor=#dab082
GraphicalThemedColor=#dab082

Change it to what you like. For all black, use:

BackgroundColor=#000000
GraphicalThemedColor=#000000

No responses yet

Dec 21 2008

OpenOffice 3.0 on Ubuntu Intrepid Ibex

Published by dipinkrishna under Uncategorized Edit This

These last few days we are enjoying the latest of many products among which I would highlight the new Ubuntu Intrepid Ibex and the new OpenOffice 3.0.

Surely you would like to enjoy these two developments working in cojunto, this should add to the list of your new Ubuntu repositories of OpenOffice.

To add repositories are going to System -> Administration -> Origins of the software -> Third-party software and add the following lines:

deb http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main
deb-src http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main
Another serious option from the terminal with the following commands:

sudo gedit / etc / apt / sources.list and add at the end of the document to be opened to us:
deb http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main
deb-src http://ppa.launchpad.net/openoffice-pkgs/ubuntu intrepid main

No responses yet

Next »

Advertise Here