Find the IP Address of your computer running BOSS GNU/Linux

December 22, 2010
ifconfig as regular user Screenshot

running ifconfig as a regular(non-root) user

 

On windows most people are used to finding their IP Addresses via Network Properties or by the ipconfig command. The command to find the IP Address of your computer running BOSS GNU/Linux ifconfig . Note that this command will only run as root, which means that if you are not logged in as root, you will have to first type in the su command and then give the root user’s password before running ifconfig.

screenshot of ifconfig being run when logged in as root

ifconfig being run when logged in as root

 

Advertisements

Find the number of characters in a string/sentence

December 15, 2010

If your ever need to find the number of characters in a sentence ( a.k.a string (in programming) ) and are working on a shell use the following:

echo sentence|wc -c

for instance:

$echo this sentence has many characters|wc -c
34


Java programming on BOSS GNU/Linux

August 18, 2010

Most people start learning Java on Windows by writing code on Notepad and them compiling it using the command line javac (compiler) and java(interpreter). This post tell you how to do something similar on BOSS GNU/Linux.

To install Java on BOSS GNU/Linux install sun-java6-jdk, BOSS 3.0 and above have sun-java6-jdk in the repositories so to install use Synaptic (to find out how to set up Synaptic on BOSS GNU/Linux click here).

Another option is to download the latest version of Oracle/ Sun JDK from here. You should download the .bin file, and then run it.  Be sure to set the environment variable JAVA_HOME. This can be done by appending the following to your .bashrc file:

JAVA_HOME=/path/to/jdk
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME

The .bashrc file can be found in your home directory and can easily be edited by typing

$nano ~/.bashrc

or

$gedit ~/.bashrc

after editing ~/.bashrc, open a new terminal window(or in the same terminal type source .bashrc) and type the following command:

$echo $JAVA_HOME

this should display the path you just set. Next type

$java -version

This will show you the version of jdk you just setup.

Once you are done installing JDK, you can now type your Java code on Gedit(its like notepad on steriods) and then compile and run them using javac/java from the shell.

For details on using IDEs like Eclipse or NetBeans on BOSS GNU/Linux click here.


Using SCP to securely copy files over a network on BOSS GNU/Linux

August 18, 2010

SCP is used to Securely CoPy files over the network.

The syntax for copying a file from a remote computer onto your machine is:
scp -r <username@ipaddress:/path_to_file_at_source_computer> <destination>
the -r can be omitted if you are not copying directories.
Here username is the name of a user a/c on the computers between which the data is being transferred

To copy a file or directory from your machine to another machine on a network is:
scp -r <destination> <username@ipaddress:/path_to_file_at_source_computer>
Note that the -r option is only needed if its a directory thats being copied.

An example, I want to copy /home/boss/docs from a computer on the network with IP address 192.168.1.101 onto my local machine(i.e., the machine iam using). I would use the following command:
scp -r boss@192.168.1.101:/home/boss/docs .
Here boss is a user account on the computer I want to copy files from. On typing this command you’ll be prompted for the password to the account boss. Once thats done, you’ll see the files being copied from the source computer onto your current directory. The ‘.’ here us used to indicate the present working directory (pwd).You can replace it with any directory on your local computer that you can write into.


Command to find out which version of BOSS GNU/Linux you are running

July 16, 2010

On a terminal type:

lsb-version -a

or type:

cat /etc/issue

Another option is to look at the /etc/apt/sources.list file

deb http://packages.bosslinux.in/boss eduboss main contrib non-free

You’ll see a line like the one above, look for the word immediately after the URL, here its eduboss, this indicates the version of BOSS GNU/Linux running on the system. The lsb-version command  provides more accurate information. The lsb-release command should work on most distros(as long as they are LSB compliant).


Accessing files on another BOSS Linux system on a network via GUI (sftp)

June 5, 2010

Windows user are familiar with clicking Start then Run followed by an IP address to access shared folders on a computer on the network. For those looking for something similar on BOSS Linux(or any other Linux distribution) sftp is the solution. The following works on GNOME.

Press ALT+F2. This brings up the Run Application dialog. In here type
nautilus sftp://username@IPaddress
Where username is the user name you are going to use for logging into the remote system and IPaddress is the remote system’s IP Address.

For example: Typing nautilus sftp://boss@10.0.1.11 would allow me to login to a computer on my LAN with the IP Address 10.0.1.11 as user : boss

This will bring up another dialog which will prompt you for the user name’s password.Once you are done typing in the password Nautilus will bring up the files on the remote system.

Note if you simply type nautilus sftp://IPAddress into the Run Application dialog. GNOME assumes that you are trying to login to the remote machine with same username as the one you currently logged in using.


Fix: Network not working on Debian / BOSS Linux / Ubuntu Virtual Machines after being imported into VirtualBox

June 3, 2010

Before exporting Debian / BOSS Linux / Ubuntu Appliances in VirtualBox remember to delete the following file:
/etc/udev/rules.d/70-persistent-net.rules
i.e. run
rm /etc/udev/rules.d/70-persistent-net.rules
as root user on Debian / BOSS Linux
and
sudo rm /etc/udev/rules.d/70-persistent-net.rules
On Ubuntu

If you have already imported the Virtual Machine (a.k.a. appliance) then edit/etc/network/interfaces
change eth0 to eth1, i.e., eth to eth