Friday, August 11, 2017

Copy files into sd card which is mounted as mtp on Linux Command ine

mtp is media transfer protocol. These devices are mounted in /run/user/$UID/gvfs/mtp*

/run/user/0/gvfs/mtp\:host\=%5Busb%3A002%2C075%5D/Internal\ storage/Documents/

we can copy into this location


just use back slash (\) before spaces in file name (if you have spaces)) in cp command.


Similar way, you can use scp to copy from remote location

Examples :
cp /root/Documents/perl.pdf /run/user/0/gvfs/mtp\:host\=%5Busb%3A002%2C075%5D/Internal\ storage/Documents

or

scp 192.168.0.99:/root/Documents/perl.pdf  /run/user/0/gvfs/mtp\:host\=%5Busb%3A002%2C075%5D/Internal\ storage/Documents/


Zurmo CRM Error - Notice: Undefined property: WebApplication::$minScript in app/protected/core/views/PageView.php

If you are trying to open zurmo using url and not able to open because of following errors

Notice: Undefined property: WebApplication::$minScript in zurmo/app/protected/core/views/PageView.php on line 268

Fatal error: Call to a member function generateScriptMap() on a non-object in zurmo/app/protected/core/views/PageView.php on line 268


Solution :

Remove content of runtime Folder.

sudo rm -r zurmo/app/protected/runtime/*

Now try to open it again. You should not get the error now.

Monday, July 3, 2017

Convert Text file into pdf on Linux command line

Create a small size pdf file from a text file

First install enscript on linux system.

Debian/Ubuntu
apt-get install enscript


CentOS/Fedora
yum install enscript


Command to convert text file into pdf
enscript -B /path/of/text-file.txt -o - | ps2pdf - "/path/of/output.pdf"

-B is for not printing header on top of the pdf pages