How to access Windows shared folders using emacs - linux

I am using Emacs on Linux and would want to know how to access my Windows shared folders from Emacs.
I am able to perform this operation using nautilus (gnome file manager).

Windows shared folders are usually samba shares which can be accessed using tramp. You can find the relevant part in the tramp documentation here in the "smb -- smbclient" subsection. The correct syntax should be something along the lines of
/smb:USER%DOMAINNAME#HOST:/REMOTEPATH

Related

How to set file access rights using Node.js on Windows?

To setup who can access what file, Node.js's fs module provides a number of functions, such as chown.
While this works pretty well on macOS and Linux, it is rather a workaround than a solution on Windows, as Windows does not support such fine-granular permissions on the file system level. However, I know that using the properties dialog in Windows Explorer you can assign permissions to users and groups.
How can I adjust this using Node.js? Apparently, chown and co. do not perform this task, do they?
PS: Of course I can run icacls using a shell command, but I thought that there might be a better way. Is there?

setting up cygwin via the GUI

I have a standalone server running Cygwin -- I did not setup this server, it was inherited. Anyway, I'd like to know what options the installing admin selected in the setup program.
I've read that I could look in /etc/setup, /etc/postinstall, or /etc/preremove but there are a lot of packages in those directories... same goes for the output of cygcheck -c.
I don't want to know every single library on the system... just how to duplicate the install. Is there a way to determine which packages were select in the GUI setup program?
Thanks!
Cygwin is pretty standalone. You should be able to archive up the entire Cygwin directory (and subdirectories) and move it to the same location on another system.
If you archive it up I recommend 7-zip. You can get it free here. The built in Windows archiver can create permission problems when an archive is extracted on a destination system. I recommend 7-zip for both archiving and unarchiving. If you use the built in Windows archiver and then move it to the new system and extract it - it will extract without errors. However you may find things don't actually work right while using some Cygwin applications
If you don't copy everything you won't move any of the original admin's custom changes.

Preserving permissions while copying from Windows to Linux

I gave execute permissions to a file and then compressed into a zip file in Linux OS. Then I moved this zip file to Windows and again copied it to another Linux server. This time I don't have the execute permission.
I know that we can directly copy the files and folders using scp command withing Linux but I have to let the user copy it from Windows to Linux also.
Please let me know how can I preserve the permissions while copying from Windows to Linux.
Thanks.
Since your executable file is inside a zip-archive it doesn't really matter what filesystem you're on or what operating system you're on. As long as the zip-archive is untouched.
However, as far as I know, zip-archives cannot keep track of file permissions. You can read more about it here:
Maintain file and folder permissions inside archives
It's up to whatever application is actually doing the copy.
But there are serious differences between the idea of file permissions on Linux/UNIX and Windows. UNIX file permissions have the idea of being "executable" which is not something that exists on Windows. Windows files are noted as runnable by their file extension not its permissions.
Furthermore, file permissions on UNIX have the concept of a group owner, and I don't think this exists on Windows so such a thing might not be possible in the strictest sense.
If you just want the writable/readable permissions as assigned to the owner to stick however, it will again depend on the application you are using to do the copy.
More recently, you can also use the Linux subsystem for Windows and zip the file using the linux shell command. I successfully did this recently when copying a executable for AWS from github to my Windows machine, and then up to Amazon.
Thanks for all your responses.
I found 2-solutions for my problem:
I am copying the complete zip file to the Linux server instead of copying a single file. This way it works fine.
Using cygwin helps me in copying the file onto a Linux server by preserving the execute permissions.

How to add remote includes to a synchronized eclipse project for correct indexing?

I have created a synchronized project in Eclipse so that I can develop on my Windows workstation without the overhead caused by running eclipse on our company's build server. However, the problem I'm having is that the indexer is using my Cygwin includes for things such as the stdlib which aren't the ones I wanted to include. Is there a way to include remote includes from the linux build server for things like the std lib? The only idea I have right now would be to create a mapped cifs mount to my windows machine that has access to the header files, however I don't know if that would work.
Look at "Remote Include Paths" (bottom of page). Let us know on the ptp-users mailing-list if it doesn't work.

Automated Context Switching Between Projects via SSH and Multiple Terminals

I'm looking for some guidance on an approach to automate the process of quickly switching between projects.
Putty Windows (2 of them):
Vim with project.session open (multiple tabs)
IPython open to the working directory of the project
What I want to automate in its respective windows:
Save all files, save session, close vim, change working directory of vim to next project, open related project session.
Close ipython (as I often restart it during development and want a fresh instance), change directory to next project'ss location, open a new ipython
A magic solution would be a single command that would change the state of both putty windows. However, since I have no idea how that would be done my current approach would be:
Attempt to figure out how to bind all that Vim stuff to a key press or a custom vim script that is used like: :SwitchProj "projectName"
Write a bash script or find a bash command that will allow me to type as little as possible to perform the directory switch and open new ipython interpreter.
As I have very little experience on Linux and SSH I would be interested to know how other's have solved this problem or would approach it!
I believe that the Linux screen command should satisfy you. Google gives you many tutorials, like this one.
I sadly confess that I am not very familiar with screen. Learning it is in my todo list
If you use the Gnu Emacs editor, you can also open many shell buffers inside (and other interactive buffers, like gdb sessions, compilations, grep search) and edit many files. I do that very often. You can use emacs thru a tty interface, such as provided by ssh.
You could also use ssh with e.g. -X to also redirect X11 windowing. For you, that means that you'll need to run an X11 server on your local Windows machine.

Resources