Return to site

Fsmonitor 1 123

broken image


Lately, I've been working on a code-base situated remotely on a server accessible over ssh.The network latency and size of the code repository prompted me to reconsider the methodto edit such files. I discovered a few options I could use and finally settled with one of them.

Option I : Running Emacs remotely.

This was the option I initially started with. Since most of the people who worked around meused vim, remotely, this option came naturally to me.Since, the remote machine was a Linux system, I built Emacson the server and started using it.

Since most of my keyboard shortcuts, in Emacs, are some fancy combinations of Ctrl, Meta and character keys,the terminal software I used, ate most of such shortcuts.I tried resetting the terminal keybindings and changed some complex keybindings but in the end, I had to give up on that.

Revision 471 - (show annotations) Wed Oct 27 18: UTC (8 years, 10 months ago) by bcpierce File MIME type: text/x-python File size: 23885 byte(s). Incorporated new version of fsmonitor.py from Christophe Gohle. Comment 1 Jim 2018-11-10 13:15:36 UTC Somewhat related, the 2.48.4 stable release of Unison was released in 2016. IMHO a 2.48.4 package that includes fsmonitor would be even better. FSMonitor 1.0.5 MAC OS X Monitor changes to the file system. Size: 10.12 MB FSMonitor monitors all changes in the file system. Track all changes to the file system, including file creation, deletion, change of content, renames, and change-of-attributes. Examine the changed files with any of the four provided display modes. 1.1 Copy the files from the archive (from upload folder) to the root directory of the site (to be copied without changing the file) Step 1 of 2. Copy the files (via Extension installer og OpenCart) 1.1 Go to the extension installer, and select archive file to install the module 1.2 Install it. For 1.5.x and 2.x.

Changing my keybindings to make them a little saner for my terminal emulator, did not seem like an option.Since, rewiring my brain to create new muscle memory built over 2 years was my last option.

Option II: Using Tramp

Emacs has an inbuilt option to connect to remote hosts (via several protocols) called Tramp.Initially it felt (a lot) easier than the ‘running emacs remotely' option, but slowlythe problems with tramp started to appear.

Tramp was a bit sluggish when opening and saving files. There were some optimizations that could be donewith tramp settings

and some ssh settings.

Fsmonitor 1 123movies

Piclight 1 0 2 – photo enhancement for artistic effects. Even though, these did improve the performance by a large factor, it's performance on large files and slow networkconnections, was still a little below usable.

Apart from this, I had problems running a few Emacs packages such as flycheck.

Option III: Mounting Remote file system locally

One of the options I found was mounting a remote file system locally via sshfs.It did have a few problems with connection stability, but it worked fine overall.

I solved a few problems with some optimizations via command-line parameters. The final command looked somewhat like this.

This increased the overall speed and removed sluggishness while editing.

The problem with sshfs is it's speed. Any operation requiring a disk scan was unbearably slow.So I couldn't run commands like locate, grep, and magit via Emacs.

Projectile was usable after (setq projectile-enable-caching t) though.

I found a small utility which addressed this problem.It works by executing all commands which ran inside a directory mounted on sshfs on the remote host directly.So, heavy disk operations become very fast as the remote server is doing all the heavy lifting.

To run any command such as git directly on remote all I had to do was

You can check this by running git --version from inside and outside the sshfs mount.

The combination of sshfs and sshfsexec solved almost all the problems I faced with earlier setups.It was almost always faster than tramp when opening and saving of files, and almost as fast as tramp when doingdisk operations such as opening Magit.

The only problem here was the availability of code when offline. And even though this method was fast, it wasnot as fast as a project opened locally. These problems bring us to the fourth option.

Option IV: Keeping local copy in sync

This is the approach that some of the IDE's take. The code is mirrored locally and the remote code is kept in syncwith the local copy.

There are two parts to this. Firstly, there should be a syncing utility which does the job of transferring thechanges of the file to the remote copy. The second part of it is the file change notifier which will alert the syncingutility to start syncing.

Fsmonitor 1 123

Initially, I started with running rsync in the after-save-hook hook of emacs. It worked kind of fine, but the problem waswith the changes made outside the scope of Emacs, such as changing of a git branch. It also restricted me from makingany changes on the remote code directly since there was no mechanism to automatically download the remote copy changesto the local copy.

On looking a bit further, I came across Unison. It supported two way syncing alongwith file watch facility. It is required that same version Unison is installed on both local and remote machines.Following are the steps that will setup Unison.

Repeat these same steps on the server.It is preferable to remove .git folder from syncing. This can be done by creating/editing a ~/.unison/default.prfand adding

You should also remove other build/libraries directories that you won't be editing. This will decreasethe amount of files it has (and memory it takes in the process) to look for changes.

You can now start the sync by

This will keep on looking for changes in the local copy and sync the remote every time there's one.

In the case when a sync is required from the remote to local

can be used.

In case of errors such as Errno=No space left on device (ENOSPC), the inotify memory can be increasedby setting sudo sysctl fs.inotify.max_user_watches=20480. This memory useskernel memory spaceand is not swappable. Therefore, this shouldn't be increased too much if you don't have sufficient RAM.

I initially used sshfs method for a long time along with tramp for most of my work,but recently have switched to maintaining a local copy of the codebase.

Concluding

The choice of the method completely depends on what the purpose of editing is.

For a quick change in a server I always prefer tramp. In the case when I'm doing some sysadmin work,I prefer installing Emacs on the server and using emacsclient to open and edit files quickly.When working on code, unless it's not fairly large repository, I prefer sshfs.Since the current scenario requires me to work on a large codebase where sshfs (kind of) breaksI keep everything copied locally and in sync with the server.

  • Champaign, IL
View GitHub Profile View diff.patch
- if (istate->fsmonitor_dirty->bit_size > istate->cache_nr)
- BUG('fsmonitor_dirty has more entries than the index (%'PRIuMAX' > %u)',
- (uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
+ if (!istate->split_index && istate->fsmonitor_dirty->bit_size > istate->cache_nr)
+ BUG('fsmonitor_dirty has more entries than the index (%'PRIuMAX' > %'PRIuMAX')',
+ (uintmax_t)istate->fsmonitor_dirty->bit_size, (uintmax_t)istate->cache_nr);
View gist:c280c2108b62fa4b3928
/**
* @license AngularJS v1.5.0-local+sha.25e8c59
* (c) 2010-2015 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
View Corrected Korat output
1,Total explored:1,New found:1
2,Total explored:5,New found:2
3,Total explored:57,New found:6
4,Total explored:1205,New found:63
5,Total explored:58785,New found:3462

Fsmonitor 1 123 Movies

Fsmonitor 1 123 drive

Initially, I started with running rsync in the after-save-hook hook of emacs. It worked kind of fine, but the problem waswith the changes made outside the scope of Emacs, such as changing of a git branch. It also restricted me from makingany changes on the remote code directly since there was no mechanism to automatically download the remote copy changesto the local copy.

On looking a bit further, I came across Unison. It supported two way syncing alongwith file watch facility. It is required that same version Unison is installed on both local and remote machines.Following are the steps that will setup Unison.

Repeat these same steps on the server.It is preferable to remove .git folder from syncing. This can be done by creating/editing a ~/.unison/default.prfand adding

You should also remove other build/libraries directories that you won't be editing. This will decreasethe amount of files it has (and memory it takes in the process) to look for changes.

You can now start the sync by

This will keep on looking for changes in the local copy and sync the remote every time there's one.

In the case when a sync is required from the remote to local

can be used.

In case of errors such as Errno=No space left on device (ENOSPC), the inotify memory can be increasedby setting sudo sysctl fs.inotify.max_user_watches=20480. This memory useskernel memory spaceand is not swappable. Therefore, this shouldn't be increased too much if you don't have sufficient RAM.

I initially used sshfs method for a long time along with tramp for most of my work,but recently have switched to maintaining a local copy of the codebase.

Concluding

The choice of the method completely depends on what the purpose of editing is.

For a quick change in a server I always prefer tramp. In the case when I'm doing some sysadmin work,I prefer installing Emacs on the server and using emacsclient to open and edit files quickly.When working on code, unless it's not fairly large repository, I prefer sshfs.Since the current scenario requires me to work on a large codebase where sshfs (kind of) breaksI keep everything copied locally and in sync with the server.

  • Champaign, IL
View GitHub Profile View diff.patch
- if (istate->fsmonitor_dirty->bit_size > istate->cache_nr)
- BUG('fsmonitor_dirty has more entries than the index (%'PRIuMAX' > %u)',
- (uintmax_t)istate->fsmonitor_dirty->bit_size, istate->cache_nr);
+ if (!istate->split_index && istate->fsmonitor_dirty->bit_size > istate->cache_nr)
+ BUG('fsmonitor_dirty has more entries than the index (%'PRIuMAX' > %'PRIuMAX')',
+ (uintmax_t)istate->fsmonitor_dirty->bit_size, (uintmax_t)istate->cache_nr);
View gist:c280c2108b62fa4b3928
/**
* @license AngularJS v1.5.0-local+sha.25e8c59
* (c) 2010-2015 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, document, undefined) {'use strict';
/**
* @description
*
View Corrected Korat output
1,Total explored:1,New found:1
2,Total explored:5,New found:2
3,Total explored:57,New found:6
4,Total explored:1205,New found:63
5,Total explored:58785,New found:3462

Fsmonitor 1 123 Movies

View Graph.java
packagekorat.examples.graph;
importkorat.finitization.IArraySet;
importkorat.finitization.IFinitization;
importkorat.finitization.IIntSet;
importkorat.finitization.IObjSet;
importkorat.finitization.impl.FinitizationFactory;
importjava.util.HashSet;
importjava.util.LinkedList;
View How to run the korat example.
seq 1 6 | tee /tmp/range.txt | awk '{ system('java -classpath $KORAT_CP korat.Korat --class korat.examples.graph.Graph --args ' $1) }' | egrep 'Total|New' | paste -d, - - | paste -d, /tmp/range.txt -
View output
1,Total explored:2,New found:1
2,Total explored:10,New found:2
3,Total explored:53,New found:4
4,Total explored:270,New found:9
5,Total explored:1300,New found:23
6,Total explored:5996,New found:65




broken image