Tuesday, June 17, 2008
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/
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/
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.
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.
Subscribe to:
Posts (Atom)