In recent years a number of corporations have poured millions of dollars into creating Windows-like user interfaces for Linux, and into persuading the various major distros to adopt them.
See this article, for example:
http://troy-at-kde.livejournal.com/14690.html
There you have the owner of Slackware and his cronies being wined and dined by kde at a supposed "conference", which is just a way of disguising an expensive vacation. A bribe.
Primarily, I'm talking about kde, to a lesser degree, gnome. There's also one called xfce, and maybe a couple of other even lesser ones.
Henceforth, I'm just going to refer to kde, but I mean all of them.
Why are they doing this? Because they are threatened by people running a free operating system who actually understand how it works.
By people who don't need _them_. Who aren't _controlled_ by them.
You can let them lead you by the nose to kde and pretend that you are running Linux, but you won't be. You'll be letting kde run Linux for you. You'll be letting the corporations _behind_ kde
run Linux for you.
Ironically, it takes just as long to learn to use kde as it does to learn to run Linux from the shell, the commandline.
Myself and many others do this, and we can do anything that someone running kde can do. And a lot more.
The kde technocrats want you to think that Linux is so complicated that no mere mortal can comprehend it, and when you add kde to Linux (which more than doubles its size) it does indeed become too complex to deal with. How about that? :-)
But tens of of thousands of ordinary people managed to run Linux just fine before kde existed. And they didn't have anywhere near the documentation that's available now. Tens of thousands of
people _still_ run Linux from the commandline.
If you are thinking that running Linux from the commandline means spending all of your time typing in long commands, then you are quite mistaken. If you are thinking that it means you won't be able to run your favorite graphical applications and use a mouse, you are quite mistaken.
Two parallel courses of study are involved here: Learning the basics of how Linux works, and learning the basics of the shell,bash being the most common one these days.
We are all different; we are all individuals. We each need a unique user interface tailored to _our_ specific needs. And it is _easy_ to create one with just a little knowledge of bash.
Here are three excellent documents to get you on the path of freedom and power, to learning Linux instead of some artificial user interface:
The first section of this one is actually an introduction to the real basics of bash, how to use the command line. It's section on mathematical tools is not so hot.
See: http://groups.google.com/group/alt.linux/msg/208349400085e7a3
http://www.tldp.org/LDP/GNU-Linux-Tools-Summary/GNU-Linux-Tools-Summa...
How Linux actually works:
http://www.tldp.org/LDP/intro-linux/intro-linux.html.tar.gz
Basic shell scripting, etc:
http://www.tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.htm...
These are basic reference documents:
This one is dated, but still very useful:
http://rute.2038bug.com/rute.html.tar.bz2
Don't let the word "advanced" throw you. There are many basic things covered in this fine work:
http://www.tldp.org/LDP/abs/abs-guide.html.tar.gz
These are good reference sites:
http://www.comptechdoc.org/os/linux/
http://www.tldp.org/LDP/Linux-Dictionary/html/index.html
http://linux-newbie.sunsite.dk/index.html
There is a free, online school for newbies out there, but I've
checked it out and wasn't much impressed.
---------------------------------------------------
I'm looking for people to teach the newbies, and for newbies who
want to learn to run Linux from the command line.
I am not interested in getting involved in running arguments
about the points I've raised.
If you disagree with me, simply post your opinions and others
will read them. You are entitled to them.
I will not be responding any more posts of an argumentative nature.
The usenet has thousands of people who will argue anything from
now until eternity. That's their thing. I have better things to
do.
Friday, November 28, 2008
Thursday, November 27, 2008
Checking for suspicious account use
sulekha
the following is the recipe which i saw in Linux security cookbook
Checking for Suspicious Account Use
Problem
You want to discover unusual or dangerous usage of accounts on your system: dormant user accounts, recent logins to system accounts, etc.
Solution
To print information about the last login for each user:
$ lastlog [-u username]
To print the entire login history:
$ last [username]
To print failed login attempts:
$ lastb [username]
To enable recording of bad logins:
# touch /var/log/btmp
# chown --reference=/var/log/wtmp /var/log/btmp
# chmod --reference=/var/log/wtmp /var/log/btmp
how correct is this recipe? what are the modifications/changes that needs to made so as to make it work in ubuntu 8.04.1
ibutho
It seems accurate to me and the only modification you may need to do is prefix individual commands with sudo. /var/log/btmp stores all the last bad logins, but in most distros its not created by default. If you run "lastb", a list of all bad logins since you created /var/log/btmp will be shown. For a specific user, its "lastb user".
cariboo907
/var/log/btmp have been atomagically created on all the Debian based distro I have used.
the following is the recipe which i saw in Linux security cookbook
Checking for Suspicious Account Use
Problem
You want to discover unusual or dangerous usage of accounts on your system: dormant user accounts, recent logins to system accounts, etc.
Solution
To print information about the last login for each user:
$ lastlog [-u username]
To print the entire login history:
$ last [username]
To print failed login attempts:
$ lastb [username]
To enable recording of bad logins:
# touch /var/log/btmp
# chown --reference=/var/log/wtmp /var/log/btmp
# chmod --reference=/var/log/wtmp /var/log/btmp
how correct is this recipe? what are the modifications/changes that needs to made so as to make it work in ubuntu 8.04.1
ibutho
It seems accurate to me and the only modification you may need to do is prefix individual commands with sudo. /var/log/btmp stores all the last bad logins, but in most distros its not created by default. If you run "lastb", a list of all bad logins since you created /var/log/btmp will be shown. For a specific user, its "lastb user".
cariboo907
/var/log/btmp have been atomagically created on all the Debian based distro I have used.
hidden files in home directory
sulekha
can anyone explain me the purpose of the following hidden files which are usually seen in the home directory ?
.Xauthority
.xsession-errors
.recently-used-xbel
.recently-used
.pulse-cookie
.lesshst
.ICEauthority
.gksu.lock
.esd_auth
aarklon
The `.xsession' file, a hidden file in your home directory, specifies the clients that are automatically run when your X session first starts. It is just a shell script, usually containing a list of clients to run. You can edit your `.xsession' file in a text editor, and if this
file doesn't exist, you can create it.
Fritz monroe
I don't have details, but it's a place for you to start digging.
.Xauthority - X11 forwarding related
.xsession-errors - holds errors caused during the start of X Windows
.recently-used - Gnome's recently opened documents (Places >> Recent Documents)
.pulse-cookie - maybe pulseaudio related?
.lesshst - no idea
.ICEauthority - don't know
.gksu.lock - this is a lock file for gksu (Gtk+ frontend to su and sudo)
.esd_auth - something to do with the esd sound system.
.recently-used-xbel - not sure, seems to be GIMP related. So probably the GIMP recently opened images
Sidney Lambe
$ apropos Xauthority
Xauthority: nothing appropriate
$ apropos authority
Xau library: XauFileName [Xau] (3) - X authority database routines
XauDisposeAuth [Xau] (3) - X authority database routines
XauGetAuthByAddr [Xau] (3) - X authority database routines
XauGetBestAuthByAddr [Xau] (3) - X authority database routines
XauLockAuth [Xau] (3) - X authority database routines
XauReadAuth [Xau] (3) - X authority database routines
XauUnlockAuth [Xau] (3) - X authority database routines
XauWriteAuth [Xau] (3) - X authority database routines
iceauth (1x) - ICE authority file utility
xauth (1) - X authority file utility
And that last entry looks pretty promising.
$ man xauth
There's your answer, on your own box, right under your nose.
Mark Hobley
Maybe we need some more manual pages:
man .Xauthority
No manual entry for .Xauthority
man .xsession-errors
No manual entry for .xsession-errors
We have one for xsession, but it contains capitalized names. I don't know why we do this. The capital X is probably something to do with the X windowing system (or should that be the x windowing system? Hmmm, should we be using uppercase first letters for executables? Yuck! Letter
case adds to the confusion here).
man xsession
Xsession(5)
NAME
Xsession - initialize X session
N.B:- Tested in ubuntu 8.04.1
can anyone explain me the purpose of the following hidden files which are usually seen in the home directory ?
.Xauthority
.xsession-errors
.recently-used-xbel
.recently-used
.pulse-cookie
.lesshst
.ICEauthority
.gksu.lock
.esd_auth
aarklon
The `.xsession' file, a hidden file in your home directory, specifies the clients that are automatically run when your X session first starts. It is just a shell script, usually containing a list of clients to run. You can edit your `.xsession' file in a text editor, and if this
file doesn't exist, you can create it.
Fritz monroe
I don't have details, but it's a place for you to start digging.
.Xauthority - X11 forwarding related
.xsession-errors - holds errors caused during the start of X Windows
.recently-used - Gnome's recently opened documents (Places >> Recent Documents)
.pulse-cookie - maybe pulseaudio related?
.lesshst - no idea
.ICEauthority - don't know
.gksu.lock - this is a lock file for gksu (Gtk+ frontend to su and sudo)
.esd_auth - something to do with the esd sound system.
.recently-used-xbel - not sure, seems to be GIMP related. So probably the GIMP recently opened images
Sidney Lambe
$ apropos Xauthority
Xauthority: nothing appropriate
$ apropos authority
Xau library: XauFileName [Xau] (3) - X authority database routines
XauDisposeAuth [Xau] (3) - X authority database routines
XauGetAuthByAddr [Xau] (3) - X authority database routines
XauGetBestAuthByAddr [Xau] (3) - X authority database routines
XauLockAuth [Xau] (3) - X authority database routines
XauReadAuth [Xau] (3) - X authority database routines
XauUnlockAuth [Xau] (3) - X authority database routines
XauWriteAuth [Xau] (3) - X authority database routines
iceauth (1x) - ICE authority file utility
xauth (1) - X authority file utility
And that last entry looks pretty promising.
$ man xauth
There's your answer, on your own box, right under your nose.
Mark Hobley
Maybe we need some more manual pages:
man .Xauthority
No manual entry for .Xauthority
man .xsession-errors
No manual entry for .xsession-errors
We have one for xsession, but it contains capitalized names. I don't know why we do this. The capital X is probably something to do with the X windowing system (or should that be the x windowing system? Hmmm, should we be using uppercase first letters for executables? Yuck! Letter
case adds to the confusion here).
man xsession
Xsession(5)
NAME
Xsession - initialize X session
N.B:- Tested in ubuntu 8.04.1
chown
Setting File Ownership with chown
Problem
You need to change ownership on a file or directory. Perhaps you've copied something to someone else's directory but she still can't edit it, because it's owned by you. Many Linux problems result from incorrect ownership or permission. You're seeing messages like "Permission denied" or "File is read-only" when it shouldn't be.
Solution
Use chown (change owner) to change the file owner, the file and group owner, or the group owner:
# chown user filename
# chown user:group filename
# chown :group filename
For example:
$ chown -v carlas:share index.txt
changed ownership of `index.txt' to carlas:share
$ chown -v :share toc.txt
changed ownership of `toc.txt' to :share
Problem
You want to change ownership of directories and their contents, or just the contents of directories, a list of files, or change ownership of files from one UID to another.
Solution
chown supports some batch operations, or you can use find, or you can use shell wildcards.
you can use shell wildcards:
# chown carlas *.txt
To give all of a user's files to another user, use:
# chown -R -v from valh piglet /shared/scripts
You can do the same thing with find:
# find / -user valh -exec chown -v piglet { } \;
find can also search by UID, which chown cannot:
# find / -uid 1050 -exec chown -v 1200 { } \;
To change the ownership of a directory, including subdirectories and files, with verbose output, use:
# chown -R -v piglet /shared/scripts
changed ownership of `scripts' to piglet
changed ownership of `scripts/backups.tgz' to piglet
changed ownership of `scripts/fake-spec-rpm' to piglet
Either the user's login name or UID can be used. If you've deleted a user and the user has left behind orphan files, you'll need the UID.
Problem
You need to change ownership on a file or directory. Perhaps you've copied something to someone else's directory but she still can't edit it, because it's owned by you. Many Linux problems result from incorrect ownership or permission. You're seeing messages like "Permission denied" or "File is read-only" when it shouldn't be.
Solution
Use chown (change owner) to change the file owner, the file and group owner, or the group owner:
# chown user filename
# chown user:group filename
# chown :group filename
For example:
$ chown -v carlas:share index.txt
changed ownership of `index.txt' to carlas:share
$ chown -v :share toc.txt
changed ownership of `toc.txt' to :share
Problem
You want to change ownership of directories and their contents, or just the contents of directories, a list of files, or change ownership of files from one UID to another.
Solution
chown supports some batch operations, or you can use find, or you can use shell wildcards.
you can use shell wildcards:
# chown carlas *.txt
To give all of a user's files to another user, use:
# chown -R -v from valh piglet /shared/scripts
You can do the same thing with find:
# find / -user valh -exec chown -v piglet { } \;
find can also search by UID, which chown cannot:
# find / -uid 1050 -exec chown -v 1200 { } \;
To change the ownership of a directory, including subdirectories and files, with verbose output, use:
# chown -R -v piglet /shared/scripts
changed ownership of `scripts' to piglet
changed ownership of `scripts/backups.tgz' to piglet
changed ownership of `scripts/fake-spec-rpm' to piglet
Either the user's login name or UID can be used. If you've deleted a user and the user has left behind orphan files, you'll need the UID.
chmod
Use the setgid bit to automatically set the shared group ownership on files.
This is how to set it with octal notation: chmod -v 2775 /shared-directory
You can also use symbolic notation: chmod -v +s /shared-directory
Keep in mind that +s sets both the setgid and setuid bits, which could be a security problem if executables or scripts are stored in this directory. chmod 2775 sets only the setgid bit.
Add the sticky bit to prevent anyone but the file owner from deleting the file, by using:
# chmod +t /shared-directory or chmod 3775 /shared-directory
On a historical note , UNIX systems used to use the sticky bit on files to hoard executable files in swap space and avoid reloading.
Setting File and Directory Permissions with chmod's Symbolic Notation
You would like to change specific permission bits, rather than using the all-or-nothing approach of chmod's numeric notation, such as marking a script as executable.
Solution
The most common use for symbolic notation is to add the executable bit to a file's permissions without changing any other permissions:
$ chmod +x scriptname
The default action is a, or all, so the example makes scriptname executable by everyone. This adds the executable bit to the file owner only:
$ chmod u+x scriptname
You can surgically remove a specific mode bit. In this example, the group and other users lose their executable bits:
$ chmod go-x scriptname
This is a quick way to set the setgid bit on a directory, for creating a shared directory. All files created in this directory will have the same group ownership as the directory:
$ chmod +s /shared-directory
You can remove all permissions for group and other users by doing the following:
$ chmod go= scriptname
To make group permissions the same as the file owner's, use:
$ chmod g=u scriptname
Doing Batch Operations with chmod
Problem You need to set permissions on all the files or a directory, or on batches of files.
Solution
chmod supports operating on lists of files. You can also use find or shell wildcards to generate a list.
To make several files read-only for everyone, you can use chmod as follows:
$ chmod 444 file.txt file2.txt file3.txt
To make all files in the current directory readable/writable, for the file owner and group, without changing the directory permissions, use:
$ find . -type f -exec chmod -v 660 { } \;
You can also change all files belonging to a particular user. This example starts at the root of the filesystem:
$ find / -user terri -exec chmod -v 660 { } \;
You can set permissions for a directory and its contents, including subdirectories, with the -R (recursive) flag:
$ chmod -R -v 755 /shared
This example makes all the .txt files in the current directory readable/writable to the owner, and world-readable:
$ chmod -v 644 *.txt
To change all files in the current directory that begin with your chosen string, use:
$ chmod -v 644 apt*
access mode symbolic octal
suid s with u 4000
sgid s with g 2000
sticky t 1000
immutable files
ex: touch keep.txt
chattr +i keep.txt
only root user can create an immutable file but cannot delete it until the flag is removed.
making files immutable is often done as a part of security or intrusion detection effort
This is how to set it with octal notation: chmod -v 2775 /shared-directory
You can also use symbolic notation: chmod -v +s /shared-directory
Keep in mind that +s sets both the setgid and setuid bits, which could be a security problem if executables or scripts are stored in this directory. chmod 2775 sets only the setgid bit.
Add the sticky bit to prevent anyone but the file owner from deleting the file, by using:
# chmod +t /shared-directory or chmod 3775 /shared-directory
On a historical note , UNIX systems used to use the sticky bit on files to hoard executable files in swap space and avoid reloading.
Setting File and Directory Permissions with chmod's Symbolic Notation
You would like to change specific permission bits, rather than using the all-or-nothing approach of chmod's numeric notation, such as marking a script as executable.
Solution
The most common use for symbolic notation is to add the executable bit to a file's permissions without changing any other permissions:
$ chmod +x scriptname
The default action is a, or all, so the example makes scriptname executable by everyone. This adds the executable bit to the file owner only:
$ chmod u+x scriptname
You can surgically remove a specific mode bit. In this example, the group and other users lose their executable bits:
$ chmod go-x scriptname
This is a quick way to set the setgid bit on a directory, for creating a shared directory. All files created in this directory will have the same group ownership as the directory:
$ chmod +s /shared-directory
You can remove all permissions for group and other users by doing the following:
$ chmod go= scriptname
To make group permissions the same as the file owner's, use:
$ chmod g=u scriptname
Doing Batch Operations with chmod
Problem You need to set permissions on all the files or a directory, or on batches of files.
Solution
chmod supports operating on lists of files. You can also use find or shell wildcards to generate a list.
To make several files read-only for everyone, you can use chmod as follows:
$ chmod 444 file.txt file2.txt file3.txt
To make all files in the current directory readable/writable, for the file owner and group, without changing the directory permissions, use:
$ find . -type f -exec chmod -v 660 { } \;
You can also change all files belonging to a particular user. This example starts at the root of the filesystem:
$ find / -user terri -exec chmod -v 660 { } \;
You can set permissions for a directory and its contents, including subdirectories, with the -R (recursive) flag:
$ chmod -R -v 755 /shared
This example makes all the .txt files in the current directory readable/writable to the owner, and world-readable:
$ chmod -v 644 *.txt
To change all files in the current directory that begin with your chosen string, use:
$ chmod -v 644 apt*
access mode symbolic octal
suid s with u 4000
sgid s with g 2000
sticky t 1000
immutable files
ex: touch keep.txt
chattr +i keep.txt
only root user can create an immutable file but cannot delete it until the flag is removed.
making files immutable is often done as a part of security or intrusion detection effort
Configuring Filesystem Mounts with /etc/fstab
Problem
Users need to make their own backups on CDs, and use USB memory sticks and other types of removable media. You don't want to give them root privileges just so they can mount these devices. But only root can use the mount command we discussed in Recipe 9.9. And you also want to control which file systems are automatically mounted at boot.
Solution
Add entries to /etc/fstab, defining mount points and access permissions.
This example shows a Linux partition, two Windows partitions, and removable media:
#
/dev/hda6 /rh-data reiserfs defaults,user,noauto 0 1
/dev/hda1 /win2k ntfs defaults,user,ro,gid=win2k 0 0
/dev/hda2 /win98 vfat defaults,user,gid=win98 0 0
/dev/hdc0 /cdrom auto defaults,user,noauto,ro 0 0
/dev/fd0 /floppy auto defaults,user,noauto 0 0
/dev/sda1 /memstick auto defaults,user,noauto 0 0
Once a device has an entry in /etc/fstab, it can be mounted by using the mountpoint:
$ mount /cdrom
$ mount /memstick
And unmounted the same way: $ umount /cdrom
Discussion
These are the six fields that make up /etc/fstab:
device The device name assigned by the kernel.
mountpoint The directory to which the filesystem is attached, which is user-defined.
type The filesystem type. It's okay to use "auto" in this field for most filesystems. See mount(8) for the supported filesystem types.
options Command options in a comma-delimited list. See mount(8) for a complete list
dump
If you're using the dump command for backups, this tells dump the backup interval, in days. 1 means every day, 2 means every other day, and so on.
pass This tells fsck which filesystem to check first at boot up, if it ever needs to. Make your root filesystem 1, any other Linux filesystems 2, and non-Linux filesystems 0.
Let's take a closer look at what goes in the options field. All these values belong to the defaults option:
rw Read/write.
suid Allow setuid and setgid bits to operate.
dev Interpret block and character devices.
exec Allow execution of binaries.
auto
This is used in boot scripts (Debian uses /etc/init.d/mountall.sh; Red Hat uses /etc/rc.d/rc.sysinit), indicating which filesystems are to be started at boot up.
nouser Non-root users cannot mount or unmount the filesystem.
async Asynchronous I/O, which is standard for Linux.
The defaults values are overridden by appending additional options, as on the win2k line in the /etc/fstab example above (defaults,user,ro,gid=win2k). The options are:
user
Non-root users can mount and unmount the device, provided they were the ones who mounted it
users
Any user can unmount the device.
noauto
The device must be explicitly mounted by a user and does not automatically mount at boot.
ro
The device is read-only. Be sure to use this for NTFS volumes.
noatime
Do not update the "time accessed" file attribute. This speeds up filesystem performance. It also extends the life of CD-RWs and DVD-RWs that use packet-writing, and of USB storage media, by reducing the number of writes.
gid=win2k
Assign group membership, if you are controlling access with groups.
Mounting filesystems, not devices
We tend to think of mounting devices and partitions, but strictly speaking, only filesystems are mounted. "Mount" and "attach" mean the same thing, if you want a different word to use. Some Linux distributions, such as Red Hat, use the /mnt directory. Debian uses top-level directories, such as /floppy or /cdrom. There's no hard-and-fast rule; put them wherever it suits you. Just be careful not to mount two filesystems in the same directory. If you do, the existing files will disappear until the intruder filesystem is unmounted.
Usually it's not necessary to specify the filesystem type, because mount will figure it out. First, it will probe the superblock. Currently adfs, bfs, cramfs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, ntfs, qnx4, reiserfs, romfs, udf, ufs, vxfs, xfs, and xiafs are supported. If that fails, it will try each filesystem listed in /proc/filesystems, which shows all the filesystems supported by your kernel.
source Carla Schroder
Users need to make their own backups on CDs, and use USB memory sticks and other types of removable media. You don't want to give them root privileges just so they can mount these devices. But only root can use the mount command we discussed in Recipe 9.9. And you also want to control which file systems are automatically mounted at boot.
Solution
Add entries to /etc/fstab, defining mount points and access permissions.
This example shows a Linux partition, two Windows partitions, and removable media:
#
/dev/hda6 /rh-data reiserfs defaults,user,noauto 0 1
/dev/hda1 /win2k ntfs defaults,user,ro,gid=win2k 0 0
/dev/hda2 /win98 vfat defaults,user,gid=win98 0 0
/dev/hdc0 /cdrom auto defaults,user,noauto,ro 0 0
/dev/fd0 /floppy auto defaults,user,noauto 0 0
/dev/sda1 /memstick auto defaults,user,noauto 0 0
Once a device has an entry in /etc/fstab, it can be mounted by using the mountpoint:
$ mount /cdrom
$ mount /memstick
And unmounted the same way: $ umount /cdrom
Discussion
These are the six fields that make up /etc/fstab:
device The device name assigned by the kernel.
mountpoint The directory to which the filesystem is attached, which is user-defined.
type The filesystem type. It's okay to use "auto" in this field for most filesystems. See mount(8) for the supported filesystem types.
options Command options in a comma-delimited list. See mount(8) for a complete list
dump
If you're using the dump command for backups, this tells dump the backup interval, in days. 1 means every day, 2 means every other day, and so on.
pass This tells fsck which filesystem to check first at boot up, if it ever needs to. Make your root filesystem 1, any other Linux filesystems 2, and non-Linux filesystems 0.
Let's take a closer look at what goes in the options field. All these values belong to the defaults option:
rw Read/write.
suid Allow setuid and setgid bits to operate.
dev Interpret block and character devices.
exec Allow execution of binaries.
auto
This is used in boot scripts (Debian uses /etc/init.d/mountall.sh; Red Hat uses /etc/rc.d/rc.sysinit), indicating which filesystems are to be started at boot up.
nouser Non-root users cannot mount or unmount the filesystem.
async Asynchronous I/O, which is standard for Linux.
The defaults values are overridden by appending additional options, as on the win2k line in the /etc/fstab example above (defaults,user,ro,gid=win2k). The options are:
user
Non-root users can mount and unmount the device, provided they were the ones who mounted it
users
Any user can unmount the device.
noauto
The device must be explicitly mounted by a user and does not automatically mount at boot.
ro
The device is read-only. Be sure to use this for NTFS volumes.
noatime
Do not update the "time accessed" file attribute. This speeds up filesystem performance. It also extends the life of CD-RWs and DVD-RWs that use packet-writing, and of USB storage media, by reducing the number of writes.
gid=win2k
Assign group membership, if you are controlling access with groups.
Mounting filesystems, not devices
We tend to think of mounting devices and partitions, but strictly speaking, only filesystems are mounted. "Mount" and "attach" mean the same thing, if you want a different word to use. Some Linux distributions, such as Red Hat, use the /mnt directory. Debian uses top-level directories, such as /floppy or /cdrom. There's no hard-and-fast rule; put them wherever it suits you. Just be careful not to mount two filesystems in the same directory. If you do, the existing files will disappear until the intruder filesystem is unmounted.
Usually it's not necessary to specify the filesystem type, because mount will figure it out. First, it will probe the superblock. Currently adfs, bfs, cramfs, ext, ext2, ext3, hfs, hpfs, iso9660, jfs, minix, ntfs, qnx4, reiserfs, romfs, udf, ufs, vxfs, xfs, and xiafs are supported. If that fails, it will try each filesystem listed in /proc/filesystems, which shows all the filesystems supported by your kernel.
source Carla Schroder
Wednesday, November 26, 2008
Detecting Hardware with lspci
Problem
You're looking at new systems, or installing Linux on a box that used to run a different OS, and you're wondering if all the componentsvideo, modem, Ethernet, sound will work on Linux. The vendors can't, or won't, tell you if their products will work on Linux. You need to know what the chipsets are, to find out if there are Linux drivers.
Alternatively, you want to know what components are installed inside a computer, and you don't feel like hauling the thing out, popping the case open, and tearing it apart.
Solution
Use lspci:
# /sbin/lscpi
# /sbin/lspci -v
# /sbin/lspci -vv
To show a summary of all devices connected to the PCI bus, use:
$ /sbin/lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 02)
00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP]
00:06.0 Ethernet controller: Linksys Network Everywhere Fast Ethernet 10/100 model NC100
(rev 11)
...
Use the -v or -vv flags to display more information:
# /sbin/lspci -v
0000:01:00.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo 3 (rev 01) (prog-if
00 [VGA])
Subsystem: 3Dfx Interactive, Inc.: Unknown device 1252
Flags: 66MHz, fast devsel, IRQ 10
Memory at d4000000 (32-bit, non-prefetchable) [size=32M]
Memory at d8000000 (32-bit, prefetchable) [size=32M]
I/O ports at c000 [size=256]
Expansion ROM at [disabled] [size=64K]
Capabilities: [54] AGP version 1.0
Capabilities: [60] Power Management version 1
If you're looking for drivers, you can now take this output (e.g., VT8363/8365 or 3Dfx Interactive, Inc. Voodoo 3 (rev 01)) to run a Google search.
5.2.3 Discussion
lspci reads some information from the PCI bus, then displays additional information from its own database of hardware IDsvendors, devices, classes and subclasses at /usr/share/misc/pci.ids. There is even a command to update this file:
# update-pciids
The lspci maintainers welcome submissions of new data; please read /usr/share/misc/pci.ids for how to make submissions.If there is a device attached to the system that the lspci simply does not recognize, such as a very old, odd ISA device, you'll have to open the case to see what it is. Or try running dmesg
source:- carla schroder
You're looking at new systems, or installing Linux on a box that used to run a different OS, and you're wondering if all the componentsvideo, modem, Ethernet, sound will work on Linux. The vendors can't, or won't, tell you if their products will work on Linux. You need to know what the chipsets are, to find out if there are Linux drivers.
Alternatively, you want to know what components are installed inside a computer, and you don't feel like hauling the thing out, popping the case open, and tearing it apart.
Solution
Use lspci:
# /sbin/lscpi
# /sbin/lspci -v
# /sbin/lspci -vv
To show a summary of all devices connected to the PCI bus, use:
$ /sbin/lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133] (rev 02)
00:01.0 PCI bridge: VIA Technologies, Inc. VT8363/8365 [KT133/KM133 AGP]
00:06.0 Ethernet controller: Linksys Network Everywhere Fast Ethernet 10/100 model NC100
(rev 11)
...
Use the -v or -vv flags to display more information:
# /sbin/lspci -v
0000:01:00.0 VGA compatible controller: 3Dfx Interactive, Inc. Voodoo 3 (rev 01) (prog-if
00 [VGA])
Subsystem: 3Dfx Interactive, Inc.: Unknown device 1252
Flags: 66MHz, fast devsel, IRQ 10
Memory at d4000000 (32-bit, non-prefetchable) [size=32M]
Memory at d8000000 (32-bit, prefetchable) [size=32M]
I/O ports at c000 [size=256]
Expansion ROM at
Capabilities: [54] AGP version 1.0
Capabilities: [60] Power Management version 1
If you're looking for drivers, you can now take this output (e.g., VT8363/8365 or 3Dfx Interactive, Inc. Voodoo 3 (rev 01)) to run a Google search.
5.2.3 Discussion
lspci reads some information from the PCI bus, then displays additional information from its own database of hardware IDsvendors, devices, classes and subclasses at /usr/share/misc/pci.ids. There is even a command to update this file:
# update-pciids
The lspci maintainers welcome submissions of new data; please read /usr/share/misc/pci.ids for how to make submissions.If there is a device attached to the system that the lspci simply does not recognize, such as a very old, odd ISA device, you'll have to open the case to see what it is. Or try running dmesg
source:- carla schroder
Sunday, November 23, 2008
Examining Local Network Activities
You want to examine network use occurring on your local machine.
Solution
To print a summary of network use:
$ netstat --inet Connected sockets
$ netstat --inet --listening Server sockets
$ netstat --inet --all Both
# netstat --inet ... -p Identify processes
To print dynamically assigned ports for RPC services:
$ rpcinfo -p [host]
To list network connections for all processes:
# lsof -i[TCP|UDP][@host][:port]
To list all open files for specific processes:
# lsof -p pid
# lsof -c command
# lsof -u username
source:- Robert g byrnes
netstat -s --- this will display network statistics report
Displaying all active Internet connections in Linux.
Answer:
It may be necessary to display what Internet connections are active on your Linux box. For example, seeing if the Apache service is actively running and if running what network ports it's listening to. To do this run the below netstat command in the command line.
netstat -natp
Using the netstat Command
To track what ports are open and what ports have processes listening to them, we use the netstat command. For example:
[root@serverA ~]# netstat -natu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 132 192.168.1.4:22 192.168.1.33:2129 ESTABLISHED
udp 0 0 0.0.0.0:32768 0.0.0.0:*
tcp 0 0 ::ffff:192.168.1.4:22 ::ffff:192.168.1.90:40587 ESTABLISHED
udp 0 0 0.0.0.0:631 0.0.0.0:*
By default (with no parameters), netstat will provide all established connections for both network and domain sockets. That means we’ll see not only the connections that are actually working over the network, but also the interprocess communications (which, from a security monitoring standpoint, are not useful). So in the command just illustrated, we have asked netstat to show us all ports (-a)—whether they are listening or actually connected—for TCP (-t) and UDP (-u). We have told netstat not to spend any time resolving IP addresses to hostnames (-n).
In the netstat output, each line represents either a TCP or UDP network port, as indicated by the first column of the output. The Recv-Q (receive queue) column lists the number of bytes received by the kernel but not read by the process. Next, the Send-Q (send queue) column tells us the number of bytes sent to the other side of the connection but not acknowledged.
The fourth, fifth, and sixth columns are the most interesting in terms of system security. The Local Address column tells you your server’s IP address and port number.Remember that your server recognizes itself as 127.0.0.1 and 0.0.0.0, as well as its normal IP address. In the case of multiple interfaces, each port being listened to will show up on all interfaces and, thus, as separate IP addresses. The port number is separated from the IP address by a colon. In the output from the netstat example just shown, the Ethernet device has the IP address 192.168.1.4.
The fifth column, Foreign Address, identifies the other side of the connection. In the case of a port that is being listened to for new connections, the default value will be 0.0.0.0:*. This IP address means nothing, since we’re still waiting for a remote host to connect to us!
The sixth column tells us the state of the connection. The man page for netstat lists all of the states, but the two you’ll see most often are LISTEN and ESTABLISHED. The LISTEN state means there is a process on your server listening to the port and ready to accept new connections. The ESTABLISHED state means just that—a connection is established between a client and server.
Solution
To print a summary of network use:
$ netstat --inet Connected sockets
$ netstat --inet --listening Server sockets
$ netstat --inet --all Both
# netstat --inet ... -p Identify processes
To print dynamically assigned ports for RPC services:
$ rpcinfo -p [host]
To list network connections for all processes:
# lsof -i[TCP|UDP][@host][:port]
To list all open files for specific processes:
# lsof -p pid
# lsof -c command
# lsof -u username
source:- Robert g byrnes
netstat -s --- this will display network statistics report
Displaying all active Internet connections in Linux.
Answer:
It may be necessary to display what Internet connections are active on your Linux box. For example, seeing if the Apache service is actively running and if running what network ports it's listening to. To do this run the below netstat command in the command line.
netstat -natp
Using the netstat Command
To track what ports are open and what ports have processes listening to them, we use the netstat command. For example:
[root@serverA ~]# netstat -natu
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 132 192.168.1.4:22 192.168.1.33:2129 ESTABLISHED
udp 0 0 0.0.0.0:32768 0.0.0.0:*
tcp 0 0 ::ffff:192.168.1.4:22 ::ffff:192.168.1.90:40587 ESTABLISHED
udp 0 0 0.0.0.0:631 0.0.0.0:*
By default (with no parameters), netstat will provide all established connections for both network and domain sockets. That means we’ll see not only the connections that are actually working over the network, but also the interprocess communications (which, from a security monitoring standpoint, are not useful). So in the command just illustrated, we have asked netstat to show us all ports (-a)—whether they are listening or actually connected—for TCP (-t) and UDP (-u). We have told netstat not to spend any time resolving IP addresses to hostnames (-n).
In the netstat output, each line represents either a TCP or UDP network port, as indicated by the first column of the output. The Recv-Q (receive queue) column lists the number of bytes received by the kernel but not read by the process. Next, the Send-Q (send queue) column tells us the number of bytes sent to the other side of the connection but not acknowledged.
The fourth, fifth, and sixth columns are the most interesting in terms of system security. The Local Address column tells you your server’s IP address and port number.Remember that your server recognizes itself as 127.0.0.1 and 0.0.0.0, as well as its normal IP address. In the case of multiple interfaces, each port being listened to will show up on all interfaces and, thus, as separate IP addresses. The port number is separated from the IP address by a colon. In the output from the netstat example just shown, the Ethernet device has the IP address 192.168.1.4.
The fifth column, Foreign Address, identifies the other side of the connection. In the case of a port that is being listened to for new connections, the default value will be 0.0.0.0:*. This IP address means nothing, since we’re still waiting for a remote host to connect to us!
The sixth column tells us the state of the connection. The man page for netstat lists all of the states, but the two you’ll see most often are LISTEN and ESTABLISHED. The LISTEN state means there is a process on your server listening to the port and ready to accept new connections. The ESTABLISHED state means just that—a connection is established between a client and server.
Symmetric key encryption and decryption using gpg
You want to encrypt a file so only you can decrypt it with a password.
Solution
$ gpg -c filename
Symmetric encryption (-c) is the simplest way to encrypt a file with gpg: just provide a password at encryption time. To decrypt, provide the password again.
By default, encrypted files are binary. To produce an ASCII text file instead, add the -a (armor) option: $ gpg -c -a filename
Binary encrypted files are created with the suffix .gpg, whereas ASCII encrypted files have the suffix .asc.
You want to decrypt a file that was encrypted with GnuPG.
Solution
Assuming the file is myfile.gpg, decrypt it in place with:
$ gpg myfile.gpg creates myfile
Decrypt to standard output:
$ gpg --decrypt myfile.gpg
Decrypt to a named plaintext file:
$ gpg --decrypt --output new_file_name myfile.gpg
source Richard E silvermann
Solution
$ gpg -c filename
Symmetric encryption (-c) is the simplest way to encrypt a file with gpg: just provide a password at encryption time. To decrypt, provide the password again.
By default, encrypted files are binary. To produce an ASCII text file instead, add the -a (armor) option: $ gpg -c -a filename
Binary encrypted files are created with the suffix .gpg, whereas ASCII encrypted files have the suffix .asc.
You want to decrypt a file that was encrypted with GnuPG.
Solution
Assuming the file is myfile.gpg, decrypt it in place with:
$ gpg myfile.gpg creates myfile
Decrypt to standard output:
$ gpg --decrypt myfile.gpg
Decrypt to a named plaintext file:
$ gpg --decrypt --output new_file_name myfile.gpg
source Richard E silvermann
Prohibiting Directory Listings
You want to prohibit directory listings for a particular directory, yet still permit the files within to be accessed by name.
Solution
Use a directory that has read permission disabled, but execute permission enabled:
$ mkdir dir
$ chmod 0111 dir
$ ls -ld dir
d--x--x--x 2 smith smith 4096 Apr 2 22:04 dir/
$ ls dir
/bin/ls: dir: Permission denied
$ echo hello world > dir/secretfile
$ cd dir
$ cat secretfile
hello world
More practically, to permit only yourself to list a directory owned by you:
$ chmod 0711 dir
$ ls -ld dir
drwx--x--x 2 smith smith 4096 Apr 2 22:04 dir/
A Directory's read permission controls whether it can be listed (eg:- via ls), and the execute permission controls whether it can be entered (eg:- via c.d). Of course the super user can still access your directory anyway he/she likes
This technique is useful for websites, where listing of directories are not permitted
source Danile J Barret
Solution
Use a directory that has read permission disabled, but execute permission enabled:
$ mkdir dir
$ chmod 0111 dir
$ ls -ld dir
d--x--x--x 2 smith smith 4096 Apr 2 22:04 dir/
$ ls dir
/bin/ls: dir: Permission denied
$ echo hello world > dir/secretfile
$ cd dir
$ cat secretfile
hello world
More practically, to permit only yourself to list a directory owned by you:
$ chmod 0711 dir
$ ls -ld dir
drwx--x--x 2 smith smith 4096 Apr 2 22:04 dir/
A Directory's read permission controls whether it can be listed (eg:- via ls), and the execute permission controls whether it can be entered (eg:- via c.d). Of course the super user can still access your directory anyway he/she likes
This technique is useful for websites, where listing of directories are not permitted
source Danile J Barret
Invoking Remote Programs
You want to invoke a program on a remote machine over a secure network connection
For non interactive commands
ssh -l remoteuser remotehost uptime
for interactive programs, add the -t option
ssh -t -l remoteuser remotehost vi
For X window applications, add the -X option to enable X forwarding.also add the -f option to background the program after authentication , and to redirect standard input fro /dev/null to avoid dangling connections.
ssh -X -f -l remoteuser remotehost xterm
or you can add the -C option to enable compression:-
ssh -C -X user@hostname gui_cmd
verified on ubuntu 8.04.1
For non interactive commands
ssh -l remoteuser remotehost uptime
for interactive programs, add the -t option
ssh -t -l remoteuser remotehost vi
For X window applications, add the -X option to enable X forwarding.also add the -f option to background the program after authentication , and to redirect standard input fro /dev/null to avoid dangling connections.
ssh -X -f -l remoteuser remotehost xterm
or you can add the -C option to enable compression:-
ssh -C -X user@hostname gui_cmd
verified on ubuntu 8.04.1
Thursday, November 20, 2008
IrDA & ubuntu
Can anyone give me an example/practical situation where IrDA protocol is being used in Ubuntu Linux ?
Thane
Afraid I don't know of any offhand. But some sports heartrate monitors can use irda to transfer data (in the evil empire win-Doh system which is unfortunately ahead of us in this respect). Polar hrm's for instance of which there are a couple in our household, use irda in some models along with other methods. The problem I found, even in the evil empire case is that depending on your motherboard, you may or may not be able to use irda for your particular application, irrespective of which OS you're using. I have 3 computers in the house plus a laptop and unfortunately only the laptop can use my irda for my Polar hrm due to the Asus mobo's in the other 3 computers. One of the few shortcomings I've found with Asus mobo's. As I seem to recall it was a problem of the brand of usb controller used in the mobo. I spent some time emailing back and forth with Polar tech support in Europe, where they have different irda adapters, and they went out of their way (for which I'm really grateful) to unexpectedly send me an irda unit used in Britain for free as a goodwill gesture and although both Polar and I thought it was going to solve my problem, the mobo components jumped in to spoil the day. Don't know what you're planning on coming up with for irda, but this one problem might be something to consider. Cheers.
Thane
Afraid I don't know of any offhand. But some sports heartrate monitors can use irda to transfer data (in the evil empire win-Doh system which is unfortunately ahead of us in this respect). Polar hrm's for instance of which there are a couple in our household, use irda in some models along with other methods. The problem I found, even in the evil empire case is that depending on your motherboard, you may or may not be able to use irda for your particular application, irrespective of which OS you're using. I have 3 computers in the house plus a laptop and unfortunately only the laptop can use my irda for my Polar hrm due to the Asus mobo's in the other 3 computers. One of the few shortcomings I've found with Asus mobo's. As I seem to recall it was a problem of the brand of usb controller used in the mobo. I spent some time emailing back and forth with Polar tech support in Europe, where they have different irda adapters, and they went out of their way (for which I'm really grateful) to unexpectedly send me an irda unit used in Britain for free as a goodwill gesture and although both Polar and I thought it was going to solve my problem, the mobo components jumped in to spoil the day. Don't know what you're planning on coming up with for irda, but this one problem might be something to consider. Cheers.
Tuesday, November 18, 2008
Offline updation in ubuntu
bobbertface
I have a desktop with Hardy installed, and I want to update and upgrade it, however, it doesn't have a wired connection, and the wireless card is not supported by the kernel. I tried installing ndiswrapper to fix this problem because my Dell Wireless 1505 Draft 802.11n WLAN Mini-Card Rev 2.0 is supported by it. The fun part is, I need the c/c++ developer files to compile and install ndiswrapper.
What would be a good way to get those libraries over to the offline computer, or would using an already compiled ndiswrapper binary work fine? (if so, any recommendations as to which one works best?)
Thanks for any help you can provide
dstew
You only need to compile ndiswrapper if the most recent Ubuntu packaged verion is not adequate.
To update or install programs off-line, you need to be aware that there are lots of dependencies to be satisfied for installations to work. You can't usually download the package you want and install it, because it will complain that it needs all these dependent packages to be installed first.
There is a service called nonetdebs that attempts to solve this problem. You create a text file of the status of your off-line system, copy it over to an on-line system, and upload it to nonetdebs. The service prepares a bunch of links to all the packages you need to install in order to update, or install a particular package. You copy the packages onto a disk or USB stick, and copy them onto your off-line system, and install them using dpkg.
Try updating first, and see if you get a newer driver that might make your wireless card operational. If that doesn't work, try the ndisgtk program. I think it might be part of Ubuntu already, or you can install it. It is a graphical front-end for ndiswrapper that lets you navigate to where the Windows driver files are, and install them. To run it, hit alt-F2 and enter
Code:
gksudo ndisgtk
khAttam
Why don't you try out:
http://offlineubuntu.awardspace.com/
It has step by step procedure to help you update and install packages to your offline ubuntu installation...
I have a desktop with Hardy installed, and I want to update and upgrade it, however, it doesn't have a wired connection, and the wireless card is not supported by the kernel. I tried installing ndiswrapper to fix this problem because my Dell Wireless 1505 Draft 802.11n WLAN Mini-Card Rev 2.0 is supported by it. The fun part is, I need the c/c++ developer files to compile and install ndiswrapper.
What would be a good way to get those libraries over to the offline computer, or would using an already compiled ndiswrapper binary work fine? (if so, any recommendations as to which one works best?)
Thanks for any help you can provide
dstew
You only need to compile ndiswrapper if the most recent Ubuntu packaged verion is not adequate.
To update or install programs off-line, you need to be aware that there are lots of dependencies to be satisfied for installations to work. You can't usually download the package you want and install it, because it will complain that it needs all these dependent packages to be installed first.
There is a service called nonetdebs that attempts to solve this problem. You create a text file of the status of your off-line system, copy it over to an on-line system, and upload it to nonetdebs. The service prepares a bunch of links to all the packages you need to install in order to update, or install a particular package. You copy the packages onto a disk or USB stick, and copy them onto your off-line system, and install them using dpkg.
Try updating first, and see if you get a newer driver that might make your wireless card operational. If that doesn't work, try the ndisgtk program. I think it might be part of Ubuntu already, or you can install it. It is a graphical front-end for ndiswrapper that lets you navigate to where the Windows driver files are, and install them. To run it, hit alt-F2 and enter
Code:
gksudo ndisgtk
khAttam
Why don't you try out:
http://offlineubuntu.awardspace.com/
It has step by step procedure to help you update and install packages to your offline ubuntu installation...
Monday, November 17, 2008
Free software and Open source software
sulekha
I am new to linux. Can anyone explain me the difference between Free software and Open source software ?
ray
In a nutshell, Open Source software must have the source code available -"free" software, i.e. "freeware" does not - the creator might distribute only the executables. Most Open Source software is distributed under one or another license which places some restrictions on reuse.
Peter Kohlmann
Thats not at all the description.
"Free software" means just that, you can't take away the freedoms of it. It usually comes with a GPL licence. You can't make it closed source
"Freeware" is something entirely different, and it is mainly a windows thing.
> Most Open Source software is distributed under one or another license which places some restrictions on reuse.
OSS does not /need/ to use the GPL or compatible licence. It can also use the BSD licence. It is still Open Source then, but under that licence anyone can pick it up, add his own code to it and market it under a non-free, closed source licence
I am new to linux. Can anyone explain me the difference between Free software and Open source software ?
ray
In a nutshell, Open Source software must have the source code available -"free" software, i.e. "freeware" does not - the creator might distribute only the executables. Most Open Source software is distributed under one or another license which places some restrictions on reuse.
Peter Kohlmann
Thats not at all the description.
"Free software" means just that, you can't take away the freedoms of it. It usually comes with a GPL licence. You can't make it closed source
"Freeware" is something entirely different, and it is mainly a windows thing.
> Most Open Source software is distributed under one or another license which places some restrictions on reuse.
OSS does not /need/ to use the GPL or compatible licence. It can also use the BSD licence. It is still Open Source then, but under that licence anyone can pick it up, add his own code to it and market it under a non-free, closed source licence
Current FSB speed
annalissa
I use pentium(R)Dual core processor E2180, with Freq 2Ghz, Core 1.35V, FSB 800 Mhz, Socket LGA775 and L2 cache 1MB now the motherboard i use in my PC is ASUS P5KPL-CM, which in its specification says that its FSB is 1600 Mhz. now my question is what exactly FSB speed that is used in my PC, what is the command in linux to get FSB speed
NB: I use ubuntu linux 8.04.1.
1PW
A chain is as weak as its weakest link; 800 MHz. Try dmidecode.
annalissa
when i gave the command in my computer in Office
sudo dmidecode --type processor 4
I got the output as
# dmidecode 2.9
SMBIOS 2.3 present.
Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: Socket 775
Type: Central Processor
Family: Pentium D
Manufacturer: Intel
ID: FD 06 00 00 FF FB EB BF
Signature: Type 0, Family 6, Model 15, Stepping 13
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Pentium(R) Dual
Voltage: 0.0 V
External Clock: 200 MHz
Max Speed: 4000 MHz
Current Speed: 2000 MHz
Status: Populated, Enabled
Upgrade: Other
L1 Cache Handle: 0x0008
L2 Cache Handle: 0x0009
L3 Cache Handle: Not Provided
Serial Number:
Asset Tag:
Part Number:
I didn't see any entry for FSB,
1PW
dmidecode allows you to "read" a system and derive the motherboard & CPU information without having to open the enclosure. From there, you can consult the specifications from the web sites of the manufacturers.
In your case, you already had the data at hand. I don't know of any performance tests that will directly measure a system's FSB speed.
Anton Ertl
> sudo dmidecode --type processor 4
...
> External Clock: 200 MHz
...
>I didn't see any entry for FSB,
It's the external clock. The FSB is quad data rate (QDR), so a 200MHz QDR FSB is usually called FSB800.
I use pentium(R)Dual core processor E2180, with Freq 2Ghz, Core 1.35V, FSB 800 Mhz, Socket LGA775 and L2 cache 1MB now the motherboard i use in my PC is ASUS P5KPL-CM, which in its specification says that its FSB is 1600 Mhz. now my question is what exactly FSB speed that is used in my PC, what is the command in linux to get FSB speed
NB: I use ubuntu linux 8.04.1.
1PW
A chain is as weak as its weakest link; 800 MHz. Try dmidecode.
annalissa
when i gave the command in my computer in Office
sudo dmidecode --type processor 4
I got the output as
# dmidecode 2.9
SMBIOS 2.3 present.
Handle 0x0004, DMI type 4, 35 bytes
Processor Information
Socket Designation: Socket 775
Type: Central Processor
Family: Pentium D
Manufacturer: Intel
ID: FD 06 00 00 FF FB EB BF
Signature: Type 0, Family 6, Model 15, Stepping 13
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
DS (Debug store)
ACPI (ACPI supported)
MMX (MMX technology supported)
FXSR (Fast floating-point save and restore)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
SS (Self-snoop)
HTT (Hyper-threading technology)
TM (Thermal monitor supported)
PBE (Pending break enabled)
Version: Intel(R) Pentium(R) Dual
Voltage: 0.0 V
External Clock: 200 MHz
Max Speed: 4000 MHz
Current Speed: 2000 MHz
Status: Populated, Enabled
Upgrade: Other
L1 Cache Handle: 0x0008
L2 Cache Handle: 0x0009
L3 Cache Handle: Not Provided
Serial Number:
Asset Tag:
Part Number:
I didn't see any entry for FSB,
1PW
dmidecode allows you to "read" a system and derive the motherboard & CPU information without having to open the enclosure. From there, you can consult the specifications from the web sites of the manufacturers.
In your case, you already had the data at hand. I don't know of any performance tests that will directly measure a system's FSB speed.
Anton Ertl
> sudo dmidecode --type processor 4
...
> External Clock: 200 MHz
...
>I didn't see any entry for FSB,
It's the external clock. The FSB is quad data rate (QDR), so a 200MHz QDR FSB is usually called FSB800.
Saturday, November 15, 2008
This incident will be reported
sulekha
whenever an user who is not in /etc/sudoers file issues the sudo command
we will get the following message
" .... is not in the sudoers file. This incident will be reported"
now my question is where does this reporting take place ?
from which file an administrator can know who all tinkered with sudo command ?
Is it /var/log/auth.log file ?
colucix
From the sudo man page:
Code:
If a user who is not listed in the sudoers file tries to run a command via sudo, mail is sent to
the proper authorities, as defined at configure time or in the sudoers file (defaults to root).
Note that the mail will not be sent if an unauthorized user tries to run sudo with the -l or -v
flags. This allows users to determine for themselves whether or not they are allowed to use sudo.
The log file is usually auth.log, as you already stated. You can see some entry like this:
Code: Nov 14 21:09:58 localhost sudo: pippo : user NOT in sudoers ; TTY=pts/1 ; PWD =/home/pippo ; USER=root ; COMMAND=/usr/bin/vi /etc/passwd
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works... and nobody knows why! (Albert Einstein)
whenever an user who is not in /etc/sudoers file issues the sudo command
we will get the following message
" .... is not in the sudoers file. This incident will be reported"
now my question is where does this reporting take place ?
from which file an administrator can know who all tinkered with sudo command ?
Is it /var/log/auth.log file ?
colucix
From the sudo man page:
Code:
If a user who is not listed in the sudoers file tries to run a command via sudo, mail is sent to
the proper authorities, as defined at configure time or in the sudoers file (defaults to root).
Note that the mail will not be sent if an unauthorized user tries to run sudo with the -l or -v
flags. This allows users to determine for themselves whether or not they are allowed to use sudo.
The log file is usually auth.log, as you already stated. You can see some entry like this:
Code: Nov 14 21:09:58 localhost sudo: pippo : user NOT in sudoers ; TTY=pts/1 ; PWD =/home/pippo ; USER=root ; COMMAND=/usr/bin/vi /etc/passwd
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works... and nobody knows why! (Albert Einstein)
Friday, November 14, 2008
Reconfiguring Fonts in Ubuntu
Basic font configuration is associated with the fontconfig-config package.
To configure fonts on the local system, run the following command:
$ sudo dpkg-reconfigure fontconfig-config
Fortunately, there are only three steps in this process. The first step refers to “Bitstream Vera (the default in Debian)” fonts. As Ubuntu Linux is a derivative of Debian Linux, this option applies to this book. Be aware that this option also supports proper rendering of Microsoft fonts.
The next step supports “subpixel rendering,” which optimizes the view of fonts on flat screens, including LCD and laptop monitors. Select Automatic if you use both LCD and older Cathode Ray Tube (CRT) monitors.
The final step allows the enabling of bitmapped fonts. The recommended default is to disable such fonts, due to the quality. Make a choice and press ENTER to continue.Changes aren’t implemented until the next time the X server is started. They are written to files in the the /etc/fonts/conf.d/ directory. The services that run the X server use the /etc/fonts/fonts.conf file, as well as related files in the /etc/fonts subdirectories.
Tested on ubuntu 8.04.1
To configure fonts on the local system, run the following command:
$ sudo dpkg-reconfigure fontconfig-config
Fortunately, there are only three steps in this process. The first step refers to “Bitstream Vera (the default in Debian)” fonts. As Ubuntu Linux is a derivative of Debian Linux, this option applies to this book. Be aware that this option also supports proper rendering of Microsoft fonts.
The next step supports “subpixel rendering,” which optimizes the view of fonts on flat screens, including LCD and laptop monitors. Select Automatic if you use both LCD and older Cathode Ray Tube (CRT) monitors.
The final step allows the enabling of bitmapped fonts. The recommended default is to disable such fonts, due to the quality. Make a choice and press ENTER to continue.Changes aren’t implemented until the next time the X server is started. They are written to files in the the /etc/fonts/conf.d/ directory. The services that run the X server use the /etc/fonts/fonts.conf file, as well as related files in the /etc/fonts subdirectories.
Tested on ubuntu 8.04.1
Wednesday, November 12, 2008
Monday, November 10, 2008
/etc/cron.daily/find script
I have read that the locate command database is normally updated only once each day,as documented in the /etc/cron.daily/find script, but i didn't find any find script in /etc/cron.daily/ directory ?
NB: i use ubuntu 8.04.1
Billymayday
Try grep updatedb /etc/cron.daily/*
In CentOS it's mlocate.cron
NB: i use ubuntu 8.04.1
Billymayday
Try grep updatedb /etc/cron.daily/*
In CentOS it's mlocate.cron
Use Ubuntu’s movie player to watch YouTube movies
Like many open source applications, Totem utilizes a plugin structure,meaning that its functionality can be expanded by add-in modules. Several are supplied out of the box, including a YouTube browser. This lets you search for and playback YouTube videos within Totem. However,
none of the plugins are activated.
To activate the YouTube plugin, start Totem (Applications → Sound & Video → Movie Player), click Edit → Plugins, and put a check alongside YouTube Browser in the list. Click the Close button and then, in the main Totem program window, select YouTube from the dropdown headed Properties at the top right. Following this a search box will appear, in which you can search for videos on YouTube. Double-click any entries in the Search Results field to play them in Totem.
Note that you might need to follow the instructions to ensure all the multimedia codecs are installed prior to playback in order to watch YouTube videos in Totem; for some reason, codec installation for YouTube videos isn’t automatic, as it is for other video file formats.
none of the plugins are activated.
To activate the YouTube plugin, start Totem (Applications → Sound & Video → Movie Player), click Edit → Plugins, and put a check alongside YouTube Browser in the list. Click the Close button and then, in the main Totem program window, select YouTube from the dropdown headed Properties at the top right. Following this a search box will appear, in which you can search for videos on YouTube. Double-click any entries in the Search Results field to play them in Totem.
Note that you might need to follow the instructions to ensure all the multimedia codecs are installed prior to playback in order to watch YouTube videos in Totem; for some reason, codec installation for YouTube videos isn’t automatic, as it is for other video file formats.
Find the Ubuntu version and code-name
If you’re sitting in front of somebody else’s Ubuntu computer and want to quickly identify which version of Ubuntu it running (not always easy to do from the look and feel if it’s heavily customized), do the following: open a terminal window and type cat /etc/lsb-release. You can also
click Help → About Ubuntu, although bear in mind this won’t show the “point release” (for example, on my 8.04.1 installation, Help → About Ubuntu only mentioned the 8.04 release). This trick can also be used to ensure that you’ve upgraded to a newer version when one is released.
source:- ubuntukungfu
click Help → About Ubuntu, although bear in mind this won’t show the “point release” (for example, on my 8.04.1 installation, Help → About Ubuntu only mentioned the 8.04 release). This trick can also be used to ensure that you’ve upgraded to a newer version when one is released.
source:- ubuntukungfu
Sunday, November 9, 2008
Adding Microsoft Fonts in ubuntu
Even if you use OpenOffice, you might still want all the Microsoft TrueType fonts so that documents created using Word or PowerPoint look as they were supposed to when you open them with OpenOffice. Also, with the Microsoft Fonts installed we browsing will be better since the pages will look as the designer originally intended them to. Most webpages are designed with Microsoft fonts in mind. The stylesheet specify these fonts. On Linux, when these specified fonts are not available on your computer, they are replaced with generic equivalents. With these fonts installed, you will see the page as it was designed. To install the fonts, all you need to do in Ubuntu is to install the msttcorefonts package.
There are two packages associated with installing Microsoft fonts on Ubuntu Linux.
They can be installed with the following command:
$ sudo apt-get install msttcorefonts ttf-xfree86-nonfree
These packages are available from the Multiverse repository
in lucid or ubuntu 10.04 just install ubuntu-restricted-extras package
see:-http://corefonts.sourceforge.net/
There are two packages associated with installing Microsoft fonts on Ubuntu Linux.
They can be installed with the following command:
$ sudo apt-get install msttcorefonts ttf-xfree86-nonfree
These packages are available from the Multiverse repository
in lucid or ubuntu 10.04 just install ubuntu-restricted-extras package
see:-http://corefonts.sourceforge.net/
Install all the multimedia playback codecs you’ll ever need in ubuntu
Install all the multimedia playback codecs you’ll ever need
Ubuntu will install the codecs you need for a multimedia file whenever you try to play it. The problem is that you have to be online for this to work. What if you’ve just installed Ubuntu and are about to hop on a plane, with the intention of watching movies during the journey? To
install all the usual codecs before leaving the house, click Applications → Add/Remove and then, in the Show dropdown list, select All Available Applications. Ensure All is selected in the list on the left, and then use
the Search box to search for gstreamer. In the list of results, put a check
alongside the following—once done, click the Apply Changes button:
GStreamer extra plugins
GStreamer ffmpeg video plugin
Ubuntu restricted extras
GStreamer plugins for mms, wavpack, quicktime, musepack
GStreamer plugins for aac, xvid, mpeg2, faad
GStreamer fluendo MPEG2 demuxing plugin
Once the software is installed (it may take some time, and you might have to agree to one or two license agreements that will pop-up), click the Close button in the dialog that appears.
To enable DVD movie playback, you’ll need to complete one extra step. Ensure Synpatic is closed (and no other software installation application is currently running, such as Update Manager), and then open a terminal window. Type the following:
$ sudo /usr/share/doc/libdvdread3/install-css.sh
Note that you will need to install the Xine version of Totem Movie Player if you want fuss-free DVD movie playback.
source ubuntu kungfu
NB: tested on ubuntu 8.04.1
Ubuntu will install the codecs you need for a multimedia file whenever you try to play it. The problem is that you have to be online for this to work. What if you’ve just installed Ubuntu and are about to hop on a plane, with the intention of watching movies during the journey? To
install all the usual codecs before leaving the house, click Applications → Add/Remove and then, in the Show dropdown list, select All Available Applications. Ensure All is selected in the list on the left, and then use
the Search box to search for gstreamer. In the list of results, put a check
alongside the following—once done, click the Apply Changes button:
GStreamer extra plugins
GStreamer ffmpeg video plugin
Ubuntu restricted extras
GStreamer plugins for mms, wavpack, quicktime, musepack
GStreamer plugins for aac, xvid, mpeg2, faad
GStreamer fluendo MPEG2 demuxing plugin
Once the software is installed (it may take some time, and you might have to agree to one or two license agreements that will pop-up), click the Close button in the dialog that appears.
To enable DVD movie playback, you’ll need to complete one extra step. Ensure Synpatic is closed (and no other software installation application is currently running, such as Update Manager), and then open a terminal window. Type the following:
$ sudo /usr/share/doc/libdvdread3/install-css.sh
Note that you will need to install the Xine version of Totem Movie Player if you want fuss-free DVD movie playback.
source ubuntu kungfu
NB: tested on ubuntu 8.04.1
Copy Shell Prompt Output To Linux / UNIX X Clipboard Directly
Posted By vivek On October 24, 2008 @ 8:41 pm In BASH Shell, CentOS, Debian / Ubuntu, Gnome, Linux, Package management, RedHat and Friends, Solaris-Unix, Suse, Ubuntu Linux, X Server | No Comments
Q. How do I copy output of command to Linux Gnome clipboard? How do I send files directly to X Windows clipboard from a shell prompt? How do I insert command line output or files contains into the clipboard?
A. You can copy command line output to X Windows clipboard directly using xclip command. You can read from standard input (keyboard), or from one or more files, and makes the data available as an X selection for pasting into any X applications such as gedit, OpenOffice or Firefox / email client. You can also print current X selection to standard out (screen or printer) form a shell prompt.
A note about Linux / UNIX X Server CLIPBOARD
There are totally 3 clipboards maintained by the X server as follows:
* PRIMARY: The PRIMARY selection is conventionally used to implement copying and pasting via the middle mouse button. xclip command use this by default. So you need to hit middle button to paste data.
* SECONDARY: This is less frequently used by X application. You need to use XA_SECONDARY constant to select this clipboard.
* CLIPBOARD: Same as SECONDARY, use XA_CLIPBOARD constant to select clipboard.
xclip - Linux / UNIX Command line clipboard grabber
You can install xclip using any one of the following method:
Install xclip under Debian / Ubuntu Linux
Type the following command at shell prompt:
$ sudo apt-get install xclip
Install xclip under Red hat / CentOS / RHEL / Fedora Linux
Type the following command at shell prompt (make sure 3rd party repos are activated):
# yum install xclip
How do I use xclip command?
Copy output of the following command to clipboard:
$ sort -n -k 3, -k 2 file.txt | xclip
How do I paste output to GUI applications?
Just press middle click (mouse button) in an X application to paste data.
Task: Insert files contains into the clipboard
Send data.txt contains to the clipboard, enter:
$ cat data.txt | xclips
Task: Paste data from the clipboard
Copy data using CTRL + C or middle mouse button. Type the following command to paste output:
$ xclip -o
Put the contents of the selection into a file.
$ xclip -o > file.txt
Loop option
The -l (-loop) option help to send number of x selection requests (pastes into X applications) to wait for before exiting. For example start xclip and exit only after text has been pasted 10 times.
$ who | xclip -loops 3 -verbose
Task: Select secondary clipboard
$ uptime | xclip -selection XA_SECONDARY
xsel command
xsel is xclip like command which can be used to retrieve and set the X selection (copy and paste operations) with few additional options. Type the following command to install xsel:
$ sudo apt-get install xsel
xsel examples
Copy output of pwd command in the X selection. Then middle click in an X application to paste:
$ pwd | xsel
Put /etc/passwd in the X selection. Then middle click in an X application to paste:
$ cat /etc/passwd | xsel
Further readings:
1. man page xsel and xclip
Q. How do I copy output of command to Linux Gnome clipboard? How do I send files directly to X Windows clipboard from a shell prompt? How do I insert command line output or files contains into the clipboard?
A. You can copy command line output to X Windows clipboard directly using xclip command. You can read from standard input (keyboard), or from one or more files, and makes the data available as an X selection for pasting into any X applications such as gedit, OpenOffice or Firefox / email client. You can also print current X selection to standard out (screen or printer) form a shell prompt.
A note about Linux / UNIX X Server CLIPBOARD
There are totally 3 clipboards maintained by the X server as follows:
* PRIMARY: The PRIMARY selection is conventionally used to implement copying and pasting via the middle mouse button. xclip command use this by default. So you need to hit middle button to paste data.
* SECONDARY: This is less frequently used by X application. You need to use XA_SECONDARY constant to select this clipboard.
* CLIPBOARD: Same as SECONDARY, use XA_CLIPBOARD constant to select clipboard.
xclip - Linux / UNIX Command line clipboard grabber
You can install xclip using any one of the following method:
Install xclip under Debian / Ubuntu Linux
Type the following command at shell prompt:
$ sudo apt-get install xclip
Install xclip under Red hat / CentOS / RHEL / Fedora Linux
Type the following command at shell prompt (make sure 3rd party repos are activated):
# yum install xclip
How do I use xclip command?
Copy output of the following command to clipboard:
$ sort -n -k 3, -k 2 file.txt | xclip
How do I paste output to GUI applications?
Just press middle click (mouse button) in an X application to paste data.
Task: Insert files contains into the clipboard
Send data.txt contains to the clipboard, enter:
$ cat data.txt | xclips
Task: Paste data from the clipboard
Copy data using CTRL + C or middle mouse button. Type the following command to paste output:
$ xclip -o
Put the contents of the selection into a file.
$ xclip -o > file.txt
Loop option
The -l (-loop) option help to send number of x selection requests (pastes into X applications) to wait for before exiting. For example start xclip and exit only after text has been pasted 10 times.
$ who | xclip -loops 3 -verbose
Task: Select secondary clipboard
$ uptime | xclip -selection XA_SECONDARY
xsel command
xsel is xclip like command which can be used to retrieve and set the X selection (copy and paste operations) with few additional options. Type the following command to install xsel:
$ sudo apt-get install xsel
xsel examples
Copy output of pwd command in the X selection. Then middle click in an X application to paste:
$ pwd | xsel
Put /etc/passwd in the X selection. Then middle click in an X application to paste:
$ cat /etc/passwd | xsel
Further readings:
1. man page xsel and xclip
/etc/gshadow
what exactly is the the purpose of /etc/gshadow file ?
klearview
It stores group passwords - a not that often used feature.
cdenley
man gshadow
Apparently groups can have passwords, too.
klearview
It stores group passwords - a not that often used feature.
cdenley
man gshadow
Apparently groups can have passwords, too.
Friday, November 7, 2008
Run two (or more) desktops at the same time
Ubuntu offers the handy User Switcher applet at the top right of the desktop to switch between the desktop of two or more users. This is cleverer than it might first seem. When it’s used to switch to a second user, a new X server is started for them in addition to the existing one. You’re supposed to use the applet to switch between the two users but you can switch between X servers by holding down Ctrl + Alt and hitting F7 and F9 .
Should you need to, you can manually start your own additional X servers for users. Assuming you’ve created a new account, switch to a virtual console (this won’t work from a terminal window!), and then login as the new user.
Then type the following: $ startx -- :1
A desktop GUI will then start for the new user. To switch back to the already logged in user’s desktop, hit Ctrl + Alt + F7 . To switch to the new user’s desktop, hit Ctrl + Alt + F9 .
The above step can be repeated to create yet more concurrent desktops for other users: for example, to concurrently run a desktop for a third user, just switch to the next virtual console, login as that user, and type startx -- :2. That user’s desktop will then appear, and you can switch to other desktops as described above, and back to the third user’s desktop by hitting Ctrl + Alt + F10 .
Should you need to, you can manually start your own additional X servers for users. Assuming you’ve created a new account, switch to a virtual console (this won’t work from a terminal window!), and then login as the new user.
Then type the following: $ startx -- :1
A desktop GUI will then start for the new user. To switch back to the already logged in user’s desktop, hit Ctrl + Alt + F7 . To switch to the new user’s desktop, hit Ctrl + Alt + F9 .
The above step can be repeated to create yet more concurrent desktops for other users: for example, to concurrently run a desktop for a third user, just switch to the next virtual console, login as that user, and type startx -- :2. That user’s desktop will then appear, and you can switch to other desktops as described above, and back to the third user’s desktop by hitting Ctrl + Alt + F10 .
How-To: Find missing packages with apt-file
apt-file is a command line tool for searching packages in Debian/Ubuntu repositories.
Unlike apt-cache search, apt-file can find files in uninstalled or can list the content of uninstalled packages.
This tutorial will show how to install apt-file, update and search or list packages and files.
Have you ever search which package contains a certain file. One could use:
dpkg -S /path/to/file
This will do the job unless the package is not yet installed.
Hopefully, both Debian and Ubuntu have a package repository, http://packages.debian.org/ and http://packages.ubuntu.com.
Command line lover will love apt-file which will do the same job, but you won't have to use your web browser.
To install apt-file, simply run:
$ apt-get install apt-file
Then we need to update apt-file database with:
$ sudo apt-file update
After some times, once the Contents files are downloaded from the repositories, you will be able to query the database for myfile or path/to/myfile with the following commands:
$ apt-file search myfile
or
$ apt-file search path/to/myfile
Listing the content of an uninstalled package can be done with:
$ apt-file list mypackage
Finally, you can delete the cache files with:
$ sudo apt-file purge
source debuntu.org
Unlike apt-cache search, apt-file can find files in uninstalled or can list the content of uninstalled packages.
This tutorial will show how to install apt-file, update and search or list packages and files.
Have you ever search which package contains a certain file. One could use:
dpkg -S /path/to/file
This will do the job unless the package is not yet installed.
Hopefully, both Debian and Ubuntu have a package repository, http://packages.debian.org/ and http://packages.ubuntu.com.
Command line lover will love apt-file which will do the same job, but you won't have to use your web browser.
To install apt-file, simply run:
$ apt-get install apt-file
Then we need to update apt-file database with:
$ sudo apt-file update
After some times, once the Contents files are downloaded from the repositories, you will be able to query the database for myfile or path/to/myfile with the following commands:
$ apt-file search myfile
or
$ apt-file search path/to/myfile
Listing the content of an uninstalled package can be done with:
$ apt-file list mypackage
Finally, you can delete the cache files with:
$ sudo apt-file purge
source debuntu.org
check/identify bad sector in hard disk ?
what is the command/method/procedure to check/identify bad sector in hard disk ?
Jim
Boot up with the LiveCD and run fsck in a terminal:
Code: sudo fsck -a /dev/sdxx
Where /dev/sdxx is you hard drive and partition.
Jim
Boot up with the LiveCD and run fsck in a terminal:
Code: sudo fsck -a /dev/sdxx
Where /dev/sdxx is you hard drive and partition.
Thursday, November 6, 2008
10 (real) reasons to use ubuntu linux
Recently, a friend of mine asked me why I used linux. Being a linux user for more than 5 years, I have a lot of reasons on why to choose linux over windows, but nothing came to my mind at the time. I just knew I like it a lot better than windows. To settle things up, and have a more objective answer next time, I put some thought to it and came with this list.
In this post, I will evaluate all the reasons regarding the current distribution I use, which is Ubuntu. However, by no means I say that everyone should use linux. You may use it as long as it fits your needs, and i’m aware that many people cannot live without applications that were developed only for windows.
10. Package management system
In windows, one have to dig around the internet trying to find applications to install, and pray that they won’t come full of viruses. In linux, there is a wonderful thing called packages, and a neat little program called Synaptic where it is possible to just type whatever application you want and it will automatically download and install, all of that without any virus and 100% free.
9. Graphical interface
Yes, with vista, windows can now do a lot of stuff linux can. But one would have to install a ton of additional software. I got so addicted to the exposé, multiple desktops, and being able to make a window translucent that I miss these features a lot when I go back to windows. Also, the application menu of gnome is terrific when new installed applications automatically appear under the right category, making it easier to find the desired program.
The top bar is also a plus. Right now, I have a in-bar weather and CPU usage applet that come in handy. Although you can put them on the desktop on windows, I’m not sure you can put them on the bar without any external program.
8. Hardware Detection
This is one of the best features on linux, and can also be the worse. After installation is done, or wheter you plug in a new hardware, everything is detected and installed automatically. No hunt for drivers is needed. I just installed Ubuntu on a friend’s laptop and we didn’t need any extra configuration to get things working. Everything worked out of the box.
However, I have to admit that when something is not detected right away, it is a pain to set up properly. Most of the times, one would have to dig through several forums in order to figure out how to install a particular piece of hardware.
7. Process control
Linux is stable by nature, but sometimes things may go out of control. When that happens, a little tool called “xkill” comes in handy, by literally killing the trouble application instantly without messing up with system stability. Also, the “kill” command does the same thing for every process in the system. Unlike windows, you don’t have to wait for the process to shut itself down, and waste a lot of time. The process is killed instantly.
Another tool I miss in windows is the sysrq+s sysrq+u sysrq+b key combination. No matter where you are on linux, if you press that sequence, it will automatically unmount partitions and reboot the system. I have lost count on how many times I had to press the reset button on windows in order to get the machine rebooted because it wasn’t responding to any of my commands.
6. The terminal
Not many regular users would use it, but the terminal is a powerfull tool for power users. You can do anything you want with it, and most of the linux commands can be piped together to form more complex statements. I have lots of custom scripts that I use regularly to automate boring tasks such as renaming pictures, mounting encrypted filesystems, and even checking out code from a repository and deploy it automatically to a server.
5. Low system overhead
Vista needs at least 1GB of RAM in order to function properly. I used to run Ubuntu with full graphical interface with 512mb without a problem. The footprint of ubuntu over vista is considerably lower, giving more room to load more applications at one time. This is particularly useful when working with older hardware or thin clients.
4. System security
Vista introduced a series of annoying boxes that are prompted whenever you are about to make any system changes. I found that particularly annoying, and love the fact that linux only asks for the root password for very specific system settings.
Due to the open source nature of linux and its software community, security bugs are identified and fixed a lot quicker than in propietary software, making the system considerably more secure.
3. No viruses or trojan horses
The only real menace I know for linux are the rootkits, and even those need to exploit some bug. However, chances are that the particular bug in question was already fixed by security updates.
Although not really necessary if you aren’t running a server, a firewall is a plus in terms of increasing the security of your system. Nothing I know in windows can beat a well configured iptables, and few things can be more annoying than those security pop ups that appear in vista when some program wants to access the internet.
Finally, there is no need to waste your resources having an antivirus running all the time. Linux was built to be safe, so you can be sure that you won’t need any additional software constantly scanning for threats.
2. Fast release time
Thats particularly true with ubuntu: there is a new version comming around every 6 months with new and improved features. This beats by far the release cycle of windows, that can be as long as 2 or 3 years. Another good point is that your oppinion matters. If you find something wrong with your system, you can file a bug on lunchpad, and that will go directly to the developers of the system.
1. It’s free
This is a cliché, but it doesn’t mean it is not a good thing. I’m a cheap person, and I really like the fact that I can upgrade all my computers every six months to a state-of-art operational system without spending a penny out of my pocket.
In this post, I will evaluate all the reasons regarding the current distribution I use, which is Ubuntu. However, by no means I say that everyone should use linux. You may use it as long as it fits your needs, and i’m aware that many people cannot live without applications that were developed only for windows.
10. Package management system
In windows, one have to dig around the internet trying to find applications to install, and pray that they won’t come full of viruses. In linux, there is a wonderful thing called packages, and a neat little program called Synaptic where it is possible to just type whatever application you want and it will automatically download and install, all of that without any virus and 100% free.
9. Graphical interface
Yes, with vista, windows can now do a lot of stuff linux can. But one would have to install a ton of additional software. I got so addicted to the exposé, multiple desktops, and being able to make a window translucent that I miss these features a lot when I go back to windows. Also, the application menu of gnome is terrific when new installed applications automatically appear under the right category, making it easier to find the desired program.
The top bar is also a plus. Right now, I have a in-bar weather and CPU usage applet that come in handy. Although you can put them on the desktop on windows, I’m not sure you can put them on the bar without any external program.
8. Hardware Detection
This is one of the best features on linux, and can also be the worse. After installation is done, or wheter you plug in a new hardware, everything is detected and installed automatically. No hunt for drivers is needed. I just installed Ubuntu on a friend’s laptop and we didn’t need any extra configuration to get things working. Everything worked out of the box.
However, I have to admit that when something is not detected right away, it is a pain to set up properly. Most of the times, one would have to dig through several forums in order to figure out how to install a particular piece of hardware.
7. Process control
Linux is stable by nature, but sometimes things may go out of control. When that happens, a little tool called “xkill” comes in handy, by literally killing the trouble application instantly without messing up with system stability. Also, the “kill” command does the same thing for every process in the system. Unlike windows, you don’t have to wait for the process to shut itself down, and waste a lot of time. The process is killed instantly.
Another tool I miss in windows is the sysrq+s sysrq+u sysrq+b key combination. No matter where you are on linux, if you press that sequence, it will automatically unmount partitions and reboot the system. I have lost count on how many times I had to press the reset button on windows in order to get the machine rebooted because it wasn’t responding to any of my commands.
6. The terminal
Not many regular users would use it, but the terminal is a powerfull tool for power users. You can do anything you want with it, and most of the linux commands can be piped together to form more complex statements. I have lots of custom scripts that I use regularly to automate boring tasks such as renaming pictures, mounting encrypted filesystems, and even checking out code from a repository and deploy it automatically to a server.
5. Low system overhead
Vista needs at least 1GB of RAM in order to function properly. I used to run Ubuntu with full graphical interface with 512mb without a problem. The footprint of ubuntu over vista is considerably lower, giving more room to load more applications at one time. This is particularly useful when working with older hardware or thin clients.
4. System security
Vista introduced a series of annoying boxes that are prompted whenever you are about to make any system changes. I found that particularly annoying, and love the fact that linux only asks for the root password for very specific system settings.
Due to the open source nature of linux and its software community, security bugs are identified and fixed a lot quicker than in propietary software, making the system considerably more secure.
3. No viruses or trojan horses
The only real menace I know for linux are the rootkits, and even those need to exploit some bug. However, chances are that the particular bug in question was already fixed by security updates.
Although not really necessary if you aren’t running a server, a firewall is a plus in terms of increasing the security of your system. Nothing I know in windows can beat a well configured iptables, and few things can be more annoying than those security pop ups that appear in vista when some program wants to access the internet.
Finally, there is no need to waste your resources having an antivirus running all the time. Linux was built to be safe, so you can be sure that you won’t need any additional software constantly scanning for threats.
2. Fast release time
Thats particularly true with ubuntu: there is a new version comming around every 6 months with new and improved features. This beats by far the release cycle of windows, that can be as long as 2 or 3 years. Another good point is that your oppinion matters. If you find something wrong with your system, you can file a bug on lunchpad, and that will go directly to the developers of the system.
1. It’s free
This is a cliché, but it doesn’t mean it is not a good thing. I’m a cheap person, and I really like the fact that I can upgrade all my computers every six months to a state-of-art operational system without spending a penny out of my pocket.
Wednesday, November 5, 2008
/etc/bash.bashrc file ?
I was going through the book "Ubuntu Certified Professional Study Guide" by Michael Jang, the following were the points given in that book
function of /etc/bash.bashrc file ?
■ It assigns a prompt, which is what you see just before the cursor at the command prompt.
■ It includes settings from /etc/bash_completion to enable command completion.
■ It configures messages associated with sudo access; for more information
Is there any other poin t that the nauthor has missed ?
Erik hahn
* Set envrionment variablas, e.g. $EDITOR
* Start things like the gpg/ssh agent.
* Generally configure the shell (completion, history settings etc.)
* Setting aliases
Michael black
I't s a place to put things that you want when a bash shell is started up. That includes the things you mention, but by merely listing things you are overlooking the overall explanation that is most correct.
David H
/etc/bash.bashrc (also just .bashrc in some distros) is the basic system wide configuration file for interactive bash shells. Anything you put in it will be activated/run whenever a new bash console is opened. You can put things like aliases and shell functions in it, for example, or use it to set environment variables, or change whatever other bash settings you want.
And of course, like many similar *nix configuration files, there's also a corresponding ~/.bashrc in each user's home directory for customizing settings for each individual user.
function of /etc/bash.bashrc file ?
■ It assigns a prompt, which is what you see just before the cursor at the command prompt.
■ It includes settings from /etc/bash_completion to enable command completion.
■ It configures messages associated with sudo access; for more information
Is there any other poin t that the nauthor has missed ?
Erik hahn
* Set envrionment variablas, e.g. $EDITOR
* Start things like the gpg/ssh agent.
* Generally configure the shell (completion, history settings etc.)
* Setting aliases
Michael black
I't s a place to put things that you want when a bash shell is started up. That includes the things you mention, but by merely listing things you are overlooking the overall explanation that is most correct.
David H
/etc/bash.bashrc (also just .bashrc in some distros) is the basic system wide configuration file for interactive bash shells. Anything you put in it will be activated/run whenever a new bash console is opened. You can put things like aliases and shell functions in it, for example, or use it to set environment variables, or change whatever other bash settings you want.
And of course, like many similar *nix configuration files, there's also a corresponding ~/.bashrc in each user's home directory for customizing settings for each individual user.
/lib, /sbin directories
why is it said that /lib, /sbin directories should not be mounted on a separate partition ?
Laurenz Albe
Because they belong to the root file system.Without the files in these directories the system is unusable.These files should be there after / is mounted.
How, for example, do you want to start the init process, that eventually mounts the other file systems? The executable is /sbin/init.
Doug FreyBurger
Compiled binaries in a bin directory tend to reference compiled libraries in a lib directory. Most of the binaries in /sbin are statically linked but some can reference /lib. Since the first
filesystem mounted is root and the first binaries referenced are in /sbin they must be capable of running with no reference at all to any directory tree outside of /.
At install time there are options to move all sorts of directories to their own mount points. /opt and /usr don't have any issues like that. /sbin and /lib do have that issue.
The other directory that absolutely must be in the boot mount point is /etc because /etc/inittab lives there plus the scripts that do the mounts of all the other local file systems. Once
the rest of the local file systems are mounted it becomes less important where a executable binary is versus where its library binaries are.
Laurenz Albe
Because they belong to the root file system.Without the files in these directories the system is unusable.These files should be there after / is mounted.
How, for example, do you want to start the init process, that eventually mounts the other file systems? The executable is /sbin/init.
Doug FreyBurger
Compiled binaries in a bin directory tend to reference compiled libraries in a lib directory. Most of the binaries in /sbin are statically linked but some can reference /lib. Since the first
filesystem mounted is root and the first binaries referenced are in /sbin they must be capable of running with no reference at all to any directory tree outside of /.
At install time there are options to move all sorts of directories to their own mount points. /opt and /usr don't have any issues like that. /sbin and /lib do have that issue.
The other directory that absolutely must be in the boot mount point is /etc because /etc/inittab lives there plus the scripts that do the mounts of all the other local file systems. Once
the rest of the local file systems are mounted it becomes less important where a executable binary is versus where its library binaries are.
Sunday, November 2, 2008
umount: /media/usbdisk: device is busy
if you try to unmount a partition and get a message
like this:
# umount /media/usbdisk/
umount: /media/usbdisk: device is busy
use the lsof command to find out what programs are using what files:
EX: lsof +D /media/usb
Find the process that’s opened the file from a specified directory. You can use this if you cannot unmount a USB drive and want to know which file is open.
# lsof /media/usbdisk/

This shows that the programs bash and xmms are using
the device. For an even clearer picture, use the device
name rather than the mountpoint:
# lsof /dev/sdb1

You either can wait until those processes exit or terminate them manually.
OR you can Force umount when the device is busy fuser -km /mnt/hda2
like this:
# umount /media/usbdisk/
umount: /media/usbdisk: device is busy
use the lsof command to find out what programs are using what files:
EX: lsof +D /media/usb
Find the process that’s opened the file from a specified directory. You can use this if you cannot unmount a USB drive and want to know which file is open.
# lsof /media/usbdisk/

This shows that the programs bash and xmms are using
the device. For an even clearer picture, use the device
name rather than the mountpoint:
# lsof /dev/sdb1

You either can wait until those processes exit or terminate them manually.
OR you can Force umount when the device is busy fuser -km /mnt/hda2
Subscribe to:
Comments (Atom)