| Subcribe via RSS

Creating an Instant Messaging System using PERL – Guide

November 20th, 2008 | No Comments | Posted in General Site, Security

Recently, while relatively bored i decided to create an instant messaging system running on Ubuntu using PERL. Below is the code, it may be interesting for some people! Basically, V-Recieve is the server which can recieve the messages being sent from all the clients running V-Send. In the program before, i have modified it slightly, so along with printing out the message it runs the command on the system :) So messages like “ls -la” will produce an output on the console of the server running V-Recieve, etc. To set this up:

1. Download V-Recieve onto a linux platform

2. Install PERL to /usr/bin/perl (if not already done)

3. Make the program executable: “chown [yourusername]:[yourusegroup] V-Send” will change the ownership. “chmod 750 V-Send” will then allow those users specified before to execute it.

4. Run “./V-Send” and your client messaging system will be up and running. Same command but with “./V-Recieve” on the server.

V-RECEIVE:

#!/usr/bin/perl
use IO::Socket::INET;
system(‘clear’);
print “—————————–\n”;
print (“VKernel Remote Command Console v1.1 \n”);
print “—————————-\n”;

my $text;
$MySocket=new IO::Socket::INET->new (LocalPort=>1234,Proto=>’udp’);
while(1)
{
$MySocket->recv($text,128);
$hostip=$MySocket->peerhost();
if($text ne ”)
{
print “\nRecieved message from $hostip: $text \n”;
print “Command Output:\n”;
system(“$text”);
print “\n”;
}
else
{
print “Client has exited!”; exit 1;
}
}

V-SEND

#!/usr/bin/perl
use IO::Socket::INET;

#Welcome Message
system(‘clear’);
print “—————————–\n”;
print (“VKernel Remote Command Console v1.1 \n”);
print “—————————-\n”;

#Enter Destination IP Message
print “Please Enter the destination IP: \n”;
$DestinationIP = <STDIN>;
chomp $DestinationIP;

#Enter message to sent to Server
print “Please Enter your message: \n”;
$msg=<STDIN>;
$MySocket=new IO::Socket::INET-> new(PeerPort=>1234,Proto=>1234,Proto=>’udp’,PeerAddr=>$DestinationIP);
$MySocket->send($msg);

while($msg=<STDIN>)
{
chomp $msg;
if($msg ne ”)
{
print “\n Sending $msg…”;
if($MySocket->send($msg))
{
print “done \n”;
print “\nPlease Enter another message:”;
}
}
}

Tags: , , ,

Desktop running solely from RAM using Riser’s

November 18th, 2008 | No Comments | Posted in Microsoft

Another idea, which we at VKernel.co.uk recently had, was taking a lateral view of the whole SSD Situation (Solid State Drive, a drive running basically on NAND Flash Drives similar to the ones you have in phones, digital cameras etc).

What if,  (a question for the SAN guys mainly), you had a desktop PC board, with DDR2 Memory Risers (similar to Intel Caneland systems), which you could load chock full of low-price high speed DDR2. You then attached a large, cumbersome hard drive, 7200RPM IDE drive of ~ 500GB capacity, and a battery powerful enough to run the PC for around 1 minute. You then basically boot into the hard drive, which copies all the executable files into memory (RAM). Your hard drive then shuts itself off (into sleep mode), and your system runs entirely from memory – a lot faster than hard drive read/write access.

At the end of play, when you shutdown your PC, all the files which need saving (updated files) are transferred from RAM to the hard drive, so that you are then able to use them when you reboot. If the power to the computer is lost, there should be enough energy in the battery to allow the system to write the RAM contents to a “quick dump” on the hard drive, which the OS will sort out next time the system is booted.

This should speed up operating system use times significantly. If anyone is interested in working on this with me then please feel free to get in contact by dropping me an email at sam[at]vkernel.co.uk (replace the [at] with an @ obviously, this is done to help dodge the spam bots!).

Sam Marsh 2008 (c)

Tags: , , ,

Virtual Networking Idea

November 18th, 2008 | No Comments | Posted in Networking, Virtualization

In normal P2P transfer/ad-hoc network transfer; the data transfer rate (MBps) is constrained by the medium; the NIC, the stack and the drivers, normally limiting to either 100Mbps or 1000Mbps (full/half). These are physical issues which need to be addressed at a layer 1 level / layer 2 level.

My question to you, the world, is – why arent virtual networking p2p transfers faster? If you want to transfer files beetween 1 VM and another VM; the transfer should be upwards of 1/2GBps – as you are transferring files in beetween the same file system (granted via a few security measures). There is no interaction with the physical NIC’s or mediums at all. In theory, all it will be doing (please correct me if wrong), is transferring a file out of the virtual machine hard drive, from the hard drive through the VM Container, out onto the VMBus/Hypervisor bus, back into the other container, and then into the other VM’s hard drive. The only constraint here, is the TCP/IP stack, which im sure can be slightly modified / a new protocol made for VM Transfer, allowing 2/3/4 GBps and upwards transfer.

Sam Marsh 2008 (c)

Tags: ,