Wednesday, June 24, 2015

Calculating Processing Time in Linux Shell File

#!/bin/bash
START=$(date +%s)
# do something
# start your script work here

ls -R /etc > /tmp/x
rm -f /tmp/x
# your logic ends here
END=$(date +%s)
DIFF=$(( $END - $START ))
echo "It took $DIFF seconds"

Saturday, June 6, 2015

Removing Extension of a File Name C++

Quite practical one:
int lastindex = fullname.find_last_of("."); 
string rawname = fullname.substr(0, lastindex); 

Setting Jupyter and Tensorflow on Google Cloud Platform

https://towardsdatascience.com/running-jupyter-notebook-in-google-cloud-platform-in-15-min-61e16da34d52