EzDevInfo.com

Unison

Unifying named breakpoints across CSS, JS, and HTML Unison.js

unison "-repeat watch" not working

I recently installed unison on my home machine (OSX 10.9) and on my remote server (Ubuntu 12.04 64-bit).

I have version 2.40.102 installed in both place. I used 'brew install unison' on my Mac, and I compiled from source on the server.

The issue is that I can't get "-repeat watch" to work. It connects, but then does nothing.

Contacting server...
Connected [//... -> //...]

And that's it. If I pass anything, like, '1' to the -repeat flag it works just fine.

Is there something else that I need to do in order to get it to watch for changes and sync when something changes?


Source: (StackOverflow)

Using MySQL and Mongodb together

I have worked with MySQL more than MongoDB, but from what I've learned from MongoDB it's just what I needed, but it also has it's limitations that MySQL can do (for instance auto increment)

Would it be smart to use MongoDB for everything, and use MySQL for only certain things?

For instance use MongoDB to store users and everything else, but use MySQL to make for example a ticket system.


Source: (StackOverflow)

Advertisements

How to stop two datagridview from using Unison Scrolling to independently using toggle button

I have two datagridviews which have unison scrolling. now i want to use the button which will control unison scrolling and independently scrolling. My question is, how can i use toggle button to control unison and independently(which means it will be on and off).

I have created a button and named it Lock. let me put in a good scenario.

1.You will select one row from grid1 and perform unison scrolling.(Unison part is working) 2.And click Lock button which will allow unison scrolling. 3.Toggle the button off and it scrolls independently.

How can i do that ?

I have created this and it seems not working at all

Constructor of the form:

public frmMain_Page()
{
   Grid1.Scroll += new System.Windows.Forms.ScrollEventHandler(Grid1_Scroll);
}

Button for unison:

     private void Gridview_Input_Scroll(object sender, ScrollEventArgs e)
    {
      Gridview_Output.FirstDisplayedScrollingRowIndex = Gridview_Input.FirstDisplayedScrollingRowIndex;          
    }

Look button :

  private bool toggle = true;
  private void btnLock_Click(object sender, EventArgs args)
    {
        try
        {
            if (toggle == true)
            {
                toggle = false;
     Grid2.FirstDisplayedScrollingRowIndex =    Grid1.FirstDisplayedScrollingRowIndex;
            }
            else
            {
                toggle = true;
    Grid1.Scroll += new System.Windows.Forms.ScrollEventHandler(Grid1_Scroll);
            }
        }
        catch( Exception ex)
        {

        }

    }

Source: (StackOverflow)

What is the best practices of using Docker for front end development on OS X and passthrough ENV from host to container

I am looking for best practices about front-end developing on OSX with docker and I have found number of projects on github. Here they are:

  • docker-osx-dev
  • boot2docker-xhyve
  • coreos-xhyve
  • docker-unison
  • hodor

The fact is I need two-way syncing files from host system to virtual container and vice versa via mounted (synced) folder and IO performance should be like native one. Therefore I don't consider shared folders FS like vboxsf and vmhgfs. Also it's needed to have some build tools (gulp etc) with working wathcer within shared folder. What do you think about xhyve (with NFS) instead of VirtualBox? Who tried the unison, what the performance docker provides with it?

At last I have a special task I want to run app.js via nodejs through host to container ENV if it is possible. In other words I have to add ENV variable for PATH to nodejs (within virtual container) to my ~/.bash_profile. Is there any chance to do passthrough NODE_PATH from host to container at all? Thanks.


Source: (StackOverflow)

Unison doesn't copy SYSTEM perm (cygwin/windows)

After using crashplan for a while, I noticed that several files aren't being backed up. The files are synced via unison (through cygwin) with another PC and while the *nix permissions are copied correctly, the mirrored file does not have SYSTEM as a user (in windows). Therefore, crashplan can't back it up. Both client and server are running cygwin.

What's the best solution? Can I copy this permission as well with unison? Can I do it with a script (in cygwin or cmd)?

Thanks Sander

EDIT: To fix it short term I ran an icacls command, but I'm still looking for a way to copy the ACLs via unison whilst syncing.


Source: (StackOverflow)

Incron not working with unison in ubuntu

I want to execute incron with unison, but incron is not working:

  1. Incron script:

    /var/www/html/img/thumb IN_CREATE,IN_DELETE,IN_CLOSE_WRITE /var/www/inc/unison.sh

  2. unison.sh script:

    #!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/root /usr/bin/unison -batch /var/www/html/img/thumb ssh://xxx@xxx.xx:xxxx//var/www/html/img/thumb

How can I do this? My OS is ubuntu 14.04. Any help would be appreciated.


Source: (StackOverflow)

Problems scripting Unison with Python

I am trying to make a simple script to automate and log synchronization via Unison. I am also using subprocess.Popen rather than the usual os.system call as it's deprecated. I've spent the past 2 days looking at docs and such trying to figure out what I'm doing wrong, but for some reason if I call unison from a terminal it works no problem, yet when I make the same call from Python it tries to do user interaction and in addition I'm not capturing but about half of the output, the other is still printing to the terminal.

Here is my code I am trying to use:

sync = Popen(["unison", "sync"], shell = True, stdout = PIPE)

for line in sync.stdout
    logFile.write(line)

sync.wait()

if sync.returncode == 0 or sync.returncode == None:
    logFile.write("Sync Completed Successfully\n")
else
    logFile.write("!! Sync Failed with a returncode of: " + str(sync.returncode) + "\n")

Here is my Unison config file:

root = /home/zephyrxero/temp/
root = /home/zephyrxero/test/

auto = true
batch = true
prefer = newer
times = true
owner = true
group = true
retry = 2

What am I doing wrong? Why isn't all output from Unison getting saved to my logfile, and why is it asking me for confirmation when the script runs, but not when I run it plainly from a terminal?

UPDATE: Ok, thanks to Emil I'm now capturing all the output, but I still can't figure out why typing "unison sync" into a terminal is getting different results than when calling it from my script.


Source: (StackOverflow)

exec error code 2

I'm using Unison to sync files between two servers. I'm trying to get PHP to call it after a file is uploaded.

I'm using exec, but it's returning an error code of 2.

exec("/usr/bin/unison /var/www/html/files ssh://a2//var/www/html/files -batch -prefer newer -times -path uploads", $out, $r);

$out is a blank array, and $r is 2. What does an error code of 2 mean?

P.S. I ran php -a on the command line, and copied and pasted that line, and it worked. Also, exec('whoami') works (and is the same user I was logged in as on the command line).


Source: (StackOverflow)

Unison source compile errors in OCAML

I am trying to compile the unison source using OCAML compiler(ver 4.01.0) and GNU make 4.0. The source code is taken from the link (http://www.seas.upenn.edu/~bcpierce/unison//download/releases/unison-2.27.57/)

I extracted the tar.gz and then wrote the command "make NATIVE=false" as mentioned in the user manual (http://www.seas.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html) see section building unison from scratch windows.

Code starts compiling for few seconds but stops and following errors appear:

----------

File "/cygdrive/c/unison_build/unison-2.27.57/update.ml", line 1:
Error: The implementation /cygdrive/c/unison_build/unison-2.27.57/update.ml
does not match the interface update.cmi:
...
In module NameMap:
The field `split' is required but not provided
In module NameMap:
The field `choose' is required but not provided
In module NameMap:
The field `max_binding' is required but not provided
In module NameMap:
The field `min_binding' is required but not provided
In module NameMap:
The field `bindings' is required but not provided
In module NameMap:
The field `cardinal' is required but not provided
In module NameMap:
The field `partition' is required but not provided
In module NameMap:
The field `filter' is required but not provided
In module NameMap:
The field `exists' is required but not provided
In module NameMap:
The field `for_all' is required but not provided
In module NameMap:
The field `merge' is required but not provided
In module NameMap:
The field `singleton' is required but not provided
Makefile.OCaml:339: recipe for target 'update.cmo' failed
make: *** [update.cmo] Error 2


Source: (StackOverflow)

How to sync when you can't connect directly to the remote computer

I have my home computer A and a work computer C that I want to synchronise using unison. In the middle is a work computer B. A can communicate with B and B can communicate with C directly but A and C can't directly connect to each other. In fact the communication diagram looks like A->B<->C. That is A can connect to B but B can't connect to A.

To give an example how I use this setup, I currently do the following if I want to ssh from A to C

ssh -t -X -C me_B@B ssh -X me_C@C

How can I run unison from A and sync with C, maybe using ssh port forwarding?

To make it a little clearer, C has unfiltered outgoing connectivity to the Internet. B has unfiltered in and outgoing connectivity to both C and the Internet. A is my home computer.


Update

The following command line works for me to at least copy files from A to C

scp -oProxyCommand="ssh me_B@B nc -v %h %p" foo/* me_C@C:foo

Is there some way to use this idea to get unison to work?


Source: (StackOverflow)

Bash: echo a variable containing program output, to a file

When I execute unison tours 2> /dev/null | grep -A 2 '<-?->' on a bash prompt, I get the exact output i'm looking for:

*changed  <-?-> changed    Future Tours/File Clash Test.docx  
local        : changed file       modified on 2013-06-05 at 16:24:40  size 10221     rw-rw----  
bj-server... : changed file       modified on 2013-06-05 at 16:23:53  size 10232     rw-rw----*

When I put this into a shell script:

#!/bin/bash
tmp=$(unison tours 2> /dev/null | grep -A 2 '<-?->')
echo "$tmp" > /home/users/itsystem/test.log

... it comes out strange. Running more test.log , I get the following:

- Systems Sheets/Feedback She
                                                                oup).xls
| Past Tours/2012/CE0
                        12 Cherry (N...our Menus/Lijiang Tour  Menus.xls

- Past Tours/2012/UC041112 St
- Past Tours/2012/UC081112 Lopata (N... Menus - UC081012 Lo
                2/VC110912 Levin (VI... Menus - VC110912 Levin (VI).xlsx
                                                                    xlsx
| Future Tours/2013 Futur
/ Inquiries/Outstanding/Terence Park... Itinerary (Trev
changed   changed    Future Tours/File Clash Test.docx
local        : changed file       modified on 2013-06-05 at 16:24:40  size 10221     rw-rw----
bj-server... : changed file       modified on 2013-06-05 at 16:23:53  size 10232     rw-rw----

Where is the other crap coming from?

If you simply run unison then you do get an animated one line of output that is constantly refreshed with a rotating -\|/ showing the working folder, but which eventually disappears.

If my grep works on the bash prompt, why not from the shell script?


Source: (StackOverflow)

Gaining better performance with inotify-tools and unison.

I use inotify-tools and unison to synchronize folders between machines. Because I have a large folder to synchronize, I just simply write an inotifywait script to do the job automatically. Is it sensible to let inotifywait to monitor the subdirectories of the large folder to gain a better performance?


Source: (StackOverflow)

How to kill port forwarding once you have have finished using it

In order to sync my home and work file systems I need to go via an intermediary computer and use port forwarding. Let us call the home computer A, the intermediate one B and the work computer C. From the command line I do this

ssh -N -f -L 2025:C:22 me_B@B && unison foo ssh://me_C@localhost:2025/foo
  • I would like to put this one-liner into a bash script. How can I make it quit gracefully at the end and not leave any port forwarding still set up?

Source: (StackOverflow)

run unison in bash script

Hi when I run a command on terminal like that

unison dir1 dir2 -ignore 'Regex dir3' -batch -force dir1 -confirmbigdel=false

it runs normally. But when I try to run it in a bash script it like that

a="-ignore 'Regex dir3'"
unison dir1 dir2 "$a" -batch -force dir1 -confirmbigdel=false

it says that

unison: unknown option `-ignore 'Regex c''

How can I solve that problem? Thank you... .


Source: (StackOverflow)

Sync two computers and also use git

Here is my situation:

I have two machines- A desktop and a laptop the home folders of which I keep in sync using unison. This setup works fine as I can carry my work around and have everything readily aviable. Now I want to throw git into this mix.

I have a remote repo set up in bitbucket.org. What I want to be able to do is periodically commit code from any of the machines ( as both are in sync ). However I am wondering if I set up the same git in both the machines will that create a conflict. Also the files are synced using unison...how will this affect git is another thing that worries me.

Any pointers as to how I might achieve this will be most helpful.

Thank you all and regards,

Sameer


Source: (StackOverflow)