Finally a half decent Scala IDE

For some time now programming in Scala has required you to take a standard eclipse install and add a one of 2 pretty poor Scala plugins. Both of which left you feeling that you are not really getting the full Scala experience.

Enter Scala IDE 3.0, built on top of the Keplar release of Eclipse, for the first time, the support for Scala is well integrated, smooth and works really well.

Now just need to find a decent Clojure IDE and I’m sorted….

Install Java 7 on OSX

If you currently have your JAVA_HOME environment variable set as the trusty:

export JAVA_HOME=/Library/Java/Home

then when you upgrade to Lion you will need to adjust it, as the install location has changed. The new environment variable should be:

export JAVA_HOME=$(/usr/libexec/java_home)

This is actually a command which (in true OS X Java fashion) is a symlink to another command that outputs the true location of Java.

 

Techcrunch – Installing Postgres on EC2 Ubuntu Server

Most of this section if cribbed directly from an article at Digital Ocean

sudo apt-get install postgresql
sudo apt-get install postgresql-contrib
sudo apt-get install phppgadmin

Change Apache access for phppgadmin we just installed

sudo vim /etc/apache2/conf.d/phppgadmin

Change so it looks like ( remove # from 4th line )

order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all

Restart Apache

sudo /etc/init.d/apache2 restart

If you now head over to http://localhost/phppgadmin you’ll see PHPAdmin for Postgres

Now we add some more security

sudo vim /etc/apache2/sites-enabled/000-default

Add the following to Virtual Host at the bottom

<Directory "/usr/share/phppgadmin">
AuthUserFile /etc/phppgadmin/.htpasswd
AuthName "Restricted Area"
AuthType Basic
require valid-user
</Directory>

Save and exit, n ow lets create a user id and password for access

sudo htpasswd -c /etc/phppgadmin/.htpasswd username

Enter userid and password, then restart Apache

sudo /etc/init.d/apache2 restart

Next we set the Postgres login credentials

sudo vim /etc/postgresql/9.1/main/pg_hba.conf

Look for the line that looks like

local all all peer

And change the peer to md5 so it looks like

local all all md5

Now we can su to postgres and create a database

sudo su - postgres

Then create a new database
createdb <newdbname>
And then create credentials for that database
createuser -P
Enter the name and password of the database user, making sure to set the user to be superuser

Now we can access the database via the Postgres command line

psql newdbname

You can now perform SQL against the databse. If you need to quit type \q

Head back over to PHPAdmin and we can now login with the credentials we created and access our new database

http://localhost/phppgadmin

Techcrunch – Apache and Tomcat on Amazon EC2 Ubuntu Server

# Install Base Apps
 sudo apt-get update

 

# Tools
 sudo apt-get install vim

 

# Basic Build
sudo apt-get install build-essential
sudo apt-get install subversion
sudo apt-get install git-core

 

# Apache
sudo apt-get install apache2

Go to http://localhost and you will see a web page that begins with

It works !

 

# PHP 5 – Useful for phppgadmin and other stuff
sudo apt-get install php5 libapache2-mod-php5
sudo vim /var/www/info.php

And enter the following
<?php phpinfo() ?>

If you now go to http://localhost/info.php you will see the PHP Info page

 

# Useful PHP Add ons

sudo apt-get install php5-cli php5-common php5-curl php5-dev php-pear

 

# Java 7
sudo apt-get install openjdk-7-jre
sudo apt-get install openjdk-7-jdk

Type in ‘java -version’ and it will tell you which version of Java is now installed

# Tomcat
sudo apt-get install tomcat7

Pop over to http://localhost:8080 and you’ll see the Tomcat home page

 

# Tomcat docs and examples
sudo apt-get install tomcat7-docs
sudo apt-get install tomcat7-examples
sudo apt-get install tomcat7-admin

 

Now add a user to access the tomcat admin screens, as per the instructions on the Tomcat home page
sudo vim /etc/tomcat7/tomcat-users.xml.

<role rolename=”manager-gui” />
<role rolename=”admin-gui”/>
<user username=”[user]” password=”[password]” roles=”manager-gui, admin-gui” />

Obviously replacing [user] and [password] with the userid and password you want to use

sudo /etc/init.d/tomcat7 restart

 

Jobs a good’in !!!!!!

 

 

 

Techcrunch – Working with Ubuntu Server behind a proxy

Quite often you will be working on Ubuntu behind a proxy, this makes apt-get very difficult to use, the way round this is to configure a 10proxy file that directs the apt-get how to work through the proxy

First create a file called ’10proxy’ in /etc/apt/apt.conf.d/

sudo vim /etc/apt/apt.conf.d/10proxy

In this file add the following contents

Acquire {
Retries "0";
HTTP {
Proxy "http://[address]:[port]";
};
};

Replacing [address] and [port] with the address and port of your proxy server

Techcrunch – VMWare Tools on Amazon EC2 Ubuntu Server

How to install VMWare Tools on Ubuntu Server running on Amazon EC2

Go to Virtual Machine > Install VMware Tools (or VM > Install VMware Tools).


sudo mkdir /mnt/cdrom
sudo mount /dev/cdrom /mnt/cdrom or sudo mount /dev/sr0 /mnt/cdrom
ls /mnt/cdrom/
tar xzvf /mnt/cdrom/VMwareTools-x.x.x-xxxx.tar.gz -C /tmp/
cd /tmp/vmware-tools-distrib/
sudo ./vmware-install.pl -d
sudo reboot

Replacing VMwareTools-x.x.x-xxxx.tar.gz with the actual version numbered file located in /mnt/cdrom

Monitoring the super computer with Nagios – Part 2: Adding More Hosts

Nagios stores all of its host configuration files in

/etc/nagios3/conf.d

In this folder we are interested in the config file

localhost_nagios2.cfg

We need to create one of these for each of the servers we want to monitor, so copy this file as many times as you have servers, each time your copy replace localhost in the name with the name of the server to monitor.
In this instance, I have 6 servers

sudo cp localhost_nagios2.cfg rasp-blue_nagios2.cfg
sudo cp localhost_nagios2.cfg rasp-green_nagios2.cfg
sudo cp localhost_nagios2.cfg rasp-white_nagios2.cfg
sudo cp localhost_nagios2.cfg rasp-yellow_nagios2.cfg
sudo cp localhost_nagios2.cfg rasp-purple_nagios2.cfg
sudo cp localhost_nagios2.cfg rasp-red_nagios2.cfg

For each file, open up in your editor and replace every instance of localhost with the name of the service

define host{
use generic-host
host_name REMOTESERVER ; Change to the remote server's hostname and domain name.
alias REMOTESERVER    ; Change to the remote server's hostname
address 5.6.7.8    ; Change to the remote server's IP address (WAN?)
}

define service{
use generic-service
host_name REMOTESERVER ; Change to the remote server's hostname and domain name.
service_description Disk Space 1
check_command check_nrpe!check_sda1
}

define service{
use generic-service
host_name REMOTESERVER ; Change to the remote server's hostname and domain name.
service_description Current Users
check_command check_nrpe!check_users
}

define service{
use generic-service
host_name REMOTESERVER.EXAMPLE.COM    ; Change to the remote server's hostname and domain name.
service_description Total Processes
check_command check_nrpe!check_total_procs
}

define service{
use generic-service
host_name REMOTESERVER ; Change to the remote server's hostname and domain name.
service_description Current Load
check_command check_nrpe!check_load
}

Next we tell Nagios what services are running on each server. This is contained in the file hostgroups_nagios2.cfg. Add the name of each server to the list of members for each service to monitor

# Some generic hostgroup definitions

# A simple wildcard hostgroup
define hostgroup {
        hostgroup_name  all
                alias           All Servers
                members         *
        }

# A list of your Debian GNU/Linux servers
define hostgroup {
        hostgroup_name  debian-servers
                alias           Debian GNU/Linux Servers
                members         localhost, raspi-blue, raspi-green, raspi-white, raspi-yellow, raspi-purple, raspi-red
        }

# A list of your web servers
define hostgroup {
        hostgroup_name  http-servers
                alias           HTTP servers
                members         localhost, raspi-blue, raspi-green, raspi-white, raspi-yellow, raspi-purple, raspi-red
        }

# A list of your ssh-accessible servers
define hostgroup {
        hostgroup_name  ssh-servers
                alias           SSH servers
                members         localhost, raspi-blue, raspi-green, raspi-white, raspi-yellow, raspi-purple, raspi-red
        }

Now we restart Nagios and we’ll see each of the servers

sudo /etc/init.d/nagios3 restart

This information was scammed from Will Bradleys website, which is an excellent source of information on configuring nagios

Why oh Why do I use RS

So a friend recommended some new cases for the Pi which are available at RS, great I thought, I can buy 8 black bases and 8 different coloured tops so that I can start to refer to the PIs by their colour in the grid, rather than numbers.

I’m always dubious of RS given they messed up early deliveries of Pis, but I placed an order for 9 of each and a few days later they duly arrived in an unpadded bag………….

I refuse to use the word packed for shipment, instead 16 rather nice looking but flimsy bits of plastic where thrown into the back with no thought to order or safety.

3 arrived broken, 2 bases and a top. Well it is RS after all what more did I expect and rather than go through the pain of sending them back and them chucking another load at me in the post, whipped out the super glue and repaired them.

How does that company manage to exist…….