Showing posts with label settings. Show all posts
Showing posts with label settings. Show all posts

Monday, 31 March 2014

Ubuntu Server - Automatic E-mail of Status upon Boot

As the multiboxer project has grown, I now need to support multiple bug reporters (I have three helpers now, if you've not donated yet and joined in you're missing out!)....

So with the new bug reports I'm looking at establishing a server at home, with a private IP and allowing the helpers to post their tickets there.  The trouble is, the loft man lab, where the server is stationed, is serviced by wireless only.  The signal strength is good, and I'm not going to throw a cat-5-e cable up there because I've spent too much time fixing walls and removing old dead telephone cables as it is.

The server is a Ubuntu 12.04.4 LTS box, and when it boots I want it to e-mail the testers, and me, its IP Address.  This way I don't have to faff about with dyndns (as much as I love them, their usage terms are a pain in the arse for free users now-a-days) or any other dynamic domain name service.

Now, the IP mailing just needs to send the interfaces information out, through a few tricks the IP of eth0 is the router outbound IP, and I've carefully opened port 80 for them to chat to it over the web...

So, to set this all up... We need a script to wait an amount of time, then get the adapter information, and then e-mail it...

sudo nano /usr/sbin/bootmail.sh

The script then looks like this:

#!/bin/bash
echo Waiting...
sleep 30
echo Getting Interface Info
ifconfig > /tmp/ifinfo.txt
file=/tmp/ifinfo.txt
echo Sending mail...
function mailalert(){
  echo Calling Mail...
  sendmail -F "noreply@Git-Server-VM" -it << END_MESSAGE
To: user1@gmail.com,user2@gmail.com,xelous@hotmail.co.uk
Subject: Multiboxer IP Update

$(cat $file)
END_MESSAGE
}
mailalert
echo Complete

You can look at this yourself in detail, I'm noting it for reference myself...

You save this file and then have to allow it to execute:

sudo chmod +x /usr/sbin/bootmail.sh

And finally we need to add it to the boot script, so its run as the server comes up...

sudo nano /etc/rc.local

And before "exit" at the bottom add:

/usr/sbin/bootmail.sh

Reboot your server and you'll now get an e-mail of the IP interfaces sent out...

I may later improve the script to add the bug reporters to a known user group, use echo & cat to output the members of that group into a file, and use that list as the "To" field.  But for now, with the happy few of us, this will do.

Now, I would have previously (as you can tell by my older blog entries) used Subversion.  However, I'm managing this project with Git, so I may also now set up the Git on this server, and put a centralised copy of the code onto it, securing it with SSH... Pretty sure there was a good tutorial on setting this up on a server in a recent Linux Format...

Thursday, 18 July 2013

Disabling the Java Updater

I've had a annoying moment with the Oracle Java Updater, we have a system which though not using Java can run applications using Java, our system however is all seamless, there's no desktop and it boots into a managed environment for display.  Trouble was the base disk we have had had the java update enabled, so about 50 seconds after starting the desktop changed to an Administrative mode asking for permission to update Java.... SIGH!

So this morning I've spent about half an hour figuring out a fix, because we can't seem to remove the Java update service.  No problem, lets change the setting to disable it... So I fire up explorer, and there is the java Updater in the system task tray...



See, there it is... And you can right click on it and access the Properties...


And hey look, there's an option to NOT do updates... Lets select that....



Oh look, an apply button, I'm not a rookie, so I'll click that for good measure.... and then OK...



*Whistle*... *humm*... So lets go back in there and see what its done...


Holy mother fucking god the setting is back on... Thank's Larry, this is really good stuff...

How you actually this off, is to disable the whole updater/deployment tool... So go into your User AppData directory, so my username is "Xel" so the path is: C:\Users\Xel\AppData.  This is a hidden folder, but just type it in to the start box, so if you're "judy"... C:\Users\Judy\AppData, and now we can go into: "LocalLow" and then "Sun" (yes Oracle fuck up the installer and still have the balls to name the folder "Sun").

Next you go into "Java" and then "Deployment"... Now we're past the gravy and against the meat, you should see a file called "deployment.properties"... Open that in a text editor and change the "deployment.javaws.jre.0.enabled=" from "true" to "false" so it looks like this:

deployment.javaws.jre.0.enabled=false

And reboot, now the deployment tool won't even start - let alone bug you or update the java runtime.