Sunday, August 31, 2008

ubuntu archive of past threads

an archive of past threads: https://lists.ubuntu.com/archives/ubuntu-users

ubuntu screen casts

http://screencasts.ubuntu.com/

ubuntu installation methods

See: https://wiki.ubuntu.com/Testing/InstallMethods

ubuntu magazines/ newletters

weekly newsletter

https://wiki.ubuntu.com/UbuntuWeeklyNewsletter?action=show&redirect=UWN

Ubuntu Magazine

http://fullcirclemagazine.org

mac osx and bash

annalissa


I have read in the book "Ubuntu Linux Tool Box" by Christopher Negus and Francois caen that: bash is the shell used by default by most modern linux systems and quite few other operating systems such as Mac OSX.

1 To what extent these statements are true especially regarding Mac OSX
2 why Mac OSX is providing a bash shell, is it something similar to cygwin ?


aloshbennet

Mac OS X is based on unix, and not just a unix-like-environment like cygwin. By default, OS X ships with bash as its terminal shell.

Tip: you can always find your shell by trying Quote:ps $$


Rocket2DMn

For the record, OSX is based off of BSD which is based off of UNIX.


uselpa


1. bash is the default shell for most Linux distros and also for Mac OS X. It is not the default shell for *BSD, for example.

2. A lot of things can be done on a shell level in Mac OS X, it's not a GUI-only system.


chort

[chort@horus4 chort]$ uname -a
Darwin horus4.smtps.net 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
[chort@horus4 chort]$ echo $SHELL
/bin/bash

Bash is the shell that most novice users are likely to be familiar with, hence why OS X uses it (instead of say, ksh).



hymntolife

1. It is true to some extend. AFAIK, Mac OS X is the only non-GNU OS that uses Bash as its default shell.

2. No, it is not a hack like Cygwin. Unlike Windows, Mac OS X is a true UNIX-like OS, so I guess Bash was just compiled for it the same way it is compiled on Linux.


sundialsvcs

For all the "pretty Macintosh picture" that OS/X works so hard to create, underneath that cover there beats the strong heart of ... Unix. Shell and all.

Friday, August 29, 2008

How to Install Media Codecs for Flash, DVD, QuickTime (MOV), MP3, WMV, WMA, and ACC (MP4, M4A) Playback in Linux [Ubuntu Guide]

Due to copyrights, Ubuntu (currently Hardy Heron 8.04) is distributed without codecs to play many of the most prevalent media formats including DVD video (unencrypted and encrypted), Flash (.swf and .flv extensions), QuickTime movies (.mov ), MP3s (.mp3), Windows Media Audio and Video (.wma and .wmv), and unencrypted ACC files (.acc, .mp4, and .m4a). Luckily, these codecs are easy to install. This guide shows you how.



Step 1: Add Medibuntu to Your Repository List

Several of the codecs installed below are not in the default Ubuntu repositories. They are instead in the Medibuntu repository. Open a terminal and use the wget http file retrieval program to add a path to the Medibuntu repositories to your system source list. (Note that the command below has wrapped to a second line, but it is a single command and should be typed without any carriage returns.)
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O
/etc/apt/sources.list.d/medibuntu.list

This command writes the path to the Medibuntu repository to a file called medibuntu.list in the appropriate directory.

Next you have to install Medibuntu’s GPG key to ensure proper authentication.
sudo aptitude install medibuntu-keyring

When prompted, type “Yes” to complete the package installation. Finally, update the list of repositories available to the aptitude package management program on your system.
sudo aptitude update
Step 2: Install Flash Plugins for Firefox

To start viewing YouTube videos with Ubuntu, you have to install the Flash browser plugin. The following command should do the trick.
sudo aptitude install flashplugin-nonfree

I know this installs the plugin for Firefox. If you determine that this command works for other browsers as well, please leave a comment below.
Step 3: Installing Audio and Video Codecs

You can get most audio and video file formats working by installing a single package from the Medibuntu repository. If you are using a machine with a 32 bit processor, type the following command in the terminal.
sudo aptitude install w32codecs

If you have a 64 bit processor, replace w32codecs with w64codecs. If you have a PowerPC based machine I believe the appropriate package is ppc-codecs. If you install this codec and still do not hear sound when playing media files, make sure that your speakers are not muted. I discovered that by default my machine had sound muted. You can easily change volume levels by right clicking on the speaker icon in the status bar at the top of the screen.



Step 4: Installing DVD Playback Packages

The following command installs packages needed for DVD playback and DVD menu navigation functionality.
sudo aptitude install libdvdcss2 libdvdread3 libdvdnav4

However, before most DVDs will play, you need to set the region code of you DVD drive. Install the regionset package.
sudo aptitude install regionset

Next, put a DVD encoded for your region in the DVD drive and type the following at the command prompt replacing the XXXXX with your DVD drive’s device name. (Mine is cdrom1 and yours is probably something with a similar prefix but possibly a different trailing number. All of your devices are listed in the /dev directory. If you type the wrong device name the regionset command will fail to compete and you can just try again.)
regionset /dev/XXXXX

When prompted enter your region code number (The United States and Canada are region 1).
Step 5: Installing DVD Playback Programs

Ubuntu is distributed with Totem for viewing video, but Totem is very bad at playing DVDs. For example, Totem does not include support for DVD menus. Two alternative programs are Xine and the related Totex-Xine. I prefer Xine but it is a little more difficult to configure (more options) than Totem-Xine. I recommend installing and trying them both. The following command will install Xine with some supporting codecs.
sudo aptitude install xine-ui libxine-extracodecs libxine1-ffmpeg

To run Xine type xine at the command prompt or navigate to Applications > Sound & Video > xine. The following command will install Totem-Xine and a Totem-Xine Firefox plugin.
sudo aptitude install totem-xine totem-xine-firefox-plugin

After these packages finish installing, type totem-xine at the command prompt to run the program. That about does it. Enjoy listening and viewing your favorite media on Ubuntu. If you know of packages that I omitted from this guide but would enhance the Ubuntu user experience, please leave a comment below. For more Ubuntu tips check out the related posts linked to below.


Add 7z (7-Zip) File Archive Support to Ubuntu

A default Ubuntu installation can’t extract or create 7z files. A package is available in the universe repositories that makes working for these files seamless with Ubuntu’s existing archive tools.

Install 7z file archive support from the package p7zip (click the link to install), or by running the command below in your terminal:
sudo apt-get install p7zip

You can now create 7z archives by right-clicking a file or folder and selecting Create Archive, and selecting the 7z option. Open a 7z archive by double clicking it.

Occasionally I’ll get an E_NOTIMPL error compressing a large number of files using Create Archive. This error should be safe to ignore.

p7zip is easy to use on the command line. To compress a file, mystuff to mystuff.7z:
p7zip mystuff

To decompress the archive:
p7zip -d mystuff.7z

chkrootkit

looking for rootkits

you want to check for evidence that a rootkit has been run on your system

soln download and install the program chkrootkit

logging into a remote host

ssh -l remoteuser remotehost
ex:- ssh -l paul server.example.com

if your local and remote user names are the same , omit the -l option

To know what an unfamiliar process is doing ?

soln :-

to attach to a running process and trace system calls

strace -p pid or strace -c ls >/dev/null
(Display system calls made and received by a process)


to trace network system calls

strace -e trace=network,read,write......

ex:-

strace -e trace=network,read,write ping 192.168.40.7

read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@!\0\000"..., 512) = 512
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512
socket(PF_INET, SOCK_RAW, IPPROTO_ICMP) = -1 EPERM (Operation not permitted)
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(1025), sin_addr=inet_addr("192.168.40.7")}, 16) = 0
getsockname(3, {sa_family=AF_INET, sin_port=htons(38430), sin_addr=inet_addr("192.168.40.230")}, [16]) = 0
write(3, "ping: icmp open socket: Operatio"..., 48ping: icmp open socket: Operation not permitted
) = 48
Process 7953 detached

Thursday, August 28, 2008

Wubdepends

Wubdepends

* Introduction
* About
* Downloads
* Contact

Wubdepends enables a user of an offline ubuntu computer to download packages and all their dependencies on another computer, to then be transferred to their ubuntu pc and installed without issue.
Latest News or Comments

13/6/07: New website. Enjoy! »

6/6/07: Initial Release of Wubdepends, source and windows binary available. Version 0.3 Enjoy! »

5/6/07: Sourceforge accepted hosting of Wubdepends. Enjoy! »
Sub Navigation

* Introduction
* About
* Downloads
* Contact

Search

1. Introduction
2. About
3. Downloads
4. Contact

Introduction

Wubdepends is a tool that enables a user to download any package in the ubuntu repositories, its dependencies and every tier of its dependencies dependencies.
About the Author

My name is Chris and I hope you find this tool useful! It is written in Python+GTK+Glade.

If you find this tool useful, please consider donating some money to the project to aid further development:

Support This Project
Downloads

Download the .exe for windows and the source files so you can run wubdepends on linux and other platforms from here.
Wubdepends dependencies

* Python
* Pygtk
* Libglade

The windows .exe file has no dependencies.
Contact

You can contact me on christhemonkey@users.sourceforge.net

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

What does OEM mode install do?

OEMs in this sense are original equipment manufacturers -- vendors of pre-built computer hardware systems -- complete PCs and servers, not to be confused with hardware manufacturers. Often referred to colloquially as "white box" vendors, OEMs include a range of PC makers, from one-man garage PC shops to customization-friendly Web stores to high-volume business suppliers.

Using the OEM installation option, computer resellers can pre-install and verify Ubuntu on machines slated for sale or redistribution, but leave select configuration details, locale and language preferences, and user account creation to the retail purchaser.

Monday, August 25, 2008

promisc mode

i typed man ifconfig in my terminal to get the following

-promisc

Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.

i have also read that promiscuous mode is enabled only for certain troubleshooting situations/applications.

can any one give the situations where promiscuous mode is enabled ?

xxxx

For example when you want to monitor or analyse your network traffic. Remember that you will be able to see all network traffic as long as your switch/bridge/gateway/router allows this

mellowd

promiscuous mode is where your network cards captures all packets, regardless of whether it was addressed to it or not. This can help with troubleshooting.

It can also be used to sniff out passwords and the like!


Generally you don't need it. For normal day to day use it isn't required.

installation

i installed kdebase package as follows

sudo dpkg -i kdebase-bin_3.5.9-0ubuntu7_i386.deb
(Reading database ... 111158 files and directories currently installed.)
Preparing to replace kdebase-bin 4:3.5.9-0ubuntu7 (using kdebase-bin_3.5.9-0ubuntu7_i386.deb) ...
Unpacking replacement kdebase-bin ...
Setting up kdebase-bin (4:3.5.9-0ubuntu7) ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place

1) what is meant by "Processing triggers for libc6" ?
2) what is meant by "ldconfig deferred processing now taking place" ?


Some package installed a lib and require ldconfig to be run, thanks to the trigger system ldconfig is now ran only once, when all packages have been installed (same for the update of the initramfs). This should make large upgrades much faster :)

what is ldconfig ?

Definition: ldconfig: Ldconfig is a basic system program which determines run-time linkbindings between ld.so and shared libraries. Ldconfig scans a running system and sets up the symbolic links that are used to load shared libraries properly. It also creates a cache (/etc/ld.so.cache) which speeds the loading of programs which use shared libraries.

.................................
Source: Mandrake 9.0 RPM [http://www.tldp.org/LD/ Linux Dictionary V 0.16
http://www.tldp.org/LDP/Linux-Dictionary/html/index.html
Author: Binh Nguyen linuxfilesystem(at)yahoo(dot)com(dot)au

Friday, August 22, 2008

0.0.0.0

aarklon

what exactly is the purpose of the reserved address 0.0.0.0 ? Is it used as a broadcast source address ?


druuna

Default Network: The special network 0.0.0.0 is generally used for routing.

see:-http://www.faqs.org/docs/linux_network/x-087-2-issues.ip-addresses.html
see:- http://www.bleepingcomputer.com/tutorials/tutorial37.html


estabroo

With regards to applications with ip listening sockets it also means to bind to all addresses available instead of a particular one.


space teddy

0.0.0.0 is no address - or all addresses, depending on it's context.

if an interface has the address 0.0.0.0 it means it has no address - thus is unconfigured.

If a routing table contains the 0.0.0.0 it is the default gateway - meaning a router of last resort. Anything than cannot be handled by specific routes will be send there.

Tuesday, August 19, 2008

http://www.linuxproblem.org



See:- http://www.linuxproblem.org

SSH login without password

Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user b to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
How to do it

First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh
b@B's password:

Finally append a's new public key to b@B:.ssh/authorized_keys and enter b's password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B hostname
B

Mount Remote Directories Securely and Easily (ubuntu)

If you can access it via SSH, you can mount it on your filesystem, giving you secure access to your favorite stuff.

Samba has transformed how Penguinistas interact on networks with Windows machines and even other Linux boxes. In particular, I often use smbfs (short for "Samba filesystem") to mount a Samba share on my box for easy access. For example, I have two computers on my network: a server named sophocles and a laptop named euripides. A huge collection of music can be found on sophocles at /var/music, but I want easy access to those goodies from euripides. Using Samba on sophocles, I share /var/music, and using smbfs on euripides, I mount /var/music on my server sophocles to /home/scott/tunes on my laptop euripides. By doing so, it appears to me while I'm using euripides as though tunes is just another local folder on my laptop, so I can read files from it, save to it, and do anything else I could if that folder were in fact on my machine.

This is great, except that there are some issues. Setting up Samba can be a royal pain, so any time I can use something simpler, I jump at the chance. Second, Samba shares aren't secure by default. Call me paranoid, but I don't like anything flowing over a network that isn't encrypted. Yes, it's possible to tunnel Samba using SSH, but that just adds more time and trouble on top of the royal pain that Samba sometimes causes. Finally, Samba was designed for LANs, not the wild and woolly Internet, so accessing shares remotely is out of the question (yes, there are ways to do it, but it's just not a good idea on today's Net...and it causes yet more complication!).


But I'm here to tell you that there's a better way: sshfs, the SSH filesystem. Instead of Samba, it uses SSH. All the problems I listed previously are obviated when you switch to SSH. SSH is a breeze to set up and use. All SSH traffic is encrypted, hence the name Secure SHell. And SSH was designed for use on LANs as well as the big, bad Internet, so it's a great choice no matter where you are.
To go back to my original example, I can SSH from euripides to sophocles (and vice versa, for that matter), so I now use sshfs to mount /var/music on sophocles to /home/scott/tunes on euripides. It's easy, it's encrypted, and if this is a connection I'm going to need all the time, I can set things up in /etc/fstab to automate the whole process. Ready to try it out?
Before doing anything else, make sure that you can SSH from the client to the server:

$ ssh scott@sophocles
Linux sophocles 2.6.15-18-386 #1 PREEMPT Thu Mar 9 14:41:49 UTC 2006 i686 GNU/Linux
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Sun Mar 12 13:59:45 2006
$ exit


If you can't SSH in, you need to set that up:

On an Ubuntu server, use sudo apt-get install ssh.

On Windows, install Cygwin, available from http://www.cygwin.com, and install OpenSSH as a service.

On the Mac, enable Remote Login in System PreferencesSharingServices.
If you can successfully SSH in to the server, you're finished with that machine (see how much simpler this is than it would be if you were using Samba?).
Now you need to focus on the local computer. Make sure you've enabled the universe archive in your /etc/apt/sources.list file, as detailed in "Modify the List of Package Repositories" [Hack #60]. Once you've done so, install sshfs:
$ sudo apt-get install sshfs


You'll be told that apt is going to have to install some additional packages in addition to sshfs (fuse-utils and libfuse2), so go ahead and approve apt's request.
When apt finishes installing your new software, it's time to fix some permissions so that normal users can mount and unmount using sshfs. If you leave out this step, mounting and unmounting will require the use of sudo and knowledge of the root password, which you probably don't want. Better to go ahead and run this command, which grants all users on your system execute permission for the fusermount command, used by sshfs to perform its magic:
$ sudo chmod +x /usr/bin/fusermount


Now you need to make the mount point you plan to use on your local machine. In my case, this would be /home/scott/tunes:
$ mkdir /home/scott/tunes


In order for sshfs to work, you have to load the fuse module. For now, go ahead and run this command:
$ sudo modprobe fuse


I know you don't want to have to run that command every time you want to mount with sshfs, so use the following command to tell Ubuntu to automatically load the fuse module when you boot:
$ sudo sh -c "echo 'fuse' >> /etc/modules"



Be very careful and use >> instead of > (in other words, append instead of overwrite)! If you accidentally use >, you will hose your box and none of your modules will load on boot. For that reason alone, you really should back up up /etc/modules first, with sudo cp /etc/modules /etc/modules_bak.
Now for the final step: mount /var/music on sophocles to /home/scott/tunes on euripides. The syntax of the command is as follows:
$ sshfs

user@

[

IP

|

HOSTNAME of remote machine

]

:/shared/path /local/mount/point



If your username is the same on the remote and local machines, you can leave it off. DNS will work either on your LAN, if you have an entry for the server in your /etc/hosts file, or over the Net to a machine with a registered address. Otherwise, use the computer's IP address. If you don't specify a path after the colon, sshfs mounts the home directory for the SSH user, which may be all that you want. In my case, my username is the same on both boxes, I have an entry for sophocles in the /etc/hosts file, and I want to mount a specific directory on the computer, so my command looks like this:
$ sshfs sophocles:/var/music /home/scott/tunes



If you get the error "fusermount: failed to open /dev/fuse: Permission denied," add yourself to the fuse group with sudo addgroup username fuse, log out, log back in again, and try the command again.
Now I can open my favorite music player, point it to /home/scott/tunes, and start enjoying jazz, rock, country, or whatever it is that floats my boat. Remember, it's all secure, so I don't have to worry about anyone sniffing packets and finding out what's moving around on my network.
To unmount, you have a choice. You can use the fusermount command with the -u option (for "unmount"):
$ fusermount -u /home/scott/tunes


Or it might be simpler just to use the good ol' umount command:
$ sudo umount /home/scott/tunes


If I knew that I wanted to make my connection to sophocles whenever I booted, I could add the following to /etc/fstab:
sophocles:/var/music /home/scott/tunes fuse defaults 0 0

The first three items are different from the usual fstab entries, with the first two exactly like the sshfs command you just used, and fuse indicating to your computer the kind of filesystem it's going to mount. If you want to change the other entries and you know what you're doing (run man fstab to learn more), go right ahead.

Once you discover sshfs, you're going to use it all the time. There's no reason not to: it works beautifully, and the added benefit of security is icing on the cake. Thank you, sshfs!
---------------------------------------------------------------------------------------------

Tested on Ubuntu 6.06 Dapper version

Monday, August 18, 2008

common security technique

aarklon

i have read the following in a book

at the bottom of the TCP/IP structure , in the physical and data link layers,you can encrypt data on the wire. this is one of the most common security technique used in communications.

can any one give a brief explanation of how this is done ?



Dave

The big problem with encrypting entire packets is that you give hackers a big clue because they know the physical structure of parts of the packet.If you know that the first N bytes follow recognized patterns then it can make life easier.

Think WiFi for an example.


Blackrose

I don't see a point in encrypting on the physical layer? you can view the actual transmission technique and modulation techniques as a kind of encryption i guess?

But every layer can perform encryption, each layer receives data from the layer above, and at the Data link layer, as long as both the sender and receiver can agree on a common way to scramble the data,any kind of encryption can be done. However it is a really bad idea to use complex methods on data link layer.

It is much more common to have the encryption up the top layers,closer to the actual data.. There is little point in encrypting in your application/network layer, and have that packet encrypted again in data link. The bottom layers are really only responsible for delivering data to adjacent nodes.

Thursday, August 14, 2008

remote installation

aarklon

which protocol is used in the remote installation of Linux OSes is it bootp ?


taco

yep. Bootp for the basic network ip address and tftp for downloading the
linux image.


tauno voipio

Older Suns (at least SparcStation 5, 10 and 20) use RARP instead of BOOTP for remote boot.


allen kistler

Remote boot would use bootp and tftp, for certain.Remote installation could use manual, bootp, or dhcp for address assignment, depending on the installer for the particular distro.

Content transfer typically uses nfs, ftp, http, or smb, again depending on the installer.

Strictly speaking bootp/tftp could be an option for remote installation,but it would depend on the features of the installer, and it's probably not the only option if it is available.

/etc/aliases

sulekha

what exactly is the purpose of /etc/aliases file ?

ibutho

Its used to define aliases for mail i.e. who receives mail for certain user accounts.

Wednesday, August 13, 2008

Keeping Your Desktop Time

Syncing Your Desktop to Internet Time Servers

NTP is a Network Time Protocol that connects your local machine to a remote server to configure your local time correctly. Often users do not realize that their machine is actually making these remote connections.

In order to synchronize to Internet time servers you will need to install NTP support. Choose System/Administrator/Time and Date and then select “Keep synchronized with Internet servers” Instead of Manual. If NTP support is not available you will be asked to install it by supplying your administrator password.













Once it is installed close Time and Date and then reopen if for the changes to take effect.
Note your Time zone and that the Configuration is set to Internet servers. Now it is time to Select Servers. It makes sense to select time servers that are close to you.













Select one or more time servers so that your system will synchronize with the time server on a regular basis.
























Network Time Protocol is a daemon so it will listen for connections to be made to the NTP time server.Open a terminal and type:

netstat -aunt
udp 0 0 192.168.5.43:123 0.0.0.0:*
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*

This shows that your Desktop is listening on port 123 for a time update from the remote Internet Servers.

The other indication that you will see is when you look at your logs in /var/log/syslog.

Jun 17 08:21:21 ub ntpd[9576]: ntpd 4.2.4p4@1.1520This e-mail address is being protected from spambots. You need JavaScript enabled to view it -o Fri Mar 7 20:24:07 UTC 2008 (1)
Jun 17 08:21:21 ub ntpd[9577]: precision = 1.000 usec
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #0 wildcard, 0.0.0.0#123 Disabled
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #1 wildcard, ::#123 Disabled
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #2 lo, ::1#123 Enabled
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #3 eth0, fe80::21b:fcff:fe68:6833#123 Enabled
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #4 lo, 127.0.0.1#123 Enabled
Jun 17 08:21:21 ub ntpd[9577]: Listening on interface #5 eth0, 192.168.5.43#123 Enabled
Jun 17 08:21:21 ub ntpd[9577]: kernel time sync status 0040
Jun 17 08:25:41 ub ntpd[9577]: synchronized to 91.189.94.4, stratum 2
Jun 17 08:25:41 ub ntpd[9577]: time reset -0.209526 s
Jun 17 08:30:51 ub ntpd[9577]: synchronized to 91.189.94.4, stratum 2

From these logs you can see that the Desktop is synchronized to two separate time servers each which are stratum 2. Stratum 1 is a time server connected to an atomic clock or a radio frequency clock. So a stratum 2 gets it's time from a server that is a stratum 1 server. Each time the connection is made to the server a time offset will occur.

Enable Stats
You can view stats, which are not too useful, by enabling stats in the /etc/ntp.conf file and uncommenting the lines so it looks like this:

# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

Once you do this restart your ntp server.

# /etc/init.d/ntp restart
* Stopping NTP server ntpd [ OK ]
Starting NTP server ntpd [ OK ]

Here is a look at those stats.

54634 54912.805 91.189.94.4 9014 -0.003789257 0.215213312 7.937502568 0.000000954
54634 54913.693 131.216.22.15 9014 -0.010979699 0.102440485 7.937516505 0.000000954

Here is a helpful command to be done as root to see what server is keeping your time.

# ntpq -p
remote refid st t when poll reach delay offset jitter
================================================================
+europium.canoni 192.36.133.17 2 u 35 64 377 213.401 2.271 2.136
*egr-dns-1.egr.u 69.25.96.13 2 u 27 64 377 98.623 -6.359 1.565

The line with the * is the server that is currently used to set the clock on your Desktop.

.rhosts and /etc/hosts.equiv

aarklon

can any one give an example for configuring .rhosts file so that i can allow some trusted computers in my LAN to access my ubuntu 8.04 machine via telnet,ssh without having to enter password. BTW there is no /etc/hosts.equiv file in my machine, so will i have to create it ...????


bit twister

Easy enough, FQDN space user name per line or ip_addy user name.

$ cat ~/.rhosts
wb.home.invalid bittwister

Be sure to chmod 600 ~/.rhosts


antonio batovanja

man ssh-keygen
man ssh-copy-id


unruh

It is a bad idea to use telnet. Too many systems have had passwords stolen.That the remote computers (or local computers) are trusted is irrelevant.You also have to trust every inch of lan as well.On ssh, use the authorized-key mechanism. Place the contents of .ssh/id_rsa/pub into the other computer's .ssh/authorized_keys file to allow you to log onto their system without a password. That replaces teh notion of .rhosts or /etc/hosts.equiv

>BTW there is no /etc/hosts.equiv file in my machine, so will i have to
>create it ...????

Yes, you would have to create it if instead of listening to everyone you decided to go that route.

kcarun

I am preparing for SUN certification. In my text book in review section there is a question,

Q)Which of the following files gives a specified user permission to log in remotely from the specified host without having to supply a password?

a) .rhosts
b) /etc/hosts.equiv
c) /etc/default/login
d)/etc/hosts

1) Answer is shown as option 'a' , But 'b' is also correct?
2) these 2 files are using for same purpose ?


jrtayloriv

/etc/hosts.equiv is system-wide and applies to everyone, while .rhosts is specific to the user (and is stored in their home directory).since it says "specified user" -- the answer is (a).


javier

.rhosts can be edited by either root or a regular user in their own home directories. /etc/hosts.equiv can only be edited for root but it applies to users only.

Examples:

root on server1 wants to allow root on server2 to log into server1 as root

echo server2 >> /.rhosts

root on server1 wants root from anywhere to log in as root from any other machine (really stupid)

echo + >> /.rhosts

root on server1 wants paul to log in as root from server2 (with the -l option)

echo server2 paul >> /.rhosts

root on server1 wants to allow john and paul to log in as themselves (basically any users that exist on both machines but not root) from server2 into server1

echo server2 >> /etc/hosts.equiv

john on server1 wants john to log in as himself from server2

echo server2 >> /export/home/john/.rhosts

john on server1 wants paul to log in as john from server2

echo server2 paul >> /export/home/john/.rhosts

Well, you get the idea (I hope)

NFS locking/ concurrency control

aarklon

what exactly is the locking /concurrency control mechanism used in NFS to prevent simultaneous updates in NFS ?


antonio batovanja

man nfs" would show you:

"The Network Lock Manager protocol is a separate sideband protocol used to manage file locks in NFS version 2 and version 3. To support lock recovery after a client or server reboot, a second sideband protocol -- known as the Network Status Manager protocol -- is also required.In NFS version 4, file locking is supported directly in the main NFS protocol, and the NLM and NSM sideband protocols are not used."


david schwarz


There is no need. If the updates are simultaneous, then neither is "more recent" than the other. So it doesn't matter. It only matters if a less recent update overwrites a more recent update.


maxwell lol

Some systems have/had a lock daemon running, and the NFS implementations coordinated with them to ensure concurrency.

Tuesday, August 12, 2008

compiling from the source

Ubuntu's package repository is huge, particularly when you factor in packages in the Universe and Multiverse repositories. However, many users find themselves needing to install packages from source, either because they want to use a newer package than is available in the repository, or they want to try something that's not in the Ubuntu repository at all.

If you want to install packages from source, you can use a few shortcuts to make life easier. First, you'll probably want to get the build-essential meta-package if you haven't installed any developer tools. Run sudo apt-get install build-essential; it will grab GCC, the Linux kernel headers, GNU Make, and some other packages that you'll probably need.

Next, if you're going to compile a package such as Gaim because a new version is out, you might be able to satisfy the new version's dependencies with the old version's dependencies. To do this, grab the package's build dependencies with sudo apt-get build-dep packagename . That will grab all of the development packages you need to build the package that's currently available in Ubuntu, and will probably satisfy dependencies for the new version you're compiling.

Finally, don't make install when you compile from source -- use CheckInstall instead. CheckInstall will create a Debian package and install it for you, so you can remove or upgrade the software more easily later on.

Grab CheckInstall with apt-get install checkinstall. After you've run ./configure ; make, just run sudo checkinstall and answer a few simple questions. Note that if you compile packages on AMD64, CheckInstall will select X86_64 as the architecture rather than amd64 -- which will cause the package install to fail, since Ubuntu expects amd64 as the architecture rather than X86_64.

By the way, the packages created by CheckInstall also make it easier to deploy the same package on several machines, if you happen to have several systems running Ubuntu. See Joe Barr's excellent http://www.linux.com/articles/114083

How to reconfigure X.org

Most of the time, X.org -- that's the software that drives your video card and provides the foundation for the GUI, whether you're running GNOME, KDE, Xfce, or another window manager -- "just works" when you install Ubuntu. In fact, I'd wager that most Ubuntu users never even have to think about their video settings.

But, sometimes you need to reconfigure X.org because Ubuntu hasn't detected your video card and monitor properly, or maybe you've just purchased a shiny new video card and need to get it working with Ubuntu. Whatever the reason, it's good to know how to reconfigure X without having to edit your /etc/X11/xorg.conf by hand.

To run through the configuration, use dpkg-reconfigure xserver-xorg at the console or in a terminal window. Then you'll have a chance to specify your monitor and video card, the resolutions and color depths you want to run the server at, and so forth.

Since every setup is different, it's hard to give concrete advice for configuring X, but it's generally OK to accept the configuration defaults. Also, you'll be given a choice between Advanced, Medium, and Simple methods for giving your monitor's specifications. As a rule, it's probably best to go with Simple unless you really know what you're doing, or the Simple method doesn't work for you.

Monday, August 11, 2008

Windows/Linux Sharing

aarklon

In my office there are lot of ubuntu machines and a few windows machines, now how to access data in the Linux machines from windows machines ,without using samba....????


ray
One way would be with ftp - you may need to install the free Unix Tools from MS.


douglas maine

It depends on what you're trying to do. To share files, samba is the easiest.

To use the computational resources on the remote box, then ssh is a good way to get a command line. Putty is a Windows command line tool.Also, if the windows boxes have an X server (say, cygwin's X), then you can also run X apps over ssh.

A word of caution...
Be aware of these facts:
1. Filenames under Linux are completely case sensitive, while
2. Filenames under Windows are only case preserved.

This subtle difference can cause some problems for users who are allowed to login via ssh and also intend to interact with the same directory over Samba.


the natural philosopher

Another way is to put web server on the box, and use something like php to up and download files to it. Mysql database makes it more fun ;-)


David Bianchi

Using ftp or webdav for example? You know, you can "mount" an ftp-share or a web-dav share just like a samba share.


huwnet

Use Windows Services for Unix which can provide an NFS server / client on Windows
see:-http://en.wikipedia.org/wiki/Microsoft_Windows_Services_for_UNIX

ilrudie

There's also something called "Windows services for Unix (SFU)" available from microsoft, which enables windows to use nfs, but using samba to connect to a windows share from a linux computer is probably a lot easier than using SFU to connect to an nfs share from a windows computer...
FTP is insecure. If you setup an ssh server on your Linux machines windows users can use winscp to get at the files. They will need an account on the Linux box and the account will need read access to the files (probably through a group).

General schvantzkopf

SAMBA is the easiest way, why don't you want to use it?

You could install Cygwin on your Windows boxes which would allow you to rsync files between the Windows boxes and Linux boxes. There is an NFS client for Windows also.


Willem bogaerts

I personally like SSH. I have it installed on all my Xubuntu machines anyway, and you can use Putty and WinSCP from Windows machines if you like. If you want to connect from home, you can create tunnel through your router/server. Be sure to limit SSH access to your router/server from trusted IP adresses only, as brute-force attacks are alas not uncommon.


cork soaker

AFAIK Windows has had support for NFS for a while.You have to dig around to find it though. Depends on the version of Windows.


john thompson

Yes: http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx

Doesn't work in Vista, though:

System Requirements

* Supported Operating Systems: Windows 2000; Windows 2000 Service
Pack 3; Windows 2000 Service Pack 4; Windows Server 2003; Windows XP

* The minimum system requirements for installing Windows Services
for UNIX depends on which components you are installing and the file
system of the disk where the components will be installed.

* The maximum disk space required to install all Windows Services
for UNIX components is approximately 275 MB. The minimum disk space
required is 19 MB.

Note: The product will not install on Windows 9x or Windows XP Home
Edition or Windows Vista.


cork soaker

Windows Vista has built-in support. You have to go into the Control Panel and "extras" or "add-ons" or some such nonsense. But it's definitely there, just well hidden.


john thompson

Not in Vista Home Premium, as far as I can tell.


seven

You should virtualise your windummy PCs using VirtualBox.VirtualBox can run windummy XP OSen 2x to 4x faster than a real PC if you have a dual core or quad core machine Linux machine.So you could run all your windummy PCs virtualised in one or two quad core Linux PCs.For file transfer use Winscp - it looks similar to explorer with two windows to copy files from one to the other.

http://sourceforge.net/projects/winscp/

No samba - 128 bit encryption so you can also use it over the real internet from one machine to another.

Also Works from within VirtualBox running windummy osen to connect from windummy virtual PC to the real PC.


cork soaker

Ah, wouldn't know about that, I've only *used* Ultimate.Looks like you have to pay a shitload extra just for NFS support! IPX isn't there either, I noticed.

Friday, August 8, 2008

root browser in hardy heron

just type sudo file browser name in the terminal

ex:- sudo nautilus
sudo thunar

Thursday, August 7, 2008

Vi editor in Hardy Heron

aarklon

i find it very difficult to the edit the files such as /etc/hosts, /etc/network/interfaces .... using vi editor , in ubuntu 8.04, has the commands changed ?


weibullguy

The vi commands? No, those have nothing to do with Ubuntu. If you don't like vi, why not use a different editor like nano, pico, joe, emacs, gedit, mousepad, kate, kedit, etc., etc., etc.


JKZfixme

I sometimes have issues w/ vi in ubuntu as far as it just plain acting funny , to solve i install and use vim or "VI iMproved"


amani

If I type vi, I get vim. That works fine


turthird

I use the gnome one - gedit. I find it much easier, unless you want to do something clever.
e.g. At terminal type

Code:

sudo gedit /etc/hosts/filename
That is how I edit any config files that need changing.


ciden

Maybe you will be happier with
Code: # nano

it is wysiwyg, and is a bit more intuitive.
Why I suggest this is because it is already installed by default in Ubuntu.


kihjin

You are really using vi or are you using vim? Check out your /etc/vim/vimrc file, make sure it's to your liking.Specifically make sure either set nocompatible is set or if compatible is set, comment it out!Also you might have a conflicting .vimrc in your home directory, check that out too.

Wednesday, August 6, 2008

what exactly is the subtle difference between /dev/zero and /dev/null ?

what exactly is the subtle difference between /dev/zero and /dev/null ?

the following is what i got when i gave the command man zero on the terminal

Data written on a null or zero special file is discarded.

Reads from the null special file always return end of file, whereas
reads from zero always return \0 characters.

null and zero are typically created by:

mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
chown root:root /dev/null /dev/zero


colucix

$ dd if=/dev/null of=testnull count=1 bs=512
0+0 records in
0+0 records out
0 bytes (0 B) copied, 1.9969e-05 s, 0.0 kB/s

$ dd if=/dev/zero of=testzero count=1 bs=512
1+0 records in
1+0 records out
512 bytes (512 B) copied, 6.037e-05 s, 8.5 MB/s

$ ls -l test*
-rw-r--r-- 1 colucix users 0 2008-08-06 10:58 testnull
-rw-r--r-- 1 colucix users 512 2008-08-06 10:58 testzero

$ od -c testnull
0000000

$ od -c testzero
0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0001000

$ rm testnull testzero


David the H

/dev/zero is an endless source of zeros. It's there to provide a simple raw, data stream of unvarying content. /dev/null is a black hole. Anything sent into it just disappears. It's the programmers trash can.

So /dev/zero is meant as a source of (empty) data, and /dev/null is meant as a destination for (unwanted) data.


Mr C

/dev/zero returns 0's, not empty data.

/dev/null is also useful for reading - it returns EOF upon read input.


David the H

I said it returned zeros. Perhaps I got my terminology wrong, but I'd consider a stream of zeros to be pretty much empty data. I've mostly seen it used for blanking out file systems and such in any case.


Mr C

You can use whatever terminology you want. But mathematically, there is a big difference between an empty data set and a set of infinite zeros. A zero is not "empty data", it is in fact, specifically not-empty. Loose terminology confusing rather than clarifies.

mcduck

Well, you pretty much already said the difference in your post. Reading from /dev/zero provides you with zeroes, while reading from /dev/null provides no data.

So you can use /dev/zero to create empty files of certain sizes, or to overwrite disks with zeroes, while /dev/null wouldn't work for this kind of purposes.


Jean david beyer

The simple way of looking at these is to say

if you write to /dev/null, what you wrote disappears.

if you write to /dev/zero, what you wrote disappears.

if you read from /dev/zero and you get as many \0 characters as you ask for.

If you read from /dev/null, you get no characters and an end-of-file return.

Florian diesh

When you read from /dev/zero you get 0-Bytes, when you read from
/dev/null you get EOF


colucix

In the original context - as proposed by the OP - /dev/zero is a special file which provides as many zeros as you want to read. From a computer science point of view it provides a sequence of N bytes, each one representing the number zero. If you store them in a file, it will have a finite size, other than zero.

/dev/null is a special file that discards all the data sent to it and provides no data at all if you try to read from it (actually it returns EOF as already stated by Mr.C). If you try to store /dev/null in a file, you will end up with a file size equal to zero. Not a single bit is written, nor zero, nor one.
__________________
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)

Monday, August 4, 2008

How to read malayalam dailies using firefox under ubuntu

Most of the Malayalam newspapers use dynamic fonts. FireFox and Mozilla browsers do not support Dynamic fonts by default. Here is how you can read Malayalam and Other Indic publications using Firefox:

1) install firefox extension padma from here:-

https://addons.mozilla.org/en-US/firefox/addon/873?id=873&application=firefox

Padma is a technology for transforming Indic text between public and proprietary formats. The technology currently supports Telugu, Malayalam, Tamil, Devanagari (including Marathi), Gujarati, Bengali, and Gurmukhi...


2) download all the required malayalam newspapers fonts from here:-

http://varamozhi.sourceforge.net/fonts/?N=A

3) add the malayalam font as follows:-

There are various locations in GNU/Linux in which fonts can be kept. These locations are defined in /etc/fonts/fonts.conf; standard ones include /usr/share/fonts, /usr/local/share/fonts, and /home//.fonts (where is your user name).

The easiest way to install a truetype font is to press alt-F2 and enter the following code (this will open nautilus in the right directory):

gksu nautilus /usr/share/fonts/truetype
Then create a new directory, name the directory whatever you like (choose a name that you remember if you ever need to backup your fonts personal fonts). Copy the fonts into that directory and finally rebuild the font information files by pressing alt-F2, mark 'run in terminal' so you can see the progress and entering the following code:

sudo fc-cache -f -v

Note: After you install a new font, you will need to make sure that programs in which you want to use the new fonts can recognize them. In most cases this is done by closing and reopening the programs; however, some programs may require you to log out and log back in.

The easiest place for people to put their fonts is /home//.fonts. If you have not already done so, create this folder:

Open your home folder in Nautilus (GNOME) or Konqueror (KDE).

Since dot-folders are really hidden folders, you need to choose "Show Hidden Files" from the View menu.

Go to File -> Create Folder (GNOME), or right-click and choose Create New -> Folder (KDE).

Name the new folder ".fonts".

Now double click on the folder to open it, and drag and drop your fonts into the folder.

On GNOME, you can also directly open the virtual folder fonts:/ (within a Nautilus window, choose Go -> Location or press Ctrl+L) and drag and drop fonts into this folder. (Does not work in in Hardy Heron 8.04 due to changes. Please follow the method above.)


4) Now, fireup Firefox, Edit -> Preferences -> Content and set your Default Font to appropriate malayam font

That is it...!!

download malayalam fonts here:-

http://ifile.it/49yikqx/malayalam-fonts.zip
http://ifile.it/49yikqx