Monday, June 30, 2008

useful basic shell commands

clear : clear the terminal window, and put the cursor on top of the window

date: displays current date and time
dmesg: shows the kernel error messages

eject: eject a CD/DVD

exit: log out of a current user account being accessed at the command line(if issued within a terminal window) the window will close.

file: display useful information about the specified file
ex:- file myfile.txt

free: display information about the memory usage; add -m option to see o/p in megabytes
ex: show free RAM: free -m

halt: shut down the computer(needs to be run as the root)


help: shows a list of commonly used bash commands

last: show recent system logins

pwd: present working directory

reboot: reboot the computer(needs to be run as root)

shred: destroy the specified file beyond recovery by over writing it with junk data

touch: give the specified files date and time; if the specified file does n't exists
then create an empty file.the filename should be specified immediately afterwards

uptime: display how long the computer has been booted ,plus various cpu usage statistics

whatis: display a one-line summary of the specified command; the command name should follow immediately afterward

http://www.linuxcommand.org/

Sunday, June 29, 2008

The shebang line



The majority of shell scripts use shebang line (#!) at the beginning to control the type of the shellused to run the script;this bang line calls for an incantation of the bash:

#!/bin/sh

using a shebang line is common practice for all shell scripting.

ex:- if you want to write a shell script using bash,but want the script to execute as if run by the bourne shell sh,the first line of your script will contain #!/bin/sh, which is a link to the bash shell


the shebang line is a magic number, as defined in /usr/share/magic, a text database of magic numbers for the linux file command. magic numbers are used by many different linux commands to quickly identify the type of a file

see:- man 5 magic

linux usenet groups



alt.os.linux.dial-up using ppp for dial-up
alt.os.linux.mandriva
alt.os.linux.slackware
alt.os.linux.ubuntu
comp.os.linux.advocacy
comp.os.linux.alpha using linux on alpha cpu
comp.os.linux.announce general linux announcements
comp.os.linux.answers releases of new linux FAQS & other information
comp.os.linux.development.apps using linux development tools
comp.os.linux.development.system building the linux kernel
comp.os.linux.embedded linux ewmbedded device development
comp.os.linux.hardware configuring linux for various hardware devices
comp.os.linux.m68k linux on motorola's 68-k family cpu's
comp.os.linux.misc
comp.os.linux.networking
comp.os.linux.portable using linux on laptops
comp.os.linux.powerpc
comp.os.linux.security
comp.os.linux.setup linux installation topics
comp.os.linux.x linux and x - window system
comp.windows.x.apps using X-based clients
comp.windows.x.i386unix x for unix pc's
comp.windows.x.intrinsics x toolkit library topics
comp.windows.x.kde using kde and x discussions
comp.windows.x.motif all about motif programming
comp.windows.x
linux.admin.*
linux.debian.*
linux.dev.*
linux.help get help with linux
linux.kernel

wget command for file transfers

wget command is used for file transfers using ftp,http,https and hftp if a remote proxy is enabled.

wget can be used to download files as a background process and to recursively replicate remote directories. the command also supports download completion of partially downloaded files, which can save a lot of time during periods of intermittent connectivity or broken connections.

ex:- wget ftp://phudson:mypasswd@stinky/mp3/*

In this example, the user retrieves all files in a directory named mp3 on the remote host named stinky. the wget command will first retrieve a directory listing , then proceed to download the specified files. note that you can specify username and password on the command. this generally is not a good idea.. a better, but still not secure, approach is to save the password in a file named .wgetrc in your home directory.


another popular use of wget is downloading complete copies of websites for offline reading.to download an entire site, you need to specify the --mirror, --convert-links, and -p parameters,followed by the url of the site to download. the first parameter tells wget to download all the pages and pictures from the site, following links it can. the second tells it to rewrite the html so that it works when browsed locally. the last parameter -p tells wget to download all the files referenced in the html, such as sounds, css files,and other related documents. you might also want to specify the w parameter, which allows you to specify a number of seconds b/w individual wget requests; this stops your download from overloading the web server

ex:- wget -mirror --convert-links p w 2 http://www.example.com

see:-
http://www.gnu.org/software/wget/manual/wget.html
man wget

Saturday, June 28, 2008

gqlplus

What is gqlplus?

gqlplus is a drop-in replacement for sqlplus, an Oracle SQL client, for UNIX and UNIX-like platforms. The difference between gqlplus and sqlplus is command-line editing and history, plus table-name and column-name completion. As you know if you have used sqlplus, it is notoriously difficult to correct typing errors and other mistakes in your SQL statements. sqlplus does give you ability to use external editor to edit a statement, but only the last statement you typed. gqlplus solves this problem by providing the familiar command-line editing and history as in tcsh or bash shells, and table/column-name completion, while otherwise retaining compatibility with sqlplus. Thus, no user training is needed - simply use gqlplus instead of sqlplus. In addition, configuration/installation is trivial: gqlplus is a single binary compiled executable (written in C), so all you need to do is download it and put it anywhere in your PATH. After that, you'll be ready to use it.

see:-http://gqlplus.sourceforge.net/

what do you mean by loop device ?

A loop device is a pseudo-device that makes a file accessible as a block device. Loop devices are often used for CD ISO images and floppy disc images. Mounting a file containing a filesystem via such a loop mount makes the files within that filesystem accessible. They appear in the mount point directory using above commands.

see:-http://en.wikipedia.org/wiki/Loop_device

Sunday, June 22, 2008

services

sulekha

i recently downloaded a command line utility named sysv-rc-conf for enabling/disabling services in different runlevels.This utility is showing far more services than shown by system -> administration -> services GUI tool. now i am able to see many services such as brltty, loopback, rmnologin,dbus festival .....

now my question is as follows

what are the following services and what do they signify??

1)loopback
2)rmnologin
3)mtab
4)hotkey-se
5)module-in
6)mountvirt
7) urandom
8)brltty
9)festival

vor

I would imagine all these things have brief comments at the top of their respective init files. Look in /etc/init.d/name_of_thing and check the top of the file.


tinivole

* loopback is to do with associating filesystems on your computer as files (ie: /dev/sda1), at least I think.

* rmnologin = Remote No Login (or remote login is disabled... I think).
* mtab is the daemon that holds the complete list of mounted filesystems on your PC (including virtual filesystems such as tmpfs and gvfs filesystems).

* not sure about hotkey-se... Although the word "HOTKEY" itself says alot about it.
* module-in I think is self explanitory (Hint: /etc/modules)
* mountvirt handles your virtual filesystems (such as tmpfs and gvfs)
* urandom is the greatest tool in existance! (type in "echo $RANDOM" and you'll find out why)
* brltty is a display driver.

* festival is the Linux version of "Microsoft Sam", is it not? (Probably the only one in the list that is worth turning off without thinking about the consequences).

p_quarles

Festival is a speech synthesizer. I've never seen it enabled by default, but if you have fiddled with the accessibility features it all, that could explain why it is there on startup.

It is not essential for system operation unless, I suppose, for a user with vision difficulties.


anonymous

hotkey-se(tup) is for your hotkeys, such as Function+FX for suspend. If you're not on a laptop or don't use them you probably don't care.

urandom is a source of randomness that many programs use. don't stop it.

rmnologin allows you to log in once the system has booted far enough.

Saturday, June 21, 2008

How do you list services in /etc/init.d and if they are running?

sam lars

I'm looking for something like the services.msc in Windows, where I could view everything in /etc/init.d and see if it's running or stopped. At the very least, is there a command that can find if one of those programs is started or not?

vmc

If you open a terminal and use the 'top' command.
What that be what your looking for?

sysv-rc-conf

see:- http://ubuntuforums.org/showthread.php?t=89491

Enable concurrent booting (Ubuntu)



Concurrent booting takes advantage of dual-core processors and CPUs that feature hyperthreading. To set this up, edit the “rc” file in the /etc/init.d directory:

sudo mousepad /etc/init.d/rc

Find the line that says CONCURRENCY=none and change it to:

CONCURRENCY=shell

Save the file.

There are many more Ubuntu tweaks out there. I’ve included links to the source of most of the information here. Many of the articles below include other tweaks that seemed a bit too risky to try. Always exercise caution when editing configuration files.


warning:- untested

i386 or i686 (ubuntu)

sulekha

I have a got p4 machine at office so what ubuntu iso image should i use i386 or i686 for making an install C.D ????


vmelkon

686, Everything after the original Pentium and K5 is considered a 686


indygunfreak

If I recall, Ubuntu doesn't have 686 isos, it has x86 isos. Are you confusing ubuntu isos with possibly mandriva or suse?

i386 will be the best for most users.

core files

sulekha


recently i read in a book delete all core files with rm because they are a waste of space.
when i searched for core files as follows:-

find / -name core

find: /etc/lvm/archive: Permission denied
find: /etc/lvm/backup: Permission denied
find: /etc/ssl/private: Permission denied
find: /etc/cups/ssl: Permission denied
find: /etc/firestarter/inbound: Permission denied
find: /etc/firestarter/outbound: Permission denied
find: /var/lib/cups/certs: Permission denied
find: /var/lib/gdm: Permission denied
find: /var/lib/slocate: Permission denied
find: /var/lib/fetchmail: Permission denied
find: /var/cache/setup-tool-backends/debug: Permission denied
find: /var/cache/setup-tool-backends/backup: Permission denied
find: /var/lock/lvm: Permission denied
find: /var/log/squid: Permission denied
find: /var/run/sudo: Permission denied
find: /var/spool/cron/crontabs: Permission denied


macemoneta


Quote:
there is quite a large no: of core files,from this listing how will i know which are the files to be deleted??? I don't think all these files are created as a result of program crash.

First, there were only 12 'core' files. None of them were files you should delete. Most distributions these days disable the creation of core files so there shouldn't be any unless you specifically enable them.

code

$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 8185
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
max rt priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 8185
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


If you want to search the entire system, you need to do that as root. That's why you received the "permission denied" messages; as a user you don't have access to those directories.

wjevans_71

Actually, there isn't much evidence of core files there.

The "permission denied" messages are telling you that you don't have the rights to look in the named directory to check for core files or for anything else. Run the find command as root, and you'll get rid of these messages.

The other lines are most likely special case files which are not core dumps, and should be left alone.

jerrill

From what I understand a core dump happens when the kernel has a significant fault, usually causing the computer to crash. When you reboot, the file would be in your home directory.


bouncer

Quote:
From what I understand a core dump happens when the kernel has a significant fault, usually causing the computer to crash. When you reboot, the file would be in your home directory.
Any app can create a core file when it crashes.

Using (s)locate is faster than find, provided that you have upgraded your (s)locate database (updatedb as root, locate as regular user):
Code:

updatedb

then find
Code:

locate core

anyway like said, you should not have core files there.

As a sidenote, when posting, don't post that excessive outputs. If you need to post an output from some program, cut it and paste only the important parts (we don't need those lines that say you don't have permissions into some directory in this case).



sulekha

I searched for core files in my home directory. i didn't find any.

can any one give features/properties of core files so that i can quickly find them using find command.??

macemoneta

They are named 'core'. If they are from an application that you ran, they will be in your home directory. Did you run the ulimit command above? Are core files even enabled on your system?


wjevans_71

Quoth jerril:
Quote:
From what I understand a core dump happens when the kernel has a significant fault, usually causing the computer to crash.
A core dump (in the current context) happens when the kernel has found a significant fault in a running program, always causing the program to stop running. The system as a whole keeps running merrily.

And.

Quoth jerril:
Quote:
the file would be in your home directory
Quoth macemoneta:
Quote:
If they are from an application that you ran, they will be in your home directory.


No, guys. When an application dies and leaves a core file, it is in whatever directory was the process's current directory when the application died, which is usually the process's current directory when the application started, but not necessarily the user's home directory.

macemoneta

Unless a user is root, the home directory and /tmp are the only directories that a user (normally) has write access to. A core file will not be created in a directory that the user process cannot write to.


wjevans_71

Quoth the highly esteemed macemoneta:
Quote:
A core file will not be created in a directory that the user process cannot write to.
Quite correct, as far as it goes. But the following is a bit shy of the mark:
Quote:
Unless a user is root, the home directory and /tmp are the only directories that a user (normally) has write access to.

Most developers I know, and most others I know who are not developers, will not keep their files directly in their home directories, but will create subdirectories so their files are a bit more organized. This provides far more directories than the two you mentioned. If any one of them is the current working directory, that is where any core file will go.



jiliagre


Quote:
Originally Posted by macemoneta
Unless a user is root, the home directory and /tmp are the only directories that a user (normally) has write access to.
Actually quite a few more can be found under /var (/var/tmp, /var/preserve, /var/mail, /var/spool/.../, ...)
Quote:
A core file will not be created in a directory that the user process cannot write to.
Correct. However don't forget a process may have higher privileges that the user who launched it if its suid and/or sgid bits are set. The user won't be able to remove a core file created under that situation though.

command line CD writing in ubuntu

"how to" on CD writing in command mode (ubuntu specific)?


Burning a CD or DVD using Command Line tools

This section details the use of the command line(terminal) to burn either a CD or DVD disk.

Creating an ISO image

A command called mkisofs can make an .ISO image to be burned or mounted.

*

mkisofs -r -J -o cd_image.iso /directory

The -r and -J ensures long file names work for Unix (using Rock Ridge) and Windows (using Joliet extensions) respectively.

Checking CD Images Before Burning

It's possible to check CD images before burning. The easiest way is to simply double-click on it from the file browser, which will load the image into Archive Manage (file-roller).

* If you have sudo access, you can also mount the image, and explore its contents {{{sudo modprobe loop

sudo mount -t iso9660 -o ro,loop=/dev/loop0 cd_image.iso /media/cdrom }}}

* Remember to unmount an image after checking:

sudo umount /media/cdrom

Burning a CD on the Command Line with cdrecord

cdrecord can burn an ISO(.iso) disk image or other data onto a CD. To burn a data CD (using image prepared earlier):

*

cdrecord dev=/dev/cdrom driveropts=burnfree -v -data cd_image.iso

To burn an audio cd from wav files:

cdrecord dev=/dev/cdrom driveropts=burnfree -v -audio [wav files...]

Replace /dev/cdrom as needed if this is not your CD-Writer

-v (verbose) lets you track the recording progress

driveropts=burnfree helps reduce the risk of a buffer under-run (most drives should support this)

Blanking a CD/RW

To reuse a rewritable CD or DVD you first need to 'blank' the disk. This erases the old data and prepares the disk for new data.

*cdrecord -vv dev=1,0 blank=all
cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force

see http://lists.debian.org/cdwrite/2004/10/msg00031.html

Using cdrecord on "unsupported" drives

Sometimes Ubuntu fails to detect and configure your Burner. This results in "no media found" if you use 'cdrecord dev=/dev/cdrom'. Even 'cdrecord -scanbus' does not work - so you just don't know, how to address the drive. You can work around this by looking into the boot messages with dmesg, to identify the devicepath to your burner. F.e.

*

$ dmesg
hda: PIONEER DVD RW DVR-108, ATAPI CD/DVD-ROM drive
hdb: IDE DVD-ROM 16X, ATAPI CD/DVD-ROM drive
[...]
hda: ATAPI 40X DVD-ROM DVD-R CD-R/RW drive, 2000kB Cache

Ok so we know, it is hda. Now you can burn on this drive using:

cdrecord dev=ATAPI:/dev/hda -data -v -eject your_data.iso

Burning a DVD or Blu-Ray Disc

*

Install the dvd+rw-tools package. See [InstallingSoftware].
*

Use the packages growisofs application to burn a DVD or Blu-Ray disc.

growisofs -Z /dev/scd0 -R -J /some/files

growisofs -speed=2 -dvd-compat -Z /dev/dvd=dvd_image.iso

Add additional sessions by using

*

growisofs -M /dev/dvdwriter additionaldata

Blanking DVD+RW discs

dvd+rw-format -blank /dev/cdrw


see:-

https://help.ubuntu.com/community/CdDvdBurning
https://help.ubuntu.com/community/CdDvd/Burning#Burning%20a%20CD%20or%20DVD%20using%20Command%20Line%20tools

Free up more memory (ubuntu)

we’re going to free up RAM by disabling some virtual consoles that use up memory—even though most people never use them. To do that, we need to edit the inittab file in the etc directory. In the terminal, type:

sudo gedit /etc/inittab

This will again call up the text editor, this time with inittab loaded.

Scroll down until you find the six lines that begin with:

1:2345:respawn:/sbin/getty 38400 tty1



N.B:- tested on dapper
see:- http://www.chinwong.com/index.php/site/article/ubuntu_speed_up_tips/

Get faster menus in ubuntu

Launch a new document in Mousepad and past this line into it:

gtk-menu-popup-delay = 0

Save the file in your home directory (the one that bears your name) under this name:

.gtkrc-2.0
The dot in front of the file name indicates that this is a hidden file. The next time you log in, the menus should be more responsive.


N.B:-Tested on dapper


see:- http://www.chinwong.com/index.php/site/article/ubuntu_speed_up_tips/

Friday, June 20, 2008

ubuntu quick reference






























apt-cache search

case insensitive search of the package database for the keyword given. the package names and descriptions are returned where that keyword is found


apt-cache stats

print statistics on all packages installed


apt-cache depends

print dependencies for a package,whether it is installed or not

Ex: apt-cache depends wine





apt-cache pkgnames

lists all packages installed on the system


apt-cache show

display the information about the software from the named package

Ex: apt-cache show wine



apt-get -d insttall

download the package only, placing it in /var/cache/apt/archives


apt-get autoclean

can be run any time to delete partially downloaded packages or packages no longer installed


apt-get clean

removes all the cached packages from /var/cache/apt/archives to free up disk space


apt-get --purge remove

remove the named package and all its configuration files remove --purge keyword to keep config files


apt-config -v

print version information of installed APT utilities


apt-key list

Lists gpg keys that APT knows about



















1. Prefix commands with sudo to run.
Ubuntu is a trademark of Canonical Ltd. Licensed under CC-BY-SA 3.0. Free to redistribute;
see creativecommons.org for details.

Changing the default editor in ubuntu

Ubuntu comes with a number of defaults that may or may not be to your liking. For example, the default editor is set to Nano, which isn't optimal if you're used to Vim.

The easy way to change this is to use the update-alternatives program, which maintains the symbolic links under /etc/alternatives that determine the default programs for FTP, system editor, rsh, Telnet, window manager, and so forth. Look under the /etc/alternatives directory to see what programs are managed.

To change the default editor, run sudo update-alternatives --config editor. You'll see a dialog like this:

There are 3 alternatives which provide `editor'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/vim
2 /bin/ed
*+ 3 /bin/nano

Press enter to keep the default[*], or type selection number:

Just type 1 to switch to Vim. Note that on my system, I don't have Emacs or many other editors installed; if I did, the utility

hardware support for ubuntu

see:-
https://wiki.ubuntu.com/HardwareSupport
http://www.linux.org/hardware
http://www.gphoto.org

Tuesday, June 17, 2008

Add the Trash Can Icon to Your Ubuntu Desktop



Ubuntu has an option for adding a Trash Can icon to the desktop, which might be a comfort for those of you migrating from Windows.

Just type gconf-editor into the Alt+F2 run dialog to open the Gnome Configuration Editor.

Now browse down to the following key:

apps \ nautilus \ desktop

On the right hand side, you'll see an entry called trash_icon_visible. Just check the box. You can also change the trash_icon_name if you'd like.


see:-http://www.howtogeek.com/howto/ubuntu/

Reinstall Ubuntu Grub Bootloader After Windows Wipes it Out

If you run a dual-boot system with Linux and Windows, this has happened to you. You had to do your monthly reinstall of Windows, and now you don't see the linux bootloader anymore, so you can't boot into Ubuntu or whatever flavor of linux you prefer.

Here's the quick and easy way to re-enable Grub.

1) Boot off the LiveCD

2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub "prompt", and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub

> root (hd0,0)

> setup (hd0)

> exit

Reboot (removing the livecd), and your boot menu should be back.



Only read below if Windows is now missing from the boot menu

If you installed Ubuntu before you installed Windows, then Ubuntu will not have anything in the grub configuration for Windows. This is where you'll have to do a bit of manual editing to the grub boot menu file.

If you open the file /boot/grub/menu.lst with the following command:

sudo gedit /boot/grub/menu.lst

You'll see a sample section for Windows, which you'll want to uncomment and add to the boot menu list in whatever position you want it in. (uncomment by removing the #'s)

# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3)

see:-http://www.howtogeek.com/howto/ubuntu/

Linux QuickTip: Downloading and Un-tarring in One Step

Most of the time, when I download something it's a file archive of some kind - usually a tarball or a zip file. This could be some source code for an app that isn't included in Gentoo's Portage tree, some documentation for an internal corporate app, or even something as mundane as a new WordPress installation.

The traditional way of downloading and untarring something in the terminal would be something like this:

wget http://wordpress.org/latest.tar.gz

tar xvzf latest.tar.gz

rm latest.tar.gz

Or perhaps the more compact form:

wget http://wordpress.org/latest.tar.gz && tar xvzf latest.tar.gz && rm latest.tar.gz

Either way is a bit clumsy. This is a very simple operation, a powerful shell like bash should allow such a task to be performed in a more "slick" manner.

Well, thanks to a useful little command "curl", we can actually accomplish the mess above in just one piped statement:

curl http://wordpress.org/latest.tar.gz | tar xvz

No temporary files to get rid of, no messing around with ampersands. In short, a highly compact, efficient command. In fact, from a theoretical standpoint, the curl method can be faster than the concatenated wget/tar/rm mess since stdout piping will use RAM as a buffer if possible, whereas wget and tar (with the -f switch) must read/write directly from a disk.

Incidentally, tar with the -v option (the way we're using it in all the above examples) prints each file name to stdout as each is untarred. This can get in the way of curl's nice, ncurses output showing download status. We can silence tar by invoking it without -v thusly:

curl http://wordpress.org/latest.tar.gz | tar xz

see:-http://www.howtogeek.com/howto/ubuntu/

Display Number of Processors on Linux



If you've just upgraded your Linux box, or you are wondering how many processors a remote server has, there's a quick and dirty command you can use to display the number of processors.

On Linux, /proc/cpuinfo contains all of the processor information for all current processors in your computer. This will include the speed, the amount of on-chip cache, processor type, and how many cores.

Here's the command:

cat /proc/cpuinfo | grep processor | wc -l

The command just looks in the /proc/cpuinfo file, pulls out the number of lines containing the word "processor" and passes them into wc (word count), which returns a count of the CPUs in the system.

Here's what it returned on my remote server:

[root@root]# cat /proc/cpuinfo | grep processor | wc -l

4

Note that if you have a dual-core processor, it will return each core as a separate processor. You can look at the full output of cat /proc/cpuinfo to see if the chips are dual-core.

http://www.howtogeek.com/howto/ubuntu/

How to use an ISO image on Ubuntu Linux



Like anything else on linux, it's easiest to do things from the command line. Open up a terminal window and type in the following commands

sudo mkdir /media/iso

sudo modprobe loop

sudo mount filename.iso /media/iso -t iso9660 -o loop

You should be able to navigate to the /media/iso folder and see the contents of the ISO image. If you want to unmount the iso, use the following command:

sudo umount /media/iso

Stay tuned, we'll post a howto about using these ISO images from within the GUI.


see:-http://www.howtogeek.com/howto/ubuntu/

See Where a Package is Installed on Ubuntu

Once you use the apt-get utility to install a package, sometimes it seems to disappear into nowhere. You know it's installed, you just have no idea where.

If you know the name of the executable, you can use the which command to find the location of the binary, but that doesn't give you information on where the supporting files might be located.

There's an easy way to see the locations of all the files installed as part of the package, using the dpkg utility.

dpkg -L

see:-http://www.howtogeek.com/howto/ubuntu/

Install an RPM Package on Ubuntu Linux



Installing software on Ubuntu usually entails using Synaptic or by using an apt-get command from the terminal. Unfortunately, there are still a number of packages out there that are only distributed in RPM format.

There's a utility called Alien that converts packages from one format to the other. This doesn't always mean that an rpm will work on your system, though. You will need to install some prerequisite software packages in order to install alien, however. These packages include gcc and make.

Run this command to install alien and other necessary packages:

sudo apt-get install alien dpkg-dev debhelper build-essential

To convert a package from rpm to debian format, use this command syntax. The sudo may not be necessary, but we'll include it just in case.

sudo alien packagename.rpm

To install the package, you'll use the dpkg utility, which is the internal package management tool behind debian and Ubuntu.

sudo dpkg -i packagename.deb

The package should now be installed, providing it's compatible with your system.

How to Tell What Version of Ubuntu You Are Running



Telling what version of Ubuntu you are running is extremely easy. You would commonly use this command to figure out if you are running Edgy after you upgraded from Dapper.

cat /etc/issue

Ubuntu edgy (development branch)

Note that the version numbers might change over time. I'm running the beta version so that's what shows up when I run that command. Either way, it should be clear that you are running Edgy.

see:-http://www.howtogeek.com/howto/ubuntu/

Clean Up Ubuntu Grub Boot Menu After Upgrades

One of the things in Ubuntu that has always driven me crazy is the addition of new items into the grub menu without removing the old entries that likely don't even work anymore. I'm sure most experienced Ubuntu users already know how to do this, but here's the method anyway.

I just installed this box recently, and then did an upgrade…. already there are 7 items in the menu.

image

To remove these entries, we'll need to edit the file /boot/grub/menu.lst. You can do this by using Alt+F2 and then typing in the following command:

gksu gedit /boot/grub/menu.lst

image

Now that we've got the file open, scroll down to the bottom of the file where it says "End Default Options", and you'll find all the menu entries for the various kernels in here. You can just select and delete the ones you want.

see:-http://www.howtogeek.com/howto/ubuntu/

Friday, June 13, 2008

Oracle 10g xe sqlplus for ubuntu settings

dross


Does anyone know if there is a way to change the default settings for oracle 10g xe sqlplus? For some reason, when I hit the up key, I'm not getting old commands that I've entered (as I get in the shell). Also, all columns are defaulting to the maximum character length, which makes most tables impossible to read without formatting columns..I seem to remember sqlplus shortening columns by default when I used it in windows...Any one have similar problems? or know how to fix these?


After some searching, I found that sqlplus for linux doesn't have command history buffer...too bad. But I also found a tool that seems to deal with it (haven;t used it yet, so can;t vouch for the performance, but it definitely has command history):gqlplus

http://sourceforge.net/projects/gqlplus

after you download gqlplus,

1. find your path variable:

Code:

echo $PATH

you should see this path in there:

Code:

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

if you don't, you should edit .bashrc (see below) to put sqlplus in path (unless you have a custom configuration...in which case you probably wouldn't be looking here for direction)
--------------------------------------------------------------------
ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME
export ORACLE_SID=XE

export PATH

Start a new bash shell for the changes to take effect.

To log in as a database administrator:

sqlplus sys as sysdba

It will then be possible for you to create and unlock user accounts using Oracle SQL commands - they details of which are beyond the scope of this doc.
-----------------------------------------------------------------------------

2. take out the gqlplus executable from the download: gqlplus-1.12/Linux/gqlplus


3. place the executable in any of the path directories (probably makes sense to put it in the oracle xe path...or at least that;s what I did) and you should be able to access gqlplus with gqlplus command:

Code:

gqlplus


see:-https://help.ubuntu.com/community/Oracle10g#head-35cee01075d83fad1bb353beac13b27bda3fee32





for command History

install rlwrap (sudo apt-get install rlwrap) and invoke it before sqlplus like so:

rlwrap sqlplus user/pwd

you will get history with up and down arrow keys, home and end with their respective keys, and delete will actually delete. No tab completion, but then, I haven't found gqlplus' tab completion truly context-sensitive.