Linux Tips and Hacks

Posted: June 28, 2008 in Uncategorized
Tags:

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 10.8.11.1 and you go to 10.8.11.3 via 10.8.11.2, then to open graphical applications of 10.8.11.3 on 10.8.11.1, follow these steps:
1. start Xwin32 (on 10.8.11.1)
2. ssh to 10.8.1.2
3. export DISPLAY=10.8.11.1:0.0
4. vncserver (it will promt for a passwd, set the passwd)
5. start remote destop connection as server 10.8.11.2:1
6. xhost + (on 10.8.11.2)
7. ssh to 10.8.11.3 from 10.8.11.2
8. export DISPLAY=10.8.11.2:1 (on 10.8.11.3)
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>

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s