Handling file watchers in Vagrant shared folder - vagrant

I'm using Vagrant shared folder to develop a project using babel as a file watcher.
However, most likely, because of time difference between host and guest machine whenever I change a file the watcher doesn't see the changes and doesn't recompile modified assets, making the whole development environment useless.
I've tried changing the sync strategy to RSync but it only works when the file A is changed to A' but when I change B to B' it works as well, but reverts file A' back to A.
Is there any workflow that'd allow me to develop files in shared folder, still firing up file watcher hooks inside the guest machine?

Unfortunately you can't watch for file notifications on a shared folder. You have to use something like rsync auto or a third party file watcher like https://github.com/AgentCosmic/xnotify

Related

Is there any way to inspect the contents of the RocksDB instance used by NEAR Protocol?

Disclosure: I work with NEAR and am currently on-boarding.
When I start up a local node on a clean machine I see that a .near folder is created in my home directory with a few configuration files (exact files seem to depend on which start_ script I run). Another folder appears inside of the .near folder called data.
Running strings ~/.near/data/*.sst in the folder spits out a few lines starting with the string "rocksdb" which led me to this reference to RocksDB
Is there any way to inspect the contents of a node's RocksDB instance?
I found Keylord but it crashes when I try to configure a new connection to the database (by pointing the connection to ~/.near/data). I didn't pursue that thread.
PSA1: sometimes it's useful to backup the ~/.near folder between node restarts if you want to reset the environment or avoid reusing old data while troubleshooting
mv ~/.near ~/.near_`date +%Y-%m-%d.%s`
PSA2: on MacOS you can watch what happens to the contents of the ~/.near folder while the node boots up and runs. (brew install watch).
watch -d -c -n 0.5 find ~/.near
The content of RocksDB is serialized using our own binary serialization format (http://borsh.io/), so you won't be able to examine the content with general-purpose third-party tools

set execution permission to files deployed from windows to lambda using serverless

I'm using serveless to deploy lambda function, I need to add an executable bin file but when it is uploaded I don't have executable permissions, also I can't change permissions after deployed, the only thing I can do is to move the file to /tmp and there change the permissions, it works ok but adds a lot of overhead because I have to move the files on every Invoke becasue /tmp is ephemeral.
I know there is a known issue that windows&linux files permission are different, so if you zip a file on windows and unzip it on a linux machines you will have problem with permission, especialy with execution, and that happens when serverless deploys the files.
¿Anyone have a better workaround for this? (rather than "deploy from a windows machine")

Unable to get Unison to sync current folder onto remote folder

I am trying to automate backup of my project folders through a script. I found Unison, which seemed to match my needs, and have writtenm a script that can reliably mount and unmount a samba folder (Mac backing up to a Windows box). The only problem I am having is getting my unison command to reliably backup my (currently test) directory. It says:
Looking for changes
Reconciling changes
Nothing to do: replicas have not changed since last sync.
Which doesn't make sense to me.
Here is my command:
unison ~/Documents/test ~/hm_mnt/test/ -fat -auto -force ~/Documents/test -noupdate ~/Documents/test -nodeletion ~/Documents/test
I want to simply maintain a copy of the current state of my test folder in this case. this worked once and has not duplicated since.
My initial run (with slightly different command run fine) and I have been refining it to the above state since trying to get manual updates to a test file to move over. These have not propagated, and even when I cleaned out the remote folder to make sure there was no differences detected.
Thanks

How to prevent Dart from using my home directory?

I'd like to use Dart on a Windows machine where my home directory is configured to be on a network share. I have no control over this configuration.
Initially, I couldn't get the Dart Editor to run at all as the default location for its configuration folder is defined in DartEditor.ini as #user.home/DartEditor. This prevented me from creating new projects at all. I have edited this file so that my Dart Editor configuration folder is now located at c:\DartEditor which seems to solve that problem.
However, when creating a new project, Pub tries to install libraries to my home directory and Dartium tries to save its configuration there as well. This causes Pub to just fail (so I can't build any projects) and Dartium to warn me that storing it's configuration on a network share will cause it to slow down.
How can I prevent Dart Editor (and any associated tools like Pub and Dartium) from using my home directory and instead use a directory on my local drive?
What about to download Dart and unzip it to:
C:\DartHome
I also recommend to change the DartEditor.ini file on the second line to:
C:\DartHome\DartEditor

Does vagrant create a temp directory and files when packaging boxes

My vagrant box fail to finish being packaged due to not having enough space on disk, I'm wondering if there is any way to make sure that there are no temporary files left behind during the packaging process due to it being not finished.
I think all of the temp files are in ~/.vagrant.d/tmp. Each time I have interrupted packaging, Vagrant has cleaned up automatically.
In windows it's stored under C:/Users/user.name/AppData/Local/Temp/ in folder named following this scheme vagrant-YYYYMMDD-TSTAMP-id/.
In other linux-like OSes it would be in ~/.vagrant.d/tmp.

Resources