trying to understand how does SMB work - smb

I'm trying to create a file on shared location and write the string which is being passed to it. All this I'm doing as shown below,
String user = "abcd:XXXXX";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
String path = "smb://smb/ds/TESTING_GOING_ON/test.txt";
SmbFile sFile = new SmbFile(path,auth);
try (SmbFileOutputStream sfos = new SmbFileOutputStream(sFile)) {
sfos.write(str.getBytes());
sfos.close();
}
Its working fine, this I'm trying to do from Windows to shared drive(which os I dont know.)
I'm trying to understand how does smb works, that's why I read the document what is SMB.
But I'm not able to map here if above code is running fine then,
which is SMBclient(Is this my windows machine as stated in the document "Microsoft Windows for Workgroups 3.x")
What is acting as SMB server?
Not able to get clear idea about it.
Any help would be really appreciated. Thank you.
I'm trying to get deep into this because, the above code works fine for local windows 7 machine but not working on cloud environment which is linux.
Also, If there is network access that needs to be provided from cloud environment then, what all information do I need to have before going to network department for access. for eg. which port the connection open etc. and I don't know what other information I will need to make it happen

Could you give some more information please?
Assuming your program is written Java, how do you execute it on Windows and how is it ran in Linux?
Which Linux distribution is running on your linux box?
What happens on your linux box when the program is not working as expected?
As Java code should be cross platform, it might be usefull to check if you have the right java runtime installed on your linux box.
Which java related packages are installed?
The document you are using to read up on Samba was last updated in 2002, it might be usefull to check for some more recent documentation, eg. samba wiki

Related

How to create windows custom virtual printer to send document to remote server

I am pretty new to windows development and I want to create a package that installs a virtual printer. This virtual printer when selected during the printing process, sends the file to a remote server (REST API), nothing more, no rendering, no UI.
I tried googling regarding this but couldn't find any good docs or source code on how to create a driver.
Any help would be much appreciated.
You can use one of the Microsoft Printer Driver Samples from here.
I think that you might be able to maybe SampleOpenXPS sample

I want to open a software GUI on ubuntu SERVER.

I would like to know open a GUI of a software called datacenter datastax which is a UI for Cassandra where we can manipulate the data.
Firstly, I want to install datacenter on my office server where multiple VMs are setup. Out of one of those VMs, I have created a fresh 'ubuntu server' VM and install the datacenter within. Since ubuntu server is only based on CLI but the data center is all GUI. How come I achieve this? I mean I want to access the GUI of this software while it's installed within a ubuntu server.
Reason for me doing this is because every person within the office can access the GUI of the datacenter when I share them the ip or whatever.
Please help me with this. Ill highly appreciate it.
You need to export the console from the server to the machine you want to access GUI from.
Something similar like this export DISPLAY=":0.0" where you replace ip_address with the ip address of the machine that you want to send GUI to, if the machine is some *nix machine. Then run the command to start the GUI. After this, the GUI should be redirected to the machine having the
If it is a Windows machine, you will need to run xming on it.
Also, please note that this is not a Cassandra related question, even if you want to start a Cassandra related GUI.

Trying to create dev with SPEasySetUp and VMWare

I am trying to create a dev box for SharePoint 2010 Server utilizing the following:
http://blogs.msdn.com/b/cjohnson/archive/2010/10/28/announcing-sharepoint-easy-setup-for-developers.aspx
So first of all this is new to me. I understand that these are instructions are for dual boot in Windows Native, but I am more interested in using a VHD/image of the OS to run on VMWare.
I have tried creating an image of a running virtual machine with sysprep tool, but hit a dead end with capturing the image to a file that I can reference within the running machine to run the scripts against.
I took a look at Diskpart on TechNet, but as I am new to this, I am not sure this is what I want to do?
I tried installing to the local host (virtual machine that is running) and am getting an error there also; fails at Windows Identity Framework.
It is a clean install of Windows 7 (literally nothing else), and the UAC has been disabled.
Is there any insite, help, or advice anyone can provide me regarding this? I would really appreciate it as I have to get working on the development aspects of SP (workflows, web parts,etc), and need a dev env, and I can't seem to get anywhere with this.
Thanks
Justin

Mono DirectoryInfo for network share

I wrote a quick console app in VS2010 to copy a file from a network location to a specified location on disk. The program works fine on Windows but when I copy it into the Mac and execute it against the Mono runtime, it seems to have trouble opening the network share.
My code to create a DirectoryInfo object looks like this:
var dir = new DirectoryInfo(#"\\nameofserver\location\to\file");
In Windows, this resolves correctly to the network share. In Mac, it gives me a relative path to the binary (I was running it from the Desktop):
/Users/username/Desktop/\\nameofserver\location\to\file
I did Google it a little bit and it suggested that my path should be of the form smb://.... However, even when I do this, my DirectoryInfo resolves to:
/Users/username/Desktop/smb://nameofserver/location/to/file
I'm guessing there is either a syntax I'm missing to be able to get access to the network share or that it isn't so straightforward on OSX. Either way, I'd like to know how to connect to the network share and download the file.
Thanks!
EDIT:
I tried //nameofserver/location/to/file. This helped somewhat, except that it still did not resolve the network share reference, instead assuming the path to be a local one:
/nameofserver/location/to/file

How to deal with symbolic links when going between Linux and Windows?

I have a django project that runs on a Linux server, and I've been working on it both on Linux and OS X. I've noticed that some of the pages are a bit off, to put it politely, in Internet Explorer, and so I checked out the subversion repository on Windows and tried to run a local server.
My media directory has symbolic links to all of the media from each different app, and obviously Windows doesn't know what to do with them. I could simply hard-copy or link everything manually in Windows, but then I wouldn't be able to check that in (since the site runs on a Linux server), so it'd be a pain in the neck.
What is typically done in this case?
Set up a configuration using httpd and mod_wsgi that has appropriate Alias directives for the static media.
you could also add some static.serve links in your urls.py for debugging purpose :
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static/(?P<path>.*)/?$', 'django.views.static.serve', {'document_root':settings.MEDIA_ROOT, 'show_indexes':True})
)
quicker than setting up apache+friends on win32.
Instead, of running a server on Windows just to test for IE, you can run a server from on an IP that identifies your machine on your network. Just run
python manage.py runserver ad.dr.re.ss:8000
To find the (local) address of your machine, access your router logs to see who's connected (I'm sure there's a better way, but this worked for me).

Resources