I'm looking for some stand alone library to access SMB/CIFS shares.
I am not looking for mounting the shares, just browsing and accessing the files for reading.
Preferable something with a simple simple API similar to regular POSIX operations of opendir, scandir, read and etc.
Thanks in advance!
The libsmbclient shared library is part of samba provides simple API to access Windows file servers.
as you say nothing about the preferred language I would recommend looking on http://jcifs.samba.org especially http://jcifs.samba.org/src/docs/api/jcifs/smb/SmbFile.html
it has what you ask for. Reading files, enumearating directories. API fairly simple.
Pysmb is a good choice if you want to access samba shares from python.
Related
I want to determine where a bunch of websites are hosted: ViaWest, GoDaddy, Amazon Web Services, etc..
There's are free tools online that do this, but this will be slow to use for the number of sites I want to check (hundreds).
I want to script this. I've tried the following bash commands with no luck:
whois
finger
nmap
dig
None of them return the website's host, although they are helpful for things like IP addresses and nameservers. Any ideas?
I also looked into a script that would query the webhostinghero site, but it seemed like there should be an easier way. I have a list of urls and corresponding IPs, if that helps. Thanks in advance.
If you want to obtain bulk whois data, you must go through a company that has access to it, such as ARIN.
However, ARIN has this disclaimer:
ARIN provides access to a bulk copy of all objects in the ARIN Whois directory service to support the work of bona fide academic researchers, and to operators and researchers who are using the data to provide a clear benefit to the broader networking community. ARIN does not provide bulk copies of Whois data to operators who wish to incorporate this data into products, services, or internal systems with no clear benefit to the broader community.
Keep in mind that there is apparently no single, complete copy provided by any other company.
You can also look up the name servers using this C# project, and map values accordingly. Try turning that project into something using netcat. More on that here.
I'm developing an app for filtering network connections from clients to my server (deny or allow to connect to my server).
I'm researching and found some resources like Windows Firewall API.
But I don't know if it's necessary for me or not.
What's the best API or solution to resolve it?
Thank so much.
regards,
Why don't you use an already-developed and proven app in the first place? If you really want to develop a filtering layer then what you need is a Filter driver and more specifically NDIS filter . A sample solution can be found here. But unless you are absolutely sure what you are doing and what you want to achieve I'd strongly suggest that you stick to an off-the-shelf solution - any firewall will be decent, or even a linux machine in front of your server with appropriate iptables rules.
Since you are working in a windows operating system. You would have to make use of Windows Filtering Platform as seen in the documentation on https://msdn.microsoft.com/en-us/library/aa366510.aspx
Drivers like TDS,LSP, and NDIS are all deprecated.
The programming language is C++. In my experience, it was a desktop application with the GUI in WxWidget and writing the filtering network connections hooks into the user mode.
There are two Filtering Layer Identifiers (Run-time Filtering Layer Identifiers and Management Filtering Layer Identifiers ), i made used of the earlier being that its more effective.
Should you need more assistance let me know.
what's the best way to pass data between two ruby programs over the internet? The data is small and needs to be passed frequently. Also, since this happening over the internet, it needs to be secure. I'd appreciate any help, extra points for a pointer to some guides on this topic.
You can use sockets to communicate between two ruby programs ...
https://www6.software.ibm.com/developerworks/education/l-rubysocks/l-rubysocks-a4.pdf
For security use encryption
Is it just me, or does FTP seem a little archaic? It seems slow and inefficient, and its over 30 years old, not that all old things are bad :)
What protocols exist out there that might become successors to FTP?
I've used webdav a little, but don't know much about it. Is it faster? More reliable? More secure?
Why isn't there widespread adoption of a newer technology (yet)?
Update: Specifically, I'm referring to downloading/uploading files between developers and their web server.
I am aware of other mainstream protocols for other uses such as web browsing, file sharing, etc.
The nice thing about FTP is that it works, which is a major improvement over, for example, Windows filesharing (or for that matter, Win7's Homegroups).
There are plenty of other technologies for transferring files though. HTTP is commonly used for retrieving files, SCP or SFTP handle the secure aspect, basically running the usual protocol through a SSH tunnel. As for inefficient? How so? Just because it's old doesn't mean it's inefficient.
How would a more efficient protocol work?
Anyway, FTP has its niche. It is used for transferring files where security is not important. It does the trick there, and I'm not aware of any superior alternatives, nor can I think of any obvious ways to improve the protocol.
This was a provocative article: Wish More Hosts Offered WebDAV? Blame PHP!
A useful thing about WebDAV is that it tends to be more firewall-friendly, you don't need to muck around with PASV. Since it can use HTTPS you can obtain better security that way than you get with FTP.
Here's a discussion about the future of FTP and related file transfer protocols that I blogged about recently.
FTP used to be the One True system to move data around. That's pretty much fragmented now:
for public data distribution: HTTP, BitTorrent
for sharing data inside an organization: web-based tools, SMB and other native filesharing platforms
for moving data between boxes: scp, rsync
for sending data to an individual: email, web-based tools
Actually, I find FTP one of the most efficient protocols, as there is only minimal protocol overhead. Also, FTP commands are plain english words, instead of binary commands.
It's main weakness is the lack of encryption, which puts it IMHO into the same category as Telnet, which has been replaced by SSH mostly.
There are replacements (i.e. SCP), but frankly, FTP is a fine protocol and with FTP over SSH, there is an alternative to it's main weakness available. But yes, nowadays I would use SCP whenever possible.
Simple question, but I can't seem to find the answer anywhere. Is there a way in Windows, or via a third-party utility, to enforce file naming conventions within a Windows network share?
I'm sure this is easy in Sharepoint, but I want to be able to limit users to the file name format they save into a folder. I could create a post-save program to go and look for exceptions after the fact, but I want to try and force the user to name the files according to our standards when they save.
If something is not available/configurable on the server-side, could this be accomplished via VBA in Excel or Word in the save-file dialogue?
Thanks for your help.
A
There is nothing, to my knowledge, that can restrict file names.
Nothing unless you write it yourself.
How about monitoring the folder for changes and as soon as a file with the "wrong" file name is created you alert the user in some way?
Idealy you'd want a "hook" of some sort on the file system level that will also let you fail the file operation if the filename is wrong; but I don't think there's anything at user (not kernel) level that does this.
You will have to write a program to act as a gateway to the share to enforce this. You'll also have to restrict access to the share so users cannot circumvent the program.