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