Skip to content

Instantly share code, notes, and snippets.

@ezmac
Last active October 26, 2021 00:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezmac/ad7df414ec357c7513e7 to your computer and use it in GitHub Desktop.
Save ezmac/ad7df414ec357c7513e7 to your computer and use it in GitHub Desktop.
Developing asp classic apps in linux/vim (using a mounted IIS folder)

This is dumb, but I run linux and have to debug asp classic apps on occasion. The obvious way would be to work in windows with vim for windows, but my shortcuts don't work there and the flow is off. Rather, I use a particular setup to allow me to work seamlessly in linux using a low power windows 8 laptop physically beside my linux machine. With this setup, I don't have to leave linux often, but I have a synergy connection between the two machines, so they share a mouse.

The windows machine has one display, cygwin, and Watch 4 Folder (a free/shareware windows program similar to incrontab). Watch 4 Folder watches the inetpub/logs/FailedReqLogFiles/ folder and subfolders for file create. This happens for FREB (Failed request event buffering). When it happens, it opens the log in IE (because no other browser has the xlst to render it correctly). Additionally, if I have a file that receives debugging statements, I'll keep cygwin at 50% transparent, full screen, and 'tail -f' on the file. A folder for the project should be created in inetpub/wwwroot and network shared by name for a specific user. These are used in the mount script. Unfortunately, freb is the best way I've found to debug asp classic. Note: if you set up an asp classic app in IIS, IIS 7+ does not come with classic asp. After installing asp classic, parent paths are disabled and the default document does not include index.asp.

On the linux machine, incrontab is needed. Two folders are needed, one for a local copy and one to mount the remote file system. These are "project" and "project-remote". You could directly edit the mounted windows file system, but the writing thread will block until the write is completed, meaning no more editing until the file has saved. Having a local copy on disk prevents this. To avoid remembering to sync the two, incrontab is used. A line like /path/to/project/ IN_MODIFY cp $@/$# /path/to/project-remote/ will copy files to the windows server when they're written to the local directory. Use incrontab -e to add the line. The rest is a simple mount script to simplify things.

echo "Mounting remote project to ./project-remote"

mount -t cifs -o rw,auto,user,file_mode=0755,uid=linux_user,gid=users,dir_mode=0755,user="windows-computer-name\\username",password=windows_password //ip_address/sharename/ ./project-remote

Finally, I would like to say that I in no way endorse or even like ASP Classic. This obviously is a bad idea to do on a production system, but for development, it's fairly stable. It works better for me because it would take much more time to make my windows system usable than it took to figure this out and set it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment