How to get JRE (Java) working under Chrome Fedora

I recently couldn’t get Java to work under Chrome. Hopefully this can help someone else with the same problem.

Make sure you have java installed. You can do this by running

yum list jre

in the terminal. If it is installed it will be listed under “Installed packages.”

If you do not have Java installed, you can download it here. The download is a .bin file. Navigate to the folder you downloaded it to and issue the command:

chmod +x jre-6u##-linux-i586-rpm.bin

Substitute ## for the update number you downloaded, currently it would be

chmod +x jre-6u27-linux-i586-rpm.bin

(This allows the file to be executed as a program.)

Extract and install JRE by running

sudo bash jre-6u##-linux-i586-rpm.bin

Again substituting ## for the update you downloaded.
So currently it would be

sudo bash jre-6u27-linux-i586-rpm.bin

You will be asked if you want to replace the JRE RPM. I selected yes. You also have the option of no, all, none and rename.

Once you have JRE installed, or if it was already installed, create a link between JRE’s plugin file and Firefox’s plugins folder by issuing this in a terminal.

sudo ln -s /usr/java/jre1.6.0_##/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/libnpjp2.so

Again, make sure to substitute ## for the current update number so it would be (currently)

ln -s /usr/java/jre1.6.0_27/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/libnpjp2.so

Restart Chrome. You can check if Java is working here.

Password Less SSH using PUTTY

Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client (running SSH server and SSH client programs, respectively).

In SSH when a client computer connects to the server, the server requires the client to authenticate itself. There are different ways a client can authenticate itself to the server. A typical authentication mode will be to enter a password when logging into a remote system. In this tutorial we can explore another mode of authentication in which server doesn’t require a password to be entered by the user.

So lets Start :

Client Configuration (WINDOWS)

1. Go to the client computer. We are using windows as client computer. Download Putty and Puttygen from following

URL
PUTTY
PUTTYGEN

Using the Puttygen tool we will generate an authentication key. This key will serve as a substitute for the password that will be entered during login.

2. Start puttygen.

3. The following window opens up. Leave the default ‘SSH-2 RSA’ selection and click on the ‘Generate’ button.

4. The following window opens. Move mouse randomly over the empty space below the progress bar to create some randomness in the generated key.

5. Don’t enter any key phrase. Click on ‘Save private Key’ button. Click ‘Yes’ on the window asking for confirmation for saving the key without a password.

6. Save the key file to a safe location. We will be saving the file in C:\Vidyadhar as 192.168.1.2.ppk. 192.168.1.2 is my SSH server ip. Now you can close the Puttygen window.

7. Open the 192.168.1.2.ppk file in a notepad. Copy the four lines under ‘Public-Lines’ section to windows clipboard

Server Configuration (UBUNTU)

1. Now open putty and connect to the remote system using the user id you want to use for future no password connections. At my system I am going to login through vidyadhar user. This time when you login, you have to provide the password at the prompt. Future logins won’t require this password

2. Under the logged in user’s home directory there will be .ssh directory, under that create a new file called authorized_keys using a text editor such as vi.
In our case the file will be created under /home/vidyadhar/.ssh/authorized_keys

cd ~/.ssh/
vi authorized_keys

3. Type the word ssh-rsa (including spaces on both ends of the word) and paste the 4 lines copied from step 7 from client configuration. Remove the carriage return at end of each line, merging four lines into one single line.
Be careful not to delete any characters while doing that. Final output should like the following window.

4. Save the file and quit the text editor. Assign rw permissions only for the owner.

chmod 600 ~/.ssh/authorized_keys

5. Now we have configured SSH server, its time to test our setup.

Testing

On the Client system (Windows), open Putty, enter the ip address details of the remote system. Now from the left navigation, select Connection -> Data. Enter vidyadhar as Auto-login username on the right panel.

Again from the left navigation menu, scroll down and select Connection -> SSH -> Auth. Enter the path of the saved private key file, In our case C:\vidyadhar\192.168.1.2.ppk. Leave other defaults as such and press open button.

Now the putty connects to the remote SSH server and there won’t be any password prompt here after.

Install Mario On Ubuntu

Mega Mario is a Mario clone + blood. In the game you play Mario and your task is to free his brother Luigi, who was captured by the evil Bowser. Mario is controlled by Keyboard or Gamepad using the Arrowkeys to walk, Space / A to jump and CTRL / B to run/fire. After reaching a castle the game is saved and can be continued at any time by clicking on “Load Game”.

Mega Mario also features a blood-mode, which makes killed enemies spread their blood all over the level! And if you have fun to create your own levels after completing the game, you can use the Level-Editor (read “Editor.txt”).

You can download Mega Mario from here

To install Mega Mario on Ubuntu you have to add following lines in /etc/apt/sources.list

Note : I am using Ubuntu 11.04. For this version repository owner do not have any packages. Then also you can add following lines in your sources.list file. It will work.

deb http://ppa.launchpad.net/pratikmsinha/freethinkers.packages/ubuntu lucid main
deb-src http://ppa.launchpad.net/pratikmsinha/freethinkers.packages/ubuntu lucid main

Now run,

sudo apt-get update
sudo apt-get install megamario

That’s it. It will install Mega Mario on your machine. Just run megamario in your terminal and you are ready to play the game.

megamario

In case of any problem please let me know.

Master Sheet Learn VI

The VI editor is a screen-based editor used by many Unix users. The VI editor has powerful features to aid programmers. If you master the use of Vim text editor, it can be a very powerful tool in your hands, and allow you to do amazing text editing feats with just a few taps on your keyboard.

Many beginning users avoid using VI because the different features overwhelm them. To overcome it and practice it more you can use VI in bash. I have also collected some of the short cut keys which will be useful for you to learn VI

To set vi for your terminal run,

set -o vi

Keyboard Shortcut Summary for VI

.--------------.------------------------------------------------------------.
|              |                                                            |
| Shortcut     | Description                                                |
|              |                                                            |
'--------------'------------------------------------------------------------'
| Switching to COMMAND Mode:                                                |
'--------------.------------------------------------------------------------'
| ESC          | Switch to command mode.                                    |
'--------------'------------------------------------------------------------'
| Commands for Entering INPUT Mode:                                         |
'--------------.------------------------------------------------------------'
| i            | Insert before cursor.                                      |
'--------------+------------------------------------------------------------'
| a            | Insert after cursor.                                       |
'--------------+------------------------------------------------------------'
| I            | Insert at the beginning of line.                           |
'--------------+------------------------------------------------------------'
| A            | Insert at the end of line.                                 |
'--------------+------------------------------------------------------------'
| c<mov. comm> | Change text of a movement command <mov. comm> (see below). |
'--------------+------------------------------------------------------------'
| C            | Change text to the end of line (equivalent to c$).         |
'--------------+------------------------------------------------------------'
| cc or S      | Change current line (equivalent to 0c$).                   |
'--------------+------------------------------------------------------------'
| s            | Delete a single character under the cursor and enter input |
|              | mode (equivalent to c[SPACE]).                             |
'--------------+------------------------------------------------------------'
| r            | Replaces a single character under the cursor (without      |
|              | leaving command mode).                                     |
'--------------+------------------------------------------------------------'
| R            | Replaces characters under cursor.                          |
'--------------+------------------------------------------------------------'
| v            | Edit (and execute) the current command in the text editor. |
|              | (an editor defined in $VISUAL or $EDITOR variables, or vi  |
'--------------'------------------------------------------------------------'
| Basic Movement Commands (in command mode):                                |
'--------------.------------------------------------------------------------'
| h            | Move one character right.                                  |
'--------------+------------------------------------------------------------'
| l            | Move one character left.                                   |
'--------------+------------------------------------------------------------'
| w            | Move one word or token right.                              |
'--------------+------------------------------------------------------------'
| b            | Move one word or token left.                               |
'--------------+------------------------------------------------------------'
| W            | Move one non-blank word right.                             |
'--------------+------------------------------------------------------------'
| B            | Move one non-blank word left.                              |
'--------------+------------------------------------------------------------'
| e            | Move to the end of the current word.                       |
'--------------+------------------------------------------------------------'
| E            | Move to the end of the current non-blank word.             |
'--------------+------------------------------------------------------------'
| 0            | Move to the beginning of line                              |
'--------------+------------------------------------------------------------'
| ^            | Move to the first non-blank character of line.             |
'--------------+------------------------------------------------------------'
| $            | Move to the end of line.                                   |
'--------------+------------------------------------------------------------'
| %            | Move to the corresponding opening/closing bracket.         |
'--------------'------------------------------------------------------------'
| Character Finding Commands (these are also Movement Commands):            |
'--------------.------------------------------------------------------------'
| fc           | Move right to the next occurance of char c.                |
'--------------+------------------------------------------------------------'
| Fc           | Move left to the previous occurance of c.                  |
'--------------+------------------------------------------------------------'
| tc           | Move right to the next occurance of c, then one char       |
|              | backward.                                                  |
'--------------+------------------------------------------------------------'
| Tc           | Move left to the previous occurance of c, then one char    |
|              | forward.                                                   |
'--------------+------------------------------------------------------------'
| ;            | Redo the last character finding command.                   |
'--------------+------------------------------------------------------------'
| ,            | Redo the last character finding command in opposite        |
|              | direction.                                                 |
'--------------+------------------------------------------------------------'
| |            | Move to the n-th column (you may specify the argument n by |
|              | typing it on number keys, for example, 20|)                |
'--------------'------------------------------------------------------------'
| Deletion Commands:                                                        |
'--------------.------------------------------------------------------------'
| x            | Delete a single character under the cursor.                |
'--------------+------------------------------------------------------------'
| X            | Delete a character before the cursor.                      |
'--------------+------------------------------------------------------------'
| d<mov. comm> | Delete text of a movement command <mov. comm> (see above). |
'--------------+------------------------------------------------------------'
| D            | Delete to the end of the line (equivalent to d$).          |
'--------------+------------------------------------------------------------'
| dd           | Delete current line (equivalent to 0d$).                   |
'--------------+------------------------------------------------------------'
| CTRL-w       | Delete the previous word.                                  |
'--------------+------------------------------------------------------------'
| CTRL-u       | Delete from the cursor to the beginning of line.           |
'--------------'------------------------------------------------------------'
| Undo, Redo and Copy/Paste Commands:                                       |
'--------------.------------------------------------------------------------'
| u            | Undo previous text modification.                           |
'--------------+------------------------------------------------------------'
| U            | Undo all previous text modifications.                      |
'--------------+------------------------------------------------------------'
| .            | Redo the last text modification.                           |
'--------------+------------------------------------------------------------'
| y<mov. comm> | Yank a movement into buffer (copy).                        |
'--------------+------------------------------------------------------------'
| yy           | Yank the whole line.                                       |
'--------------+------------------------------------------------------------'
| p            | Insert the yanked text at the cursor.                      |
'--------------+------------------------------------------------------------'
| P            | Insert the yanked text before the cursor.                  |
'--------------'------------------------------------------------------------'
| Commands for Command History:                                             |
'--------------.------------------------------------------------------------'
| k            | Insert the yanked text before the cursor.                  |
'--------------+------------------------------------------------------------'
| j            | Insert the yanked text before the cursor.                  |
'--------------+------------------------------------------------------------'
| G            | Insert the yanked text before the cursor.                  |
'--------------+------------------------------------------------------------'
| /string or   | Search history backward for a command matching string.     |
| CTRL-r       |                                                            |
'--------------+------------------------------------------------------------'
| ?string or   | Search history forward for a command matching string.      |
| CTRL-s       | (Note that on most machines Ctrl-s STOPS the terminal      |
|              | output, change it with `stty' (Ctrl-q to resume)).         |
'--------------+------------------------------------------------------------'
| n            | Repeat search in the same direction as previous.           |
'--------------+------------------------------------------------------------'
| N            | Repeat search in the opposite direction as previous.       |
'--------------'------------------------------------------------------------'
| Completion commands:                                                      |
'--------------.------------------------------------------------------------'
| TAB or = or  | List all possible completions.                             |
| CTRL-i       |                                                            |
'--------------+------------------------------------------------------------'
| *            | Insert all possible completions.                           |
'--------------'------------------------------------------------------------'
| Miscellaneous commands:                                                   |
'--------------.------------------------------------------------------------'
| ~            | Invert case of the character under cursor and move a       |
|              | character right.                                           |
'--------------+------------------------------------------------------------'
| #            | Prepend '#' (comment character) to the line and send it to |
|              | the history.                                               |
'--------------+------------------------------------------------------------'
| _            | Inserts the n-th word of the previous command in the       |
|              | current line.                                              |
'--------------+------------------------------------------------------------'
| 0, 1, 2, ... | Sets the numeric argument.                                 |
'--------------+------------------------------------------------------------'
| CTRL-v       | Insert a character literally (quoted insert).              |
'--------------+------------------------------------------------------------'
| CTRL-r       | Transpose (exchange) two characters.                       |
'--------------'------------------------------------------------------------'

Also if you dont have linux / unix machine and still want to practice VI then check Henrik Huttunen has created an online site called Open Vim. The site teaches a Vi beginner how to use this seemingly arcane albeit very powerful text editor.

Open Vim supports most of the basic Vi commands, and then a few more. It is not exactly a complete Vi editor yet however, the author of “OpenVim.com” claims it is still a functional clone of Vim that can aid Vi beginners to master the rudimentary skills in using Vi.

Ubuntu Compile Apache from Source

Before compiling apache ensure that gcc is installed on your machine. To confirm just run,

gcc

If you get the following output then gcc is installed on your machine

gcc: fatal error: no input files
compilation terminated.

In case if you get command not found then either you have to install gcc or it is already install you just have to set in your home path. By default in ubuntu gcc get installed at /usr/bin/gcc. So to set it in your PATH run,

export PATH=/usr/bin/gcc:$PATH

Or you can add the above command in your profile

To install gcc on ubuntu run

sudo apt-get install gcc

Now we will download and compile the apache on our machine. I am downloading apache in my home directory.

cd ~/myapps/
wget http://www.fightrice.com/mirrors/apache/httpd/httpd-2.2.21.tar.gz

Extract the downloaded file

tar -zxvf httpd-2.2.21.tar.gz

Now we will install apache in /home/vidyadhar/myapps/apache. You can give whatever directory you want by just modifying PREFIX attribute. For more options just run ./configure –help

cd httpd-2.2.21/
./configure --prefix=/home/vidyadhar/myapps/apache

Now we have to run make and make install to complete the procedure.

make
make install

After a successfull installation you have to modify httpd.conf file and do the basic settings.

In this installation we are going to run apache on 8081 port and we will be using our local user i.e vidyadhar to start and stop the apahce server. For server name we have to modify ServerName tag and have to put hostname over there.

Go to /home/vidyadhar/myapps/apache/conf

cd /home/vidyadhar/myapps/apache/conf

Open httpd.conf file

vi httpd.conf

Modify following settings

Listen 8081
 
User vidyadhar
Group vidyadhar
 
ServerName ubuntu.home.network:8081

Now we will start apache, to do the same run

cd /home/vidyadhar/myapps/apache/bin
./apachectl -k start

To confirm apache is running on not, run following command

netstat -an | grep 8081

You should get output someting like this

tcp        0      0 0.0.0.0:8081            0.0.0.0:*               LISTEN

Now just open your browser and enjoy your apache installation. The URL would be http://server_ip:8081/

Page 6 of 36« First...«456789»102030...Last »
rss twitter facbook

Categories

Archives