jueves, 23 de octubre de 2014

Homemade "dropbox" for Ubunutu/Debian

In order to sync folders between several computers there is an app based on p2p called btsync.

Installation (This is required in all computers):

Step 1:

  -To install btsync is required to change source.list:


  sudo apt-get install python-software-properties
  sudo add-apt-repository ppa:tuxpoldo/btsync
  sudo apt-get update
  sudo apt-get install btsync

-There is installation manager in text mode, but you choose default option

Step 2:

   - To create a new folder in clients computers to share whose owner is btsync:

  sudo mkdir /Dir
  sudo chown btsync:btsync -R /Dir
  sudo chmod g+w -R /Dir
 
  -To add your user to btsync group and
 
  sudo usermod -G  btsync "user"
  
  Step 3:

  - Open this web site http:\\localhost:8888  in the original folders computer
        3.1 Create an admin user
        3.2 Choose the original folder to share
        3.3 Generate a key and copy

  - Open the same web site  http:\\localhost:8888  in the clients computers:
        3.4 Create an admin user
         3.5 Choose the folders to be sync
         3.6 Introduce the key

Remarks:
    - One computer has be left on
    - If any client is windows there is windows version available

lunes, 20 de enero de 2014

Easy Epsilon-constriant implementation (gams version)

Template in gams of epsilon-constraint method: 

Set
iteration number of iteration /001*010/
ob        objectives in your model /1*20/
ecit      number e-constraints intervals /1*3/;


Parameters
comb(ob)  current combination
cf        carry
indexObj  sum index;
;

*===============================================================================
*YOUR MODEL
*===============================================================================


FILE BIO / comb.xls /;
PUT BIO;
BIO.nd = 4;
BIO.nw = 0;
BIO.nr = 3;
BIO.pc = 6;

comb(ob)=1;

loop(iteration,

*===============================================================================
* Solve .....
*===============================================================================


  loop(ob,
    put sqrt(2);
  );
  put /;


  cf = 1;
  loop(ob$(cf eq 1),
    comb(ob)=comb(ob)+1;
    if(comb(ob)>card(ecit),
      comb(ob)=1;
    else
      cf=0;
    );
  );

);