Fast plot from bash.
Usually i need make tentative graphics of a data set, and this require use gnuplot, with command and others things, for this reason i make a little script for plot directly from the bash with arguments (file and options) using gnuplot (you need gnuplot installed in your system).
For example for plot a simple file with data (as here). a fast plot is made using :
xplot example.dat
For a more complex file as here, you can plot using :
xplot freefall.dat u 1:2 w lp
The script for plot from the bash its here :
#!/bin/sh
TMP="/tmp/gnuplot.tmp"
############################################################################
if [ $# != 0 ];
then
echo "set title \"Xplot Fast Plot with gnuplot\" ." > $TMP
echo "set xlabel \"x axes\"" >> $TMP
echo "set ylabel \"y axez\"" >> $TMP
echo -n "plot \"$1\" " >> $TMP
for i in $@
do
if [ $i != $1 ];then
echo -n "$i " >> $TMP
fi
done
echo "">>$TMP
gnuplot -persist $TMP
rm $TMP
else
echo "Please use xplot <file.dat> <options> to plot"
exit
fi
Now you can put this file in /usr/local/bin/ (with xplot or another name) and give execution permissions with :
chmod 755 /usr/local/bin xplot
Now, any user can run the xplot script.
JP.
Encoding text files with vim.
Vim (vi improved) its a great text editor, used principally for programmers and others. The last days i want have a file with my passwords, because i use a lot of different password for each utility. For this reason i make a simple text file with this passwords, however i want maintain this passwords in secret, for this reason i use vim.
For example, i have a file with my password called ‘password.key’, the first time (blank file) i open this using :
vim -x password.key
after i put a password for this file (twice). And write in this file as a simple and normal file.
The next time that i want edit or see this file, i use :
vim password.key
and vim, solicit the password for edit this file. This is a god form of maintain my passwords in a secure file.
JP.

