How to start X program from cron

Hello

Well today I have to make a little script that close a chromium erase the cache and start it again.

Bellow is the script

#!/bin/bash
ps aux|grep 'chromium-browser'|awk {'print $2'}|xargs kill -9
/bin/rm -rf /home/user/.cache/chromium
/bin/sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' /home/user/.config/chromium/Default/Preferences
DISPLAY=:0 /usr/bin/nohup /usr/bin/chromium-browser  &

If you will have something like

No protocol specified Can't open display :0

First of all check if you are runing the script as  user . Because if you are root won’t work.

Invalid command “SSLEngine”, perhaps misspelled or defined by a module not included in the server configuration

If you have bellow error you should install mod_ssl
“Invalid command “SSLEngine”, perhaps misspelled or defined by a module not included in the server configuration”
The error message indicates that the module mod_ssl required to run SSL engine on a CentOS server is missing and needs to be installed.
Install the mod_ssl module using yum

yum install mod_ssl

Once it is installed, make sure to restart the Apache service

service httpd restart

s3fs and centos 6.2

Well today I was trying to install s3fs on a centos 6.2 server . So first of all I try this

yum install gcc libstdc++-devel gcc-c++ curl-devel libxml2-devel openssl-devel mailcap fuse fuse-devel
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar xvzf s3fs-1.61.tar.gz
cd s3fs-1.61/
./configure --prefix=/usr
make
make install

However the configure wasn’t working because of fuse version. I have installed 2.8.3 and I need 2.8.4

So the solution was to recompile the fuse also

  yum remove fuse fuse* fuse-devel
  yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap
  cd /usr/local/src
  wget "https://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz?r=&ts=1299709935&use_mirror=cdnetworks-us-1"
  tar -xzvf fuse-2.8.4.tar.gz
  rm fuse-2.8.4.tar.gz
  mv fuse-2.8.4 fuse
  cd fuse/
  ./configure --prefix=/usr
  make
  make install
  export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/
  ldconfig
  modprobe fuse
  pkg-config --modversion fuse (confirm that 2.8.4 is the version displayed)
  cd ../
  cd s3fs-1.61/
 ./configure --prefix=/usr
  make
 make install

firefox no video supported format and mime type found

Well, a quiq solution to this you should add this on your .htaccess file

AddType video/ogg .ogm
AddType video/ogg .ogv
AddType video/ogg .ogg
AddType video/webm .webm
AddType audio/webm .weba

AddType video/mp4 .mp4
AddType video/x-m4v .m4v

Equivalent of rpm -qa in ubuntu

Well in rpm base distribution you may use this

rpm -qa /path/to/file

And you will have a answer like this :

 rpm -qf /usr/bin/top
procps-3.2.7-11.1.el5

On a ubuntu server you should run

dpkg -S /path/to/file
 dpkg -S /usr/bin/top
procps: /usr/bin/top
← Older Entries