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.

Fujitsu P1620 a new hope…

I have had for a while a Fujitsu P1620 small form factor convertable. I have had for a while Windows Seven working upon the machine, but with only two gigabytes of ram, performance was limited at best. I have decided to install ubuntu 11.04, 64 bit desktop, and remove the gnome desktop for the xfce desktop. The other issue is the very slow 4200rpm 100gb hard disk. The installation was about sixty minutes to install. Half of the installation was downloading packages from the ubuntu repository. I used a external usb dvd rom drive to install ubuntu 11.04, 64 bit desktop. I will further along the way try to document the configuration of software and hardware as in the touchscreen which seems a tricky issue.

Converting RHEL to CentOS:

One of the biggest issues when running RedHat Linux in any verison is how to get updates when you do not pay for mantenance. As far as I know, you cannot get the updates from redhat for free once your 30 day trail is over. Many companies need to run redhat due to the applications we designed around redhat in linux. There are many ways to get around this when running different flavours of linux, but they necessary become a pain in the backside when it comes to this, as the next update of the flavour may break the application. A workaround is too use the free version of redhat enterprise linux which is CentOS. You can convert a redhat machine to CentOS, very easily. Below will show you the process of how it is done.

CentOS 5:

# yum clean all

# mkdir ~/centos

# cd ~/centos/

# wget http://mirror.centos.org/centos/5/os/i386/RPM-GPG-KEY-CentOS-5

# wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-5-8.el5.centos.i386.rpm

# wget http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.8-0.i386.rpm

# wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.22-39.el5.centos.noarch.rpm

# wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-updatesd-0.9-2.el5.noarch.rpm

# wget http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm

# rpm –import RPM-GPG-KEY-CentOS-5

# rpm -e –nodeps redhat-release

# rpm -e yum-rhn-plugin

# rpm -Uvh –force *.rpm

# yum upgrade

At the time of this post CentOS 5.8 is the highest release to upgrade a redhat enterprise 5 installation. I am yet to work out howto upgrade a redhat enterprise 6 release to CentOS 6.

update 2012.04.04

No-IP for those with no static IP…

So people do not have a permanent ip and it makes supporting those users/clients. As you need to keep track of there ip when you need to log into there system/server. A handy way to do this is to use a third party service that tracks your clients non static ip to a dynamic name service. On of these services is no-ip.org This service requires you to install software upon your clients server/machine. Every 30 minutes the software talks to the no-ip.org domain name service and inserts the ip of the clients wan into the no-ip.org name server. So instead of remembering the clients ip address you can remember there name and attach the no-ip.org address. There are many other domains no-ip.org allows you to choose from but this is the domain I have choosen. e.g. client.no-ip.org. better than remembering a ip address. To install no-ip, there following steps are required on you clients server/machine.

Generic:

You must create a on no-ip.org for you to be able to add hostnames. Once this is done you will need to log into your account and be able to add hosts which are the machines that have the dynamic ip. Note, do not create the hosts into groups or one machine will change all the machines ip to the same ip as the machine that does the update. Leave them ungrouped. Below is a image of the buttons that need to be ticked.

CentOS:

Download the no-ip.org unix client.

# wget https://www.no-ip.com/client/linux/noip-duc-linux.tar.gz

# tar xvfz www.no-ip.com/client/linux/noip-duc-linux.tar.gz

You can compile the source code yourself, but for the purposes of the excercise

# cd noip-2.1.9-1/binaries

# noip2.i686 /usr/local/bin/noip2

# chown root:root /usr/local/bin/noip2

# chmod 755 /usr/local/bin/noip2

Now we run noip for the first time to configure for connection to the no-ip service.

# /usr/local/bin/noip2 -C

# cd ..

We now create the startup script so no-ip starts up when the machine starts up.

# cp redhat.noip.sh /etc/rc.d/init.d/noip2

# chmod 755 /etc/rc.d/init.d/noip2

# cd /etc/rc.d/rc5.d

# ln -s /etc/rc.d/init.d/noip2 S99noip2

# cd ../rc6.d

# ln -s /etc/rc.d/init.d/noip2 K99noip2

We can now start the no-ip service

# /etc/rc.d/init.d/noip2 stop

# /etc/rc.d/init.d/noip2 start

Install Virtualbox Headless Server for Guests Operating Systems.

To install Virtualbox which is a free virtual machine software, that allows you to run machines/containers upon a physical server. Virtualbox is free open source technology. It is available for all platforms e.g. Mac OSX, Centos, Windows etc. Virtualbox is very easy to setup upon linux variants as there is software packages already available that you can install in one easy command. Below I will show you howto install Virtualbox and create a container. Virtualbox has a very active community, where help can be found very easily.

This installation will show you how to install via headless solution where no gui isused.

CENTOS:

To install Virtualbox upon Centos is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/yum.repos.d

# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

# yum –enablerepo rpmforge install dkms

Below we will now install the kernel drivers for Virtualbox.

# yum groupinstall “Development Tools”

# yum install kernel-devel

Now we will install the Virtualbox package itself.

# yum install VirtualBox-4.1

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# usermod -G vboxusers username

Ubuntu:

To install Virtualbox upon Ubuntu is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/apt

# vi sources.list

Add the following line below to the sources.list file so we can talk to the Virtualbox repository.

deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free

Now we will install the Virtualbox package itself.

# wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add –

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# sudo apt-get update

# sudo apt-get install virtualbox-4.1

Below I use the root user, you can use any user you believe you want to run

# usermod -a vboxusers

Next we will now post howto setup/create a virtual machine in our next post.

Disable SELinux:

CentOS:

To disable SElinux, the security system within centos, you need to modify the SElinux file. Reasons for wanting to disable SElinux, would be that your server is internal, and to configure each service is a waste of time. SELinux is good for machines that are facing the internet, within a De-militarized Zone.

The SELinux configuration file is located at

/etc/selinux/config

To disable SELinux go to the configuration file look for the following line

SELINUX

then change the line to

SELINUX=disabled

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection. SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definitition file.
SETLOCALDEFS=0

The above with take effect during the next reboot, but if you need the effect to be immediate you can disable SELinux immediately at the command line with the following command

# setenforce 0

Network Time Protocol:

Keeping track of time on your server can become a bit daunting, when you start having multiple number of servers. A solution is called ntp (network time protocol). The machine ever so often, loses time, by going out up to a few hours. Defined period checks with a main time server, and adjusts your machines time if it is out from the main timeserver.

CentOS:

The following commands below will install and configure ntp under CentOS.

# yum install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/rc.d/init.d/ntpd restart

The results will be shown as below.

Shutting down ntpd:    [ OK ]
Starting ntpd:              [ OK ]

Ubuntu:

The following commands below will install and configure ntp under Ubuntu.

# apt-get install ntp

# /etc/init.d/ntp restart

Configuring the ntp.conf files will not be needed as they are automatically configured during installation.

Generic

Another way around this issue is to manually have the ntpdate application run directly via the cron to update the time. This issue is caused on virtual machines where the virtual software forces the virtual machine to sync with the host machine. Below is a work around. Just enter this into cron. The ip of the time server is au.pool.ntp.org

# crontab -e

*/5 * * * * /sbin/ntpdate -u 149.20.68.17

Change System Hostname:

CentOS:

To change the hostname, the hostname is located in the following configuration file

/etc/sysconfig/network

The file contains three lines. We are only interested in changing the third linux beginning with hostname as this is the hostname. You can add whatever suits your fancy after the equals symbol.

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=bob

Then you need to restart the networking process, via the following command

# /etc/rc.d/init.d/network restart

Now you can restart the network services that control the hostname at startup. Manually starting the  above command should show you the results below.

Shutting down interface eth0:                             [  OK  ]
Shutting down loopback interface:                    [  OK  ]
Setting network parameters:                                [  OK  ]
Bringing up loopback interface:                          [  OK  ]
Bringing up interface eth0:                                   [  OK  ]

Now your hostname should be changed. You can check your hostname with the hostname command

# hostname
bob

Ubuntu:

Under ubuntu to change the hostname as of this writing using ubuntu version 10.04.03 you need to modify the following file

/etc/hostname

There will be one line with the name of the machine. Just change the name from what exists to the new name you want the machine to be called. There is a issue I have with ubuntu 10.04.03. It seems that the init script to restart the hostname does not work, nor the hostname service. The only way I have been able to get around this is to reboot the machine. This may be fixed in versions afterwards.