Java Logo

I had the issue today of not being able to install Java as can be seen below. (I snipped a lot of the garbage that we don’t need to see for the solution)

hendri@techedemic:~$ sudo apt-get install oracle-java9-installer 
Do you want to continue? [Y/n] y
Setting up oracle-java9-installer (9b81+9b81arm-1~webupd8~1) ...
Downloading Oracle Java 9...
--2015-09-30 14:35:17--
Connecting to connected.
Proxy request sent, awaiting response... 403 Sorry, not allowed to fetch that type of file: jdk-9-ea-bin-b81-linux-x64-09_sep_2015.tar.gz
2015-09-30 14:35:17 ERROR 403: Sorry, not allowed to fetch that type of file: jdk-9-ea-bin-b81-linux-x64-09_sep_2015.tar.gz.
download failed
Oracle JDK 9 is NOT installed.

Continue reading

Changing something small, on the fly, is possible in WordPress by navigating to Appearance -> Editor. It’s a great tool if you need a web guru on your server but you don’t want to give him access to your backend. But them he calls you and explains that he is getting the following error when trying to edit your theme files using the WordPress editor

"You need to make this file writable before you can save your changes. See the Codex for more information."

Ok, sure, I’ll check the codex. But it still doesn’t work, even with permissions of 777 (or -rwxrwxrwx)!
Continue reading

Google recently implemented additional SPAM filtering mechanisms whereby they will check whether a message conforms to the IETF RFC 2822 specification (the spec defines the ‘email message standard’). The IETF specification can be viewed here ->

When writing your Perl scripts you might get something back like the following when trying to send a mail to a GMAIL address:

The following message to <someemailaddress> was undeliverable.
The reason for the problem:
5.3.0 - Other mail system problem 550-'5.7.1 [      11] Our system has detected that this message is\n5.7.1 not RFC 2822 compliant. To reduce the amount of spam sent to Gmail,\n5.7.1 this message has been blocked. Please review\n5.7.1 RFC 2822 specifications for more information. bc3si6864125wjc.158 - gsmtp'

The fix is relatively simple (if it is in fact your problem): specify as many fields as possible when building your message object. Fields like from and subject were considered ‘optional’ in the past (older, pre RFC 2822, spec) but that is no longer true. Even a mail client like Thunderbird or Outlook fills in values (albeit sometimes blank) to make your email go through properly and not be cast out via SPAM filtering
Continue reading

Pre Windows Vista, you could find the version of Internet Explorer via WMI using the following method:

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & _
Set colIESettings = objWMIService.ExecQuery _
    ("Select * from MicrosoftIE_Summary")
For Each strIESetting in colIESettings
    Wscript.Echo "Version: " & strIESetting.Version
    Wscript.Echo "Product ID: " & strIESetting.ProductID
    Wscript.Echo "Cipher strength: " & strIESetting.CipherStrength

The MicrosoftIE_Summary object does not exist post Windows XP though (Why Microsoft, why?), so to find your browser versions, you could use the following VB Script, which essentially just checks the file version for you.

Continue reading

If you administer a lot of Ubuntu machines in many different locations, odds are you’ve been in the situation where you need to install a package,
and in this case more specifically openjdk-6-jre, withou access to the internet or any apt repository.

The simplest way to do this is to manually install using a .deb package (syntax: sudo dpkg -i package_name.deb ), although that will mean you will have to meet some strict dependencies, which in itself can become a nightmare to figure out.

There is another way and it’s simpler than you think – although some functionality might not be available. If you simply want to be able to execute ‘java’ with some parameters, for example generating reports from your web application, then read on..
Continue reading

If you need to find the exact X/Y coordinates of a specific element for whatever reason, you can use the following function:

function getXY( oElement )
	var yReturnValue = 0;
	var xReturnValue = 0;
	while( oElement != null ) 
		yReturnValue += oElement.offsetTop;
		xReturnValue += oElement.offsetLeft;
		oElement = oElement.offsetParent;
	//At this point you can 'return' the values as well
	alert("Y : " + yReturnValue + " - X :" + xReturnValue );

Below is an example of how it can be used:

   This will give the X/Y coordinates of the hyperlink on the page
<a href="" onClick="getY(this);">Google</a><br>