How To: Configure VNC Server

Vncserver is just another application available in almost all the available Linux based distros. Configuring vncserver is very easy. But the default desktop view in vncviewer is gray scale desktop with very pathetic GUI. To view normal Gnome or KDE desktop in vncviewer, assigning a custom port for usage, user configuration and to adjust the resolution of the vncviewer window, some files need to be configured properly. Here are the required configuration in any version of Fedora/Fedora Core. But with minor modifications these can be applied to other distros like Ubuntu, SuSE, Gentoo etc.

Step 1: Installing Vncviewer, Vncserver

As root do this

[root@bordeaux saini]# yum install vnc [Enter]

Step 2: Configuring resolution, port & user

The default location of server configuration file for vncserver is ‘/etc/sysconfig/’. To configure the resolution, user and port open ‘/etc/sysconfig/vncservers’ in you favorite editor and add two lines per user configuration shown ..

VNCSERVERS=":"
VNCSERVERARGS[]="-geometry x x"

Example :

VNCSERVERS="3:saini"
VNCSERVERARGS[3]="-geometry 1000x700"

You can choose any display port, but it should not be in use by another X server. Window height and width can be anything (not in fraction of course). But keep in mind that the system on which you are going to view the desktop using vncviewer should have greater resolution than what you specify here, otherwise scrollbars will appear.

Step 3: Configuring Desktop Environment

The user specific configuration files of vncviewer resides in ‘.vnc’ directory in user’s home directory. (e.g. ‘/home/saini/.vnc/’). Open ‘.vnc/xstartup’ in your favorite editor and edit as below

  • For Gnome

The ‘xstartup’ file shout look like this

#!/bin/sh
 
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx &
  • For KDE

The ‘xstartup’ file should look like this

#!/bin/sh
 
# Uncomment the following two lines for normal desktop:
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
 
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startkde &

Step 4: Configuring password

For setting up vncviewer password for user ‘xyz’, login as user ‘xyz’ and issue ‘vncpasswd’ command on a terminal/konsole (or whatever). Enter password twice and you are done with password setting.

Step 5: Starting Vncserver

To start vncserver, login as root and issue ‘service vncserver start’ command. If service started successfully, you are ready to use vncviewer on a remote/local machine.

Step 6: Accessing through Vncviewer

  • From Linux based machines
[saini@bordeaux saini]# vncviewer IP_Address:displayPort [Enter] #(IP Address is for the machine where you set up vncserver)
  • From Windows

On windows there is a software called RealVnc. Install it and enter <IPAddress>:<displayPort> in the dialog box.
[I explained how to connect via windows because it may help someone get a bit of relief.]

Screenshots:

  • Vncviewer with Gnome as Desktop environment

VNC Server VNC Viewer Screenshot GNOME

  • Vncviewer with KDE as Desktop environment

VNC Server VNC Viewer Screenshot KDE

Vnc is nice tool if you want to avoid using windows. I use it all the time. While I am forced to work on windows system, I install vncviewer and use it in full screen mode 😛 It also helps when you want to run some gui based application and monitor is remotely. Because if you close vncviewer window and use vncviewer again, you will be given the desktop session where you left it (all windows open and applications running).

 

How To: Install and Configure Shoutcast Radio

Shoutcast is a mp3 broadcasting/streaming media server software provided by NullSoft. One can setup a server on any system, GNU/Linux / Windows/ MacOS and can stream mp3 over the network, internet/intranet. I setup shoutcast on my system a long back and found it very useful. Here is a step by step how to on how you can setup shoutcast on a GNU/Linux system.

Shoutcast can be installed even if you don’t have root privileges. But in that case you can’t use port less than 1024 for broadcasting. Below, I’ll explain how to install it for a non-root user.

Shoutcast server depends on a tool shoutcast DNAS for audio input in Linux. So, here we go

Step 1

Download the latest version of shoutcast from here. Download the one for Linux (glibc).

Step 2

Let us assume we want to install shoutcast in a directory named ‘shoutcast’ in user’s home directory and we want to broadcast punjabi songs.

1
2
3
[saini@bordeaux shoutcast]# tar -xvzf sc_serv_1.9.8_Linux.tar.gz [Enter]
[saini@bordeaux shoutcast]# mkdir punjabi [Enter]
[saini@bordeaux shoutcast]# mv sc_serv.conf punjabi/sc_serv_punjabi.conf [Enter]

Step 3

Open sc_serv_punjabi.conf in your favorite editor and modify certain parameters as per you requirements. The essentials are below.

1
2
3
4
5
6
7
8
9
10
11
12
13
MaxUser=20
Password=yourPassword
PortBase=8300 #(Confirm that this port and the port PortBase+1 is not being used)
LogFile=none
RealTime=0
ScreenLog=0
ShowLastSongs=10
SrcIP=ANY
DestIP=ANY
Yport=80
NameLookups=0
AdminPassword=yourAdminPassword
TitleFormat=%s [IIIT Radio]

etc. My sc_serv.conf can be accessed here. That was all for installing the shoutcast server.

Now, the installation of DNAS tool is still pending. Here is a step by step procedure to install DNAS tool.

Step 1

Download the latest version of DNAS tool from here.

Step 2

1
2
3
4
[saini@bordeaux shoutcast]# tar -xvzf sc_trans_posix_040.tgz [Enter]
[saini@bordeaux shoutcast]# cd sc_trans_040/ [Enter]
[saini@bordeaux sc_trans_040]# mv sc_trans_linux ../ [Enter]
[saini@bordeaux sc_trans_040]# mv sc_trans.conf ../punjabi/sc_trans_punjabi.conf [Enter]

Step 3

Go to punjabi directory and open sc_trans_punjabi.conf in your favorite editor and make changes according to your needs. Here are some

1
2
3
4
5
6
7
8
9
PlaylistFile=/exactPathTo/punjabi.lst
ServerIP=
ServerPort=
 # 8300 in this case
Password=
 # yourPassword in this case
StreamTitle= %s
StreamURL=
Shuffle=1 # (1 for random songs)

etc. My sc_trans.conf can be accessed here.

Step 4

Generate a list of all the songs (mp3) you have and put it in punjabi.lst in punjabi directory.

[saini@bordeaux punjabi]# find /pathToPunjabiDir/ -type f -name "*.mp3" > punjabi.lst [Enter]

My dummy punjabi.lst can be accessed here.

The configuration part of shoutcast server with audio input is complete. Now we have to run the server so that we can listen to music.

Go to the shoutcast directory and run the sc_serv first and then run the sc_trans_linux. Here is way to do that.

1
2
[saini@bordeaux shoutcast]# ./sc_serv punjabi/sc_serv_punjabi.conf > /dev/null 2> /dev/null &
[saini@bordeaux shoutcast]# ./sc_trans_linux punjabi/sc_trans_punjabi.conf > /dev/null 2> /dev/null &

Now your system is a shoutcast server. Any client can use mplayer, vlc, amarok or any other multimedia player that support streaming media to listen to the music being played on your server.

1
2
[saini@bordeaux saini]# mplayer http://yourIp:port [Enter]
[saini@bordeaux saini]# mplayer http://localhost:8300 [Enter] # (in the above case).

If you want shoutcast to start every time your system boots. Put these lines in /etc/rc.local

1
2
/home/saini/shoutcast/sc_serv /home/saini/shoutcast/punjabi/sc_serv_punjabi.conf > /dev/null 2> /dev/null &
/home/saini/shoutcast/sc_trans_linux /home/saini/shoutcast/punjabi/sc_trans_punjabi.conf > /dev/null 2> /dev/null &

Shoutcast is fun and its more fun when everyone listens to what you are listening to 🙂

 

How To: Install Javascript Plugin in Eclipse

Today, I installed Eclipse on my Fedora 7 desktop. Everything is fine, but the default Eclipse does not have a plugin for JavaScript. So , I searched a lot on Google and read a lot of reviews about some JavaScript plugins available for Eclipse. And I finally reached the JSEclipse plugin by Adobe Labs. I had a good experience with it. Its great to work with and if you are looking for a javascript plugin for eclipse, just don’t search any more and install it. JSEclipse can be downloaded from here after registering with Adobe. Following are the simple steps to install the JSEclipse.

Launch Eclipse and do as suggested in images.

Step 1 :

Follow this image :

Help Software Updates Find And Install

Step 2:

Select “Search new features to install” and click next.

Search New Features To Install

Step 3:

Click “New archived site” and select the package or zip file you just downloaded from the above link and click open.

Choose New Archived Site

Step 4: Click OK.

Select Local Zip File And Click Open Then Click OK

Step 5: Check the package if not checked and click next.

Click Finish

Step 6: Check the features you want to install and click next.

Select Features To Install And Click Next

Step 7: Accept Terms and conditions and click next.

Accept Terms And Conditions

Step 8: Click finish and when it ask to restart eclipse just click yes.

Click Finish

Step 9: Voila !! JavaScript plugin is installed now. Have fun with it.

Eclipse With Javascript Plugin

PS: A lot of howtos are pending. Will Try to finish them asap 😀

 

How To: Install and Configure Looking Glass 3D Desktop

I saw a video from Sun MicroSystems last year, in which they showed a demo version of a 3D desktop environment. It was really awesome and was the really 3D desktop environment. A lot of 3D desktop emulators are available currently like beryl, but they are not really 3D. Because one can’t go behind the windows, terminals etc. Believe me, Looking Glass 3D is far better than all vistas and beryls if only graphics are compared. Around two-three weeks when I was going through one of the tech magazines in library, I came across a topic which discussed desktop environments for Linux. I was surprised to see Project Looking Glass over there. Day before yesterday, I downloaded the Project Looking Glass 3D desktop environment for Linux from here.Project Looking Glass 3D desktop environment is a purely Java based desktop environment and it runs on top of Java virtual machine. It requires graphics card (at least on board). Here is a way to install nVidia drivers in Linux. The other requirement like processor and RAM are quite low and almost all systems can qualify for that. Looking Glass 3D is very easy to install. Below are the steps to install it on Fedora 7 (kernel-2.6.22.1-41.fc7, but the steps for other operating systems may be similar.

Step 1

Get lg3d–1-0-0-linux-i686-0612190943.bin from here.

Step 2

In a terminal switch to root user.

1
2
[saini@bordeaux saini]$ su [Enter]
Enter root password.

Step 3

Move the lg3d–1-0-0-linux-i686-0612190943.bin to /usr/share/ and go to directory /usr/share/

1
2
[root@bordeaux saini]$ mv lg3d--1-0-0-linux-i686-0612190943.bin /usr/share/ [Enter]
[root@bordeaux saini]$  cd /usr/share/ [Enter]

Step 4

Extract lg3d–1-0-0-linux-i686-0612190943.bin

[root@bordeaux share]$ bash  lg3d--1-0-0-linux-i686-0612190943.bin [Enter]

The files will be extracted to /usr/share/lg3d/

Step 5

Logout and login into root’s desktop environment and go to the directory /usr/share/lg3d/bin/

[root@bordeaux root$ cd /usr/share/lg3d/bin/ [Enter]

Step 6

Execute the following command.

[root@bordeaux bin]$ bash ./postinstall [Enter]

If this command doesn’t give any error, that means you have successfully installed the Looking Glass 3D desktop environment.

Now logout and on the login screen, choose Looking Glass as the desktop environment. Just login into your account and what you will see will be more than a surprise. Below are some screenshots of my Looking Glass 3D desktop. You can browse all my screenshots here .

PS0 : It may the best 3D desktop environment but is not really usable on slower machines especially with low end graphics cards.

Awesome Wallpaper in Looking Glass 3D 3D Clock in Looking Glass Four Desktops in Looking Glass Notes on Backside of VLC Media Player in Looking Glass

Trumplayer Album Art in Looking Glass I Can't Read Mails in Looking Glass Jumbled Directories in 3D in Looking Glass Random Directory 3D Tiles in Looking Glass

 

Bug: Strange libstdc++.so.5 Problem in Fedora 7

After installing jdk-6u2 for Linux from Sun Microsystems’ site, when I ran javaws it gave strange error that libstdc++.so.5 not found and it aborted. I searched for libstdc++.so.5 and it was not there in /usr/lib/ as expected. That implied something is wrong. As I installed jdk-6u2 from rpms, it should have given dependency error for the particular library, bit it didn’t. After searching for sometime I found that libstdc++.so.5 is provided by compat-libstdc++-33 package, which was not installed on my system. After I installing the particular package, everything worked fine.

It worked fine for Fedora Core 6 because compat-libstdc++-33 is provided by default in Fedora Core 6.

But its kind of strange that if libstdc++.so.5 and hence compat-libstdc++-33 is required for jdk-6u2 then why ‘rpm -ivh’ didn’t give dependency error.