Archive

Posts Tagged ‘sync’

Firefox: sync add-ons on your machines

October 13, 2016 Leave a comment

I knew that Firefox could do synchronization with multiple machines but I never tried it. It changed today. I got fed up with the manual sync so I looked after it and found this nice description of the process: https://support.mozilla.org/en-US/kb/sync-your-add-ons-another-copy-firefox . For this you need a free Firefox account.

Categories: firefox Tags: ,

using git like svn

March 15, 2016 Leave a comment

Problem
I have a Digital Ocean virtual private server (VPS) where I want to run a Python-Flask project of mine. The application works well on localhost, so it’s time to make it public.

However, it’s very likely that I will have to customize it a bit on the server, and thus I would like to get those changes on my localhost too. And vice versa, if I do some changes on localhost, I want to upload the new version to the server too. Copying everything via FTP for instance is out of the question. How to do it then?

Solution
Let’s use Git. Bitbucket offers free private repositories, so let’s profit of that :) I want to use that repo similarly to SVN: it’s the central repo, it must contain the latest version.

git_like_svn

Let “client A” be the VPS and “client B” my home machine (see the figure). When I modify something on localhost, upload the changes to the central repo, log in to the server and download the latest edition. If I modify something on the server, upload the changes to the central repo, and download them on my localhost. This way the two clients are nicely synchronized.

How to upload?
Upload your local changes to the central repo:

$ git status
$ git add -A .
$ git commit -m "your commit message"
$ git push
$ git status

How to download?
Download changes from the central repo (update your local copy):

#!/usr/bin/env bash

# git_down_from_central_repo.sh

git fetch
git pull
git status

But… it’s SVN like this!
Works for me :)

dropbox: command-line interface

September 12, 2015 Leave a comment

Problem
I wanted to test the status of my Dropbox client from the terminal. Actually, I wanted to write a script that executes an action when my Dropbox folder is fully synced. So I wanted to test the status if it’s “working” or “synced”.

Solution
I found the solution here. It turned out that Dropbox has an official command-line script that can do this and much more. First, get it:

wget -O ~/dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py
chmod u+x ~/dropbox.py
~/dropbox.py status

This is a Python script, written in Python 2, thus I modified the first line to be “#!/usr/bin/env python2“.

This script can do several things for you:

$ dropbox.py 
Dropbox command-line interface

commands:

Note: use dropbox help  to view usage for a specific command.

 status       get current status of the dropboxd
 help         provide help
 puburl       get public url of a file in your dropbox
 stop         stop dropboxd
 running      return whether dropbox is running
 start        start dropboxd
 filestatus   get current sync status of one or more files
 ls           list directory contents with current sync status
 autostart    automatically start dropbox at login
 exclude      ignores/excludes a directory from syncing
 lansync      enables or disables LAN sync

Some years ago I wrote a simple script to get the public URL of a file in my Dropbox folder. This script can do that too with the “puburl” command.

Categories: bash, python Tags: , ,

how to create a pull request on GitHub

June 20, 2014 Leave a comment

Explained step by step here: http://stackoverflow.com/questions/14680711/how-to-do-a-github-pull-request/14680805#14680805.

In short: fork the repo you want to contribute to; clone it to your local machine; do the changes, commit, then push it back to your repo. Then create the pull request on the web interface of github: visit your repo and click on the “pull request” button. Fill out the necessary information and create the pull request. The project’s owner will be notified about your contribution.

Once your PR is merged, you can sync your local fork to the upstream repository (howto).

Categories: Uncategorized Tags: , ,

Linux host, Windows guest, shared Dropbox folder

February 16, 2014 Leave a comment

Problem
My primary operating system is Linux but since I need to work with Powerpoint too, I installed Windows 7 in VirtualBox. Under Windows I prepare my presentations but I want them synchronized on all my machines. For the synchronization I was using Dropbox.

I had Dropbox on Linux (host machine) and on Windows (guest machine) too. When I edited a file under Windows, Dropbox synced it to the Linux host too (the Windows client uploads it to the cloud; the Linux client downloads it from the cloud). It worked fine, though it was not not optimal. If I didn’t use the Windows guest for a long time, then after a boot I had to wait some time till Dropbox synced everything and I could start working only after that.

However, something happened to the Windows Dropbox client recently. Maybe it’s a bug, I don’t know, but the Dropbox client in my Windows guest became terribly slow. It keeps syncing but it doesn’t upload the changes, or I need to wait an hour or so to upload a file 1 MB of size. This is ridiculous and unacceptable. Note that I dind’t experience similar issues with the Linux client.

How to have a synchronized folder between a Linux host and a Windows guest without a Dropbox client on the guest?

Solution
First I made sure that my Dropbox folders were synced between the host and the guest. After this I uninstalled Dropbox on Windows and removed the C:\Dropbox folder entirely. Since it was synced with the Linux host, I had an exact copy of the Dropbox folder on Linux. Then shut down the Windows guest.

Here (http://www.maketecheasier.com/share-files-in-virtualbox-between-vista-guest-ubuntu-host) you can find an excellent post on how to set up a shared folder between a Linux host and a Windows guest. On the Linux host I shared my Dropbox folder ($HOME/Dropbox) that appears now as a new drive in the Windows guest (G:\ in my case). Now, if I modify something under Windows, it will be visible immediately in the Linux file system that the Dropbox client on Linux will notice and sync.

With this I could solve two problems. First, when I boot up the Windows guest, I don’t need to wait for the Dropbox client to sync. Second, if I change something under Windows, it is still synced to the Dropbox cloud, though I have no Dropbox client on Windows anymore.

Siphon – Add-on Synchronizer for Firefox

Problem
You have Firefox on several machines and you want to have the same add-ons everywhere. Also, when you re-install a machine, you want to have back your favorite add-ons.

Solution
Siphon will manage and sync all your Firefox Add-ons with your different computers. It will also save your Add-on list if you ever need to reinstall Firefox.

Read about Siphon on Lifehacker.

Categories: firefox Tags: , ,