Suddenly Spring - פתאום אביב

Sunday, 5 April 2009 06:16 by Tamir

This is a song I recorded couple months ago. It's actually the first song I recorded all by myself, and I beleive the result is not too bad :)

Read more...

Currently rated 1.8 by 325 people

  • Currently 1.834504/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

SharpPcap v2.02 is out!

Saturday, 28 February 2009 01:06 by Tamir

Chris has posted a new SharpPcap release. It contains some API changes and bunch of important bug fixes. Make sure to check it out on the sourceforge project page:

Way to go Chris! keep up the great work Laughing.

Currently rated 2.1 by 124 people

  • Currently 2.137097/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   SharpPcap
Actions:   E-mail | Permalink | Comments (11) | Comment RSSRSS comment feed

Using FlexiShow for my online photos

Wednesday, 25 February 2009 06:37 by Tamir

So, I was looking for an easy way to show my online photos. I wanted a “slideshow” like app that can dynamically load pictures from a text or xml file so I wouldn’t need to work too hard every time I have some new pics to upload.

Google immediately showed me SlideShowPro, which is an impressive piece of Flash based software for managing online galleries. However I was no keen to use commercial product for this simple task.

The second result I found was Vertigo’s Slide.Show, a Silverlight based application. This seemed to be a very cool open source project, supporting many features. However, I was not so thrilled to go with a Silverlight application, as it’s not yet as popular as Flash, and I didn’t want to ask my site’s visitors to install a third party application just for the sake of viewing my online photos. And besides, I needed a solution that would be as portable across browsers / OS’s as possible.

However, Vertigo’s Slide.Show app inspired me to try and write my own Flash based clone of it.

And so, inspired by Slide.Show the result is FlexiShow Wink, my first Flex application written in Actionscript 3.

It’s still not finished yet, there's more to be done (need to make it more configurable, and do some memory and pefromance tweaks), but here’s a preview of how it looks like (sourc code can be viewed and downloaded from here): 

Currently rated 3.0 by 53 people

  • Currently 3.018868/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   , , , , ,
Categories:  
Actions:   E-mail | Permalink | Comments (58) | Comment RSSRSS comment feed

SFTP transfer modes in SharpSSH

Tuesday, 24 February 2009 08:59 by Tamir

One question I get often about SharpSSH is whether its SFTP implementation support binary vs. ASCII transfer modes.

Well, file transfers in SharpSSH (and of course in JSch as well for that matter) are always done in binary mode. As far as I know the SFTP protocol didn’t define any specific mode for text (ASCII) file transfers (as opposed for FTP).

Currently rated 2.2 by 154 people

  • Currently 2.194803/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   SharpSSH
Actions:   E-mail | Permalink | Comments (112) | Comment RSSRSS comment feed

How to fix: Not all devices are shown with SharpPcap

Saturday, 21 February 2009 05:32 by Tamir

I already answered this on the CodeProject forums couple of times (1, 2), but I'll repeat it here so it would be easy to find this topic.

This issue is not specific to SharpPcap but rather a Winpcap issue (I beleive it's a Winpcap bug but couldn't find any info about it).

The issue is that if you use winpcap in a multithreaded application, and you try do FindAllDevices() or even PcapOpen() on a dialup device from a new thread, winpcap will fail by specifying that it doesn't find this device.

To workaround the issue you can call GetAllDevices() and PcapOpen() from the main thread and use the new thread to use the already opened device. If you see similar issue even on a single threaded application, adding a [STAThread] attribute on your Main function will probably fix the issue.

Currently rated 3.0 by 46 people

  • Currently 3.043478/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   SharpPcap
Actions:   E-mail | Permalink | Comments (57) | Comment RSSRSS comment feed

Using the Expect concept in SharpSSH

Saturday, 21 February 2009 00:25 by Tamir

I get these kind of questions a lot, so I will try to explain a bit the concept of expect.

The whole point of expect is to simulate a session of a real interactive user. A real user typically log into an SSH server using an SSH client. We establish this functionality by creating the SshShell object and connect it:

SshShell ssh = new SshShell(host, user, pass);
ssh.Connect();

After a user has successfully logged in (and before he start entering commands), he typically gets a Shell prompt (sometimes before the prompt you would also get a welcome message). In any case, at this point in our code we need to read the initial response from the server. Depends on your server initial response you should expect this prompt, typically it will just be the regular shell prompt:

ssh.Expect("the initial server prompt");

If from some reason you skip this part, the response you read from the channel will be out of sync, meaning when you write a command and then call expect you will get the response of the previous prompt.

At this point, the user is ready to start entering commands. After each command you should always call expect with the string you want to match.

ssh.WriteLine("ls -lart");
resp = ssh.Expect("shell prompt");
Console.WriteLine(resp);

(See related post on the CodeProject forums page)

Currently rated 2.2 by 142 people

  • Currently 2.204224/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   SharpSSH
Actions:   E-mail | Permalink | Comments (109) | Comment RSSRSS comment feed

SshExec Example

Friday, 20 February 2009 04:53 by Tamir

The following sample shows how to use the SshExec class of SharpSSH:

SshConnectionInfo input = Util.GetInput();
SshExec exec = new SshExec(input.Host, input.User);
if(input.Pass != null) exec.Password = input.Pass;
if(input.IdentityFile != null) exec.AddIdentityFile( input.IdentityFile );

Console.Write("Connecting...");
exec.Connect();
Console.WriteLine("OK");
while(true)
{
    Console.Write("Enter a command to execute ['Enter' to cancel]: ");
    string command = Console.ReadLine();
    if(command=="")break;
    string output = exec.RunCommand(command);                
    Console.WriteLine(output);
}
Console.Write("Disconnecting...");
exec.Close();
Console.WriteLine("OK");

Currently rated 3.2 by 68 people

  • Currently 3.220588/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   SharpSSH
Actions:   E-mail | Permalink | Comments (91) | Comment RSSRSS comment feed

SSH Expect Example

Thursday, 19 February 2009 05:02 by Tamir

The following sample shows how to use expect concept with the SshShell class of the SharpSSH library. This sample is also available in the SharpSSH examples found inside the source package zip file.

SshExpectTest.cs

SshConnectionInfo input = Util.GetInput();
SshShell ssh = new SshShell(input.Host, input.User);
if(input.Pass != null) ssh.Password = input.Pass;
if(input.IdentityFile != null) ssh.AddIdentityFile( input.IdentityFile );

Console.Write("Connecting...");
ssh.Connect();
Console.WriteLine("OK");


Console.Write("Enter a pattern to expect in response [e.g. '#', '$', C:\\\\.*>, etc...]: ");
string pattern = Console.ReadLine();

ssh.ExpectPattern = pattern;
ssh.RemoveTerminalEmulationCharacters = true;

Console.WriteLine();
Console.WriteLine( ssh.Expect( pattern ) );

while(ssh.ShellOpened)
{    
    Console.WriteLine();
    Console.Write("Enter some data to write ['Enter' to cancel]: ");
    string data = Console.ReadLine();
    if(data=="")break;
    ssh.WriteLine(data);

    string output = ssh.Expect( pattern );
    Console.WriteLine( output );
}

Console.Write("Disconnecting...");
ssh.Close();
Console.WriteLine("OK");

Currently rated 3.1 by 83 people

  • Currently 3.07229/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   SharpSSH
Actions:   E-mail | Permalink | Comments (86) | Comment RSSRSS comment feed