Java for Ubuntu…

Recently I needed to install Oracles java, and not the open source java for android development. Oracle do not allow Conical to distribute java with Ubuntu distributions. So you need to add the Oracle repositories after your Ubuntu installation. below shown is a example of how it done.

You need to add the Oracle repository to your Ubuntu installation.

# apt-add-repository pap:flexiondotorg/java

You now need to update your repository database.

# apt-get update

Now you can add the Oracle Java repositories.

# apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

Thats all its done.

Mac Wyse 60 Terminal Emulation…

Recently I have had to go back to Wyse 60 terminal emulation. I needed Wyse 60 terminal emulation due to legacy applications that have no other option but to be accessed. I could spend a fair few dollars on a commercial Wyse 60 terminal emulator. But in the spirit of free and open source, there is a free Wyse 60 terminal emulator out there for use.

You can download the Wyse 60 source from the following site.

http://code.google.com/p/wy60/

You can also directly download the source code from…

http://code.google.com/p/wy60/downloads/detail?name=wy60-2.0.9.tar.gz&can=2&q=

Once you have the source code downloaded, you can upack the source code.

# tar -xvfz wy60-2.0.9.tar.gz

Now we can compile the source code and install the executable.

# cd wy60-2.0.9
# ./configure
# make
# make install

Once you have compiled an installed the code. To activate the Wyse 60 emulation you type.

# wy60

Once this is run, you screen is now in Wyse 60 emulation, and you are able to ssh etc like any other screen, but in Wyse 60 emulation.
Or Under Ubuntu 10.04, you can just add this as a package.

Ubuntu 10.04

# apt-get install wy60

This is simpler than compiling the code.

Setup a PPTP server:

Recently I have been wanting to connect to my home network, from anywhere in the world. I want to connect back home via the device I have in my hands on me at the time. This could be my osx, windows 7, linux laptop, ipad, iphone or android device. I was originally thinking of setting up openvpn, as this was the easiest to setup, but decided against as there is clients for windows, android, linux, osx but not for ios devices. So I had to look for another virtual private network software. I was looking of setting up a ipsec/l2tp server, but decided at the moment against this, as it will take some time to setup and debug. This left me with pptp. This protocol is common to all devices and needed no extra client installed for it to run.

The following steps below will show you howto setup a pptp server.

Ubuntu 10.04

# apt-get install ppp pptpd pptp-linux

Enable port 22 in your firewall to pass throu for emergency purposes to ssh back into the machine. Here is the command to allow ssh through. You need to edit your permanent firewalls for this work on reboot.

# /sbin/iptables -A INPUT –protocol tcp –dport 22 -j ACCEPT

Enable port 1723 in your firewall to pass throu for pptp protocol to work on your system.

# /sbin/iptables -A INPUT –protocol tcp –dport 1723 -j ACCEPT
/sbin/iptables -A INPUT –protocol udp –dport 1723 -j ACCEPT

now we modify the /etc/pptpd.conf file. Look for the lines below in your file and modify them. These lines represent the ip address the vpn connections can have upon your local network.

localip 192.168.0.1 remoteip 192.168.0.241-255

The localip is the ip if the internal nic behind the wan port. This ip address is the ip of the pptp server. The remoteip is the ip’s allocated by the pptp process when you make a connection. I have allocated 15 ip’s. This allows me to have 15 devices connected to the server. I probably only need two ips allocated.

Now we modify /etc/ppp/pptpd.options edit the ms-dns entries to reflect the domain nameserver your network uses. A example is below. ms-dns 8.8.8.8 ms-dns 8.8.4.4

ms-dns 8.8.8.8
ms-dns 8.8.4.4

Also modify your file /etc/sysctl.conf

net.ipv4.ip_forward=1

No we need to restart the system controls. The other option than below is restarting the machine.

# sysctl -p

You now need to add users to the system, so we can make a login into the pptp server. You modify the /etc/ppp/chap-secrets file.

username <TAB> * <TAB> user-password <TAB> *

You now need to restart the pptpd daemon for all the changes to be implemented.

# /etc/init.d/pptpd restart

Create a VirtualBox Headless Machine…

More and more I have been running Virtualbox virtual servers upon my main Ubuntu 10.04 server. I used to create the virtual server upon my Macbook Pro 13″, then export the image, and reimport the image upon the linux headless server. Recently I found it was much easier to create the VirtualBox server upon a headless linux server. Certainly creating the virtual server upon a guy based tool is a lot easier, but it does not save time when you need to export and import the image across to the linux server.

The following steps below will show you howto setup a VirtualBox virtual headless server.

Ubuntu 10.04.03

We now create and register the virtual server with the command VBoxManage.

# VBoxManage createvm -name “server” –ostype Ubuntu_64 –register

We allocated the amount of memory the virtual server will have, the sequence of boot, e.g. dvd first, and which either net adapter does the virtual machine attach itself too. The memory we have allocated is 1024mb and the ethernet it uses is eth4.

# VBoxManage modifyvm “server” –memory 1024 –acpi on –boot1 dvd –nic1 bridged –bridge adapter1 eth4

We now create the hard disk or virtual disk for the virtual server. We allocated 100gb of hard disk space, and store the virtual hard disk file in /home/vbox

# VBoxManage createvdi –filename “/home/vbox/server.vdi” –size 100000

We state that the virtual server uses a ide controller. We can use ahci also, but ide is safe to use.

# VBoxManage storagectl “server” –name “IDE Controller” –add ide

We state that the virtual server uses the ide controller and attach the vital server hard disk to the ide controller.

# VBoxManage storageattach “server” –storagectl “IDE Controller” –port 0 –device 0 –type hdd –medium “/home/vbox/server.vdi”

We need also attach the dvd driver to the ide storage controller. Also we attach the iso image to the dvd drive, so that when we boot the virtual server for the first time, it boots the  virtual dvd driver and uses the iso image.

# VBoxManage storageattach “server” –storagectl “IDE Controller” –port 1 –device 0 –type dvddrive –medium “/home/vbox/ubuntu-10.04.3-server-amd64.iso”

We now allow remote desktop software to connect to the virtual server.

# VBoxManage modifyvm “server” –vrde on”

We now set the port, we can connect to the virtual server on with the remote desktop software. We can connect to the virtual server on port 3392. You can use Microsoft Remote Desktop Connection to connect.

# VBoxManage modifyvm “server” –vrdeport 3392

Once this is all done we can now startup the headless virtual server.

# VBoxHeadless –startvm “server” &

You can shutdown the virtual server with the following command.

# VBoxManage controlvm “server” poweroff

You can pause and restart the virtual server, but within the means of this document, I will not explain them, as they are commands not really needed.