Sunday, November 29, 2015

sftp changes in batch mode

We have been using sftp in our scripts for uploads to servers etc and had configured automated emails listing the names of files uploaded. After a server upgrade to Ubuntu 14.04, the sftp emails did not display the filenames. After poking around a bit with -v etc, P found the solution:
Modified the scripts from
sftp -b  /path/to/putaudiofilesdl 2>&1 |tee -a $MAIL_FILE
script -q -c 'sftp -b  /path/to/putaudiofilesdl' |tee -a $MAIL_FILE
and later
cat $MAIL_FILE |tr '\r' '\n'| grep -v 'ETA' | grep -v 'sftp>' | grep -v 'Progress meter enabled' | sed -e /^$/d | sed 's/\/path\/backwards\/of file\///g' | sed 's/100%.*$//g' > /path/tmp/test.txt

and in the file putaudiofilesdl, adde the keyword
before the put command, to enable the progress meter. 

This needs the terminal window to be wide enough to contain both the filename and the progress meter, or else the filename gets truncated. So I modified my Putty saved session - changed number of columns under the Window setting to 180. Then when the script is run with screen, the emails are as desired, with the filenames. 

Saturday, November 28, 2015

locale issues with ssh login from Mac

P reported this problem and solution - he uses a Mac to log on to our Linux servers.

Some commands are failing on ssh login and vnc login

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

They work with local login.
Changing the preferences of the Terminal solved the issue of ssh.

Sunday, November 15, 2015

firefox html5 not showing HD options

While checking out the radiosai live stream videos, found that firefox is not offering the HD options. Found that this is a common complaint. The solution seems to be to use an addon to force the flash player on firefox. Now the 720p option is available.

Thursday, November 12, 2015

using RichCopy to backup files

Used RichCopy to backup files to an external hard disk. Has the filters I need - copy if size is different, etc. This blog post is also illuminating - RoboCopy vs RichCopy vs SyncBack vs EMCopy vs XXCopy vs XCopy vs KillCopy.