This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Initalize git repository | |
| git init | |
| git add . | |
| git commit -m "first commit" | |
| # Initialize git repository on Dropbox folder as remote branch | |
| cd ~/Dropbox/git | |
| git init --bare project.git | |
| # Add remote to local git repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %% checking minimum arguments requried | |
| minargs = 3; | |
| maxargs = inf; | |
| n_exargs = length(varargin); | |
| try | |
| narginchk(minargs, maxargs); | |
| catch err | |
| if strcmp(err.identifier,'MATLAB:narginchk:notEnoughInputs') | |
| error('batchconvert:notEnoughInputs',... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [] = batchProcess(funhandle, indir, varargin) | |
| %BATCHPROCESS Process multiple files with given processing function | |
| % BATCHPROCESS(FUNC, INDIR) processes every file or directory in | |
| % INDIR using processing funtion FUNC. | |
| % | |
| % FUNC is a function handle that takes source filename and target | |
| % directory as input variables. For example, if FUNC = @foo, then | |
| % BATCHPROCESS calls foo(infile) to every infile in INDIR. | |
| % | |
| % BATCHPROCESS(..., 'para1', value1, 'para2', value2, ...) takes extra |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copy public-key to remote-machine for public-key authentication | |
| ssh-copy-id someuser@remote-machine | |
| # To specify port number | |
| ssh-copy-id "someuser@remote-machine -p port_number" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cut -d ':' -f 1,3 /etc/passwd | sort -t ':' -k2n - | tr ':' '\t' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [] = batchConvert(funhandle, indir, outdir, varargin) | |
| %BATCHCONVERT Convert multiple files with given conversion function | |
| % BATCHCONVERT(FUNC, INDIR, OUTDIR) converts every file or directory in | |
| % INDIR using conversion funtion FUNC and save the converted files to | |
| % OUTDIR with the same names as in INDIR. | |
| % | |
| % FUNC is a function handle that takes source filename and target | |
| % directory as input variables. For example, if FUNC = @foo, then | |
| % BATCHCONVERT calls foo(infile, outfile) to every infile in INDIR. | |
| % |
NewerOlder