Notes 5/2/2016

def setUp(self):
self.server_log_file = open('.tsdb_server.log.test','w')
self.server_proc = subprocess.Popen(['python', 'go_server.py']
,stdout=self.server_log_file,stderr=subprocess.STDOUT)
time.sleep(1)

def tearDown(self):
self.server_proc.terminate()
self.server_log_file.close()
time.sleep(1)
  • Check if any python jobs are running in the background (of course this doesn’t have to be python)
jobs
ps aux | grep 'python'
#!/bin/bash

if [ $1 == "-h" ]; then
echo "Syntax::sh scriptname output-file classifer-name num-epochs"
exit
fi

# check outputfile
if [ -z $1 ]; then
echo "Output file not specified. Using 'output.all' "
OUTFILE="output.all"
else
OUTFILE=$1
if [ -e $OUTFILE ]; then
echo "Emptying " $OUTFILE
rm $OUTFILE
fi
echo "Output File = " $OUTFILE
fi
  • Get a specific file from a different branch on git
git checkout branch2 file.py
  • Get a specific file from a different branch on git and check changes line by line
git checkout --patch branch2 file.py
Advertisement