Thursday, 13 September 2012

rsync to readynas


export RSYNC_PASSWORD="password"
rsync -avzxr --progress localfiles rsync://username@192.168.1.1:/sharedFoldername/

mount using nfs:  (network file system, the linux standard)

sudo mount 192.168.1.1:/data /mnt/nas

This required,

sudo apt-get install nfs-common

on the machine attempting to connect to the nas.

Monday, 27 August 2012

recording video, realitime

ffmpeg -f alsa -ac 2 -i pulse -r 30 -f x11grab -s 1920x1200 -i :0.0 -vcodec libx264 gwMINE_footage_1.mkv

or now,

avconv \
-f x11grab -r 30 -s hd1080 -i :0.0 \
-f alsa -ac 2 -i pulse \
-vcodec libx264 -vf 'scale=-1:720' -pre:v lossless_ultrafast \
-acodec libmp3lame \
-y outfile.avi

Friday, 17 August 2012

rsync incremental backups

A directory holds incremental backups (I've mounted a remote directory locally to ease the command but ssh could also be used), in numerical order.  If the last backup number was 5, the next will be 6.  rsync is used to create the incremental backup:

$ crontab -e

Add this for nightly backup:


0 0 * * * i=`ls /mnt/Apollo/archive | tail -n 1`; i=${i%/}; j=$((i+1)); rsync -azm --delete --progress --include='*/' --include='*.tex *.dat *.DAT' --exclude='*' --link-dest=/mnt/Apollo/archive/$i/ /home/me/ /mnt/Apollo/archive/$j

which breaks down as,

0 0 * * *
  : at 0 minutes, 0 hours every day every month every year execute:

i=`ls /mnt/Apollo/archive | tail -n 1`
  : get listing of archive directory in increasing number order (I hope!)

 i=${i%/}
  : Remove the trailing slash from the directory name

j=$((i+1)) 
 : Add one to it and assign to j.

rsync:

-a
(rchive) : preserve file parameters (owner, read/write/execute etc)
-z
(ip) : compress during transmit.
-m
 : do not create empty directories on the backup.
--delete
  : if a file is deleted on the source, remove it on the backup (I hope from the incremental!)

--include='*/' 
 : required to get this to work!
--include='*.tex *.dat *.DAT'
   : files to archive.
--exclude='*' 
  : don't archive anything else.
--link-dest=/mnt/Apollo/archive/$i
    : the reference archive directory used to generate deltas from.
/home/me/
   : start point for information to be backed up.
/mnt/Apollo/archive/$j 
  :  target for incremental data.



Friday, 27 July 2012

home reading

http://27bslash6.com/monkey.html
http://www.amazon.com/gp/product/B001SRFW3Y?ie=UTF8&tag=ubersite&linkCode=as2&camp=1789&creative=9325&creativeASIN=B001SRFW3Y

Sunday, 1 July 2012

0/files

From http://www.cfd-online.com/Forums/openfoam/90301-interfoam-simulation-blowing-up-2.html

0/epsilon:


boundaryField {
    inlet   {  type  fixedValue;  value           uniform 0.0000824; }
    outlet  type  inletOutlet;   inletValue      uniform 0.0000824; value uniform 0.0000824; }
    upperwall  { type inletOutlet; inletValue  uniform 0.0000824;  value  uniform 0.0000824; }
    walls type epsilonWallFunction; value  uniform 0.0000824; }
    frontAndBackPlanes type            empty; }
    }

0/k:

boundaryField {
    inlet  { type            fixedValue;  value           uniform 0.000384; }
    outlet {  type            inletOutlet;   inletValue      uniform 0.000384;  value           uniform 0.000384; }
    upperwall {  type  inletOutlet; inletValue      uniform 0.000384; value           uniform 0.000384; }
    walls type kqRWallFunction; value  uniform 0.000384; }
    frontAndBackPlanes  type empty; }
    }

0/nut:

boundaryField {
    inlet { type            calculated;  value           uniform 0; }
    outlet  { type            inletOutlet; inletValue      uniform 0; value           uniform 0; }
    upperwall { type            inletOutlet; inletValue      uniform 0; value           uniform 0; }
    walls { type  nutUWallFunction; value           uniform 0;}
    frontAndBackPlanes { type            empty; }
    }

0/nuTilda:

boundaryField {
    inlet  {  type    fixedValue; value           uniform 0;}
    outlet   type   inletOutlet;  inletValue      uniform 0; value           uniform 0;  }
    upperwall  {  type            inletOutlet; inletValue      uniform 0; value           uniform 0; }
    walls { type            zeroGradient; }   
    frontAndBackPlanes   type   empty; }
    }

0/U:

boundaryField {
    walls  { type            fixedValue;  value           uniform (0 0 0); }
    baffle  { type            fixedValue;  value           uniform (0 0 0);    }
    inlet   {  type            fixedValue;  value           uniform (0.16 0 0);  }
    outlet  {  type            inletOutlet;  inletValue      uniform (0 0 0);  value           uniform (0 0 0); }
    upperwall {  type            pressureInletOutletVelocity;  value           uniform (0 0 0);
    // type  zeroGradient;
    }
    defaultFaces { type            empty; }
    }


0/p_rgh:

boundaryField {
    walls { type            zeroGradient; //buoyantPressure;
        //value           uniform 0;
      }
    baffle  { type            zeroGradient;  //value           uniform 0;
    }
    inlet  { type            zeroGradient;  }
   outlet  {
        type            totalPressure;//zeroGradient;
        p0              uniform 0;
        U               U;
        phi             phi;
        rho             rho;
        psi             none;
        gamma           1;
        value           uniform 0; }
    upperwall {
        type            totalPressure;//zeroGradient;
        p0              uniform 0;
        U               U;
        phi             phi;
        rho             rho;
        psi             none;
        gamma           1;
        value           uniform 0; }
    defaultFaces { type            empty;}
    }


p_rgh: all wall and inlet should be " buoyantPressure", not zeroGradient.


outlet should not be a totalPressure like your upperwall (not consistent), but try zeroGradient here. But if your upperwall is a wall, then -> buoyantPressure, and outlet: totalPressure.

k,epsilon: try zeroGradient for the upperwall (if this is a free atmosphere. In case this is a wall, then ok)

nut: wall = nut wall function ok, all other (inlet/outlet/top: calculated).