• {blog}
  • Blogroll
  • IMServer

Mike Blamires

mmm technical

  • Home
  • Contact
  • Log in

RSA Public Key Encryption

January 23rd, 2008

As part of my final project I will be implementing some encryption routines, in order to ensure that I can translate the maths involved I created a basic 'proof of concept' test. I have attached the class to this, I'll put up a JUnit test as well soon as I'll be needing that throughout the development of my project.

Once compiled just run it as such, both command lines are optional, defaults are 1024 & false respectively.

java RSAtest [bit_length (int)] [debug (Bool)]

Java RSA test file

Posted in Geek, java | Send feedback »

KDE 4

January 22nd, 2008

Firstly a quick install guide on Kubuntu (see http://www.kubuntu.org/announcements/kde-4.0.php for more detail):


sudo echo "deb http://ppa.launchpad.net/kubuntu-members-kde4/ubuntu gutsy main" >> /etc/apt/sources.lists
sudo apt-get update
sudo apt-get install kde4-core

I have used KDE over Gnome for a long time, simply because KDE is much more configurable than Gnome and with the leap that Vista has taken (not that I can say I like it) I was secretly looking forward to the the KDE response and managed to wait until after release.

Read more »

Posted in Ubuntu | Send feedback »

RFC compliant POP3 Protocol C# class

January 19th, 2008

For a recent project I was completing to shift email into a SQL server I produced the following, it's a bit like re-inventing the wheel but I had my own vision of how it would work and it was a simple enough process.

The Visual C# 2008 project attached builds to class library, it has a few custom exceptions and is pretty simple to use. It's RFC 1969 compliant but it doesn't support MIME attachments.

The project can be found here: http://www.blamires.co.uk/development/POP3Protocol/POP3Protocol-0.1.zip

Posted in Geek, Web, Networking | Send feedback »

Active Directory - account lockout monitor

January 19th, 2008

In my place of work with several hundred advisors account lockouts are a very frequent occurance, and of course the system administrators must unlock them, not a difficult or time consuming task but certanly one that could be easier.
Late last year I had written a ASP.NET page which enumerated the accounts on a domain and allowed them to be unlocked on the site, so this application simply takes it into the application domain and adds some functionality sugar to the core function.

The application sits in the system tray and checks at the specified interval, listing locked accounts in a drop down. Accounts can be unlocked at once or all together.

There is a hellishly annoying pop up option that displays a bubble alert from the system tray when locked accounts are detected on the domain. It's crude but works, I'll update it here if I update it.

Requirements:

  • .NET Runtime 2.0
  • Permissions on the domain to modify accounts (i.e. Domain Admin)

It's compiles to a single executable file, the Visual C# Express 2008 (including binaries) can be found at http://www.blamires.co.uk/development/AccountUnlock/AccountUnlock-0.1.zip

Note to self: should be in the pub or bed.

Posted in Geek | 1 feedback »

More Javascript Love - JQuery and the mystical remove

August 30th, 2007

Today I have started sewing my JQuery hat for a project at work. It really does take all the pane out of working with and manipulating the DOM in some very fancy ways, especially when it comes to cross browser compatibility.

There seem to be a few nuances within it but by enlarge it is comprehensive, very simple to use and very extensible. The one that did take a little getting around was appending to and removing the parent element. For example, I want to dynamically add to add divs to the page and when you hover over the items a 'remove' button appears, until you move off which lets you remove the item from the list.

So I have the following snippet to run when the DOM is complete:


  $(document).ready(
  	function () {
  		$('.element1').hover(
  			function () {
  				$(this).addClass('hover');
  				$(this).append('<p class='removeButtonP'><input type='button' value='x' class='removeButton' id='removeButton'&gt</p>');
  				$('.removeButton').click(
  					function () {
                                                //this event needs to remove the div (.element1) 
  					}
  				)
  			},
  			function () {
  				$('.removeButtonP').remove('p');
  				$(this).removeClass('hover');
			}
  		) 		
  	}
  )	


I would expect the DOM (very representative!) to look like this after we had moved over the first of three divs:

document
 |
 |-html
     |
     |-head
     |-body
         |
         |-[0] div className='element1'
         |-[1] div className='element1'
         |-[2] div className='element1'
             |
             |- p
                 |
                 |- input type='button'

so when the click(function) is called $(this.parent) should refer to element1 but it doesn't, p.parentNode is null so the DOM isn't laid out as you would expect.

To combat this i have modified the code to the below to add a dynamically created id to the div you are hovered over and places this id also in the click() function parameter. The code is commented so I won't go over it here.

 
  $(document).ready(
  	function () {
  		$('.element1').hover(
  			function () {
  				//create a random 'GUID' value
  				var guid = generateGuid();
  				//when we add our remove button as we hover over
  				//we also set the id of the element we are accessing  
  				$(this)[0].id = guid; 
  				$(this).addClass('hover');
  				$(this).append('<p class='removeButtonP'><input type='button' value='x' class='removeButton' id='removeButton'></p>');
  				$('.removeButton').click(
  					function () {
  						//remove the specific element we are hovered over.
  						//remember: as this is nested in .click(function)
  						//$(this) refers to the input element withe the
  						//class .removeButton   											$('#'+guid).remove('div');
  					}
  				)
  			},
  			function () {
  				$('.removeButtonP').remove('p');
  				$(this).removeClass('hover');
			}
  		) 		
  	}
  )	  
  
  
  // with thanks to http://blog.shkedy.com/ for the handy function
  function generateGuid() {
	var result, i, j;
	result = '';
	for(j=0; j<32; j++) {
		if( j == 8 || j == 12|| j == 16|| j == 20)
			result = result + '-';
		i = Math.floor(Math.random()*16).toString(16).toUpperCase();
		result = result + i;
	}
	return result
  }



Posted in Geek, Web | Send feedback »

1 2 3 4 >>
  • January 2012
    Mon Tue Wed Thu Fri Sat Sun
     << <   > >>
                1
    2 3 4 5 6 7 8
    9 10 11 12 13 14 15
    16 17 18 19 20 21 22
    23 24 25 26 27 28 29
    30 31          
  • Mike Blamires

  • My name is Mike Blamires, welcome to my vaguely flowing tech blog, it's 90% for my own benefit working on the "why not make it public premise" content should include musings on Linux (Ubuntu mostly), Open Source, Software Engineering, Java, .NET, Web Applications(PHP etc), Databases, Enterprise Apps & anything else I think of that kind of fits. I can be contacted through mike[at]blamires.co.uk

    • Recently
    • Archives
    • Categories
    • Latest comments
  • Search

  • Categories

    • All
    • Announcements [A]
    • Background
    • Geek
      • java
      • Linux
        • Ubuntu
      • Networking
      • SQL
      • Web
    • News
    • Off Topic
  • The requested Blog doesn't exist any more!
  • XML Feeds

    • RSS 2.0: Posts, Comments
    • Atom: Posts, Comments
    What is RSS?
blogging tool

©2012 by Mike Blamires | Contact | Design by Michael | Credits: blog soft | UK web hosting | adsense