for sim in Simplex_*; do cd $sim; if [ ! -s ATTEMPTS.txt ]; then echo $sim; fi; cd ..; done
Latex page setting definitions
Upload to Box via the command line
To send a directory recursively to Box from the command line, use:
find directoryname -type f -exec curl -1 --disable-epsv --ftp-skip-pasv-ip -u username:password --ftp-ssl --ftp-create-dirs --upload-file {} ftps://ftp.box.com/{} \;
Delete OAR* files
In order to remove all the OAR* files in directory tree use the following command.
find . -name "OAR*" -type f -delete
Auto-indent and clean up .f files
Open the file in emacs: emacs file.h
Select the entire file: C-x h
Auto-indent: C-M-\
Save the file: C-x s
Close emacs: C-x C-c
Making all citekeys in Papers universal
In the terminal, make the following command making sure the path is right:
sqlite3 '/Users/your_name/Documents/Papers2/Library.papers2/Database.papersdb'
Then in sqlite enter the following:
UPDATE Publication SET citekey = NULL;
Then ctrl-D to exit.
Running Mathematica scripts from command line
Math -noprompt -run "<<script.m"
Passing arrays in C++
There are three ways to pass an array to a function in C++:
`void by_value(const T* array) // const T array[] means the same
void by_pointer(const T (*array)[U])
void by_reference(const T (&array)[U])`
Preparing asteroidbelt files
This is an example simple command to move all of the pl.dat files into a single directory from a set of runs.
for dir in Run*; do cp $dir/OUT/dump_pl.dat ../belt/100km-$dir-pl.dat; done
This how to loop through the files to input them into belt_statistics
for run in *pl.dat; do echo $run > temp; ./belt_statistics < temp; don
Tar and Gzip
To pack:
tar cvf - FILE-LIST | gzip -c > FILE.tar.gz
To unpack:
gunzip < FILE.tar.gz | tar xvf -
Creating .gitignore
The following command collects all of the untracked files within a git directory and moves them to .gitignore.
git status --porcelain | grep '^??' | cut -c4- >> .gitignore