To backup files on a remote server with sudo priviledges (on the server) first add the following into the /etc/sudoers file:
Then backup the files from the local machine using:
rsync -atz -e "ssh" --rsync-path="sudo rsync" ./local_directory user@server:/path_to_backup
To create a movie file from a matlab animated figure do the following:
frames(1:nFrames) = struct('cdata', , 'colormap', );
% Do your plotting
To convert the movie file into a gif use:
convert -crop 0x0 -loop 0 my_movie.avi my_movie.gif
To remove default output of make command start each line of the Makefile that you wish to ‘silence’ with ‘@’:
@rm -f *.o
This can cause problems when the compiler generates an error. In that case you need to catch the error and terminate the make process. You should also generate a message saying which command caused the problem since this command won’t be printed on the screen (The error message will show up though). Use following code to do just that:
@echo "Compiling helloworld.cpp";
@gcc helloworld.cpp $(CFLAGS) -o helloworld \
|| (echo "Error in command: gcc helloworld.cpp $(CFLAGS) -o helloworld" && false)
To to give certain group read/write access to firewire devices create new udev “*.rule” file in /etc/udev/rules.d/10.my_ieee1394.rule with following content:
KERNEL=="raw1394", NAME="%k", GROUP="video", MODE="0664"
KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="video", MODE="0664"
KERNEL=="video1394*", NAME="video1394/%n", GROUP="video", MODE="0664"
One of possible causes of this error is incorrect linking order of libraries using gcc/g++.
Linking libraries before object files causes the error:
g++ -o $(LIBS) $(PROGRAM) $(OBJS)
Linking libraries after object files solves the problem:
g++ -o $(PROGRAM) $(OBJS) $(LIBS)
This is a solution for static library linking. Shared libraries should link both ways. Also order of respective libraries is important. If library A uses library B, library B has to linked first (-lB -lA).