Linux Tips and Hacks

Posted: June 28, 2008 in Uncategorized

Here is some Linux hacks I will post more as the time progresses, please always remenber to BACKUP before hand and Enjoy.

How to export DISPLAY on windows comp from a linux comp which is accessible from some router linux comp(for windows users only)
Suppose you are working on and you go to via, then to open graphical applications of on, follow these steps:
1. start Xwin32 (on
2. ssh to
3. export DISPLAY=
4. vncserver (it will promt for a passwd, set the passwd)
5. start remote destop connection as server
6. xhost + (on
7. ssh to from
8. export DISPLAY= (on
9. start any application.

How to build an rpm
a) from SRPM
Install the .src.rpm file this way:
$ rpm -i somepackage-1.0-1.src.rpm
This will create files in /usr/src/redhat/SOURCES and a .spec file in /usr/src/redhat/SPECS.
Then go the SPECS directory and give the command to build the RPM:
$ cd /usr/src/redhat/SPECS
$ rpmbuild -bb somepackage.spec
b) from source package
When a source archive (e.g., somepackage-1.0.tar.gz) contains a .spec file, one can give the following command to build the RPM without having to deploy the archive:
$ rpmbuild -tb somepackage-1.0.tar.gz
Give the -ta option instead if you also want to build the SRPM.

To send message from linux to windows
$ smbclient -M <hostname> -I <ip-address>
And to find hostname
$ nmblookup -A <ip-address>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s