I was looking for a tool which can convert pdf file to eps file. pdftops comes to my attention.
usage:
pdftops -eps name.pdf
which can convert the name.pdf file to name.eps.
Convert pdf file to eps
Should you really have to wait longer time to change your pass word on Linux?
When you try to change the pass word for a user on Linux, you may encounter "You must wait longer to change your password". Do you really need to wait longer time to change the pass word? No! You can use chage command to solves this kind of issue :
The following command will list policies for your pass word.
$ chage -l username
Last password change : Feb 08, 2012
Password expires : Apr 08, 2012
Password inactive : Apr 08, 2012
Account expires : never
Minimum number of days between password change : 1
Maximum number of days between password change : 60
Number of days of warning before password expires : 14
In this case, your password policy specifies that the minimum number of days between password changes is 1 day. You can change this attribute to 0 to make enable pass word change right now. To change the policy for this user, use :
$ chage username
Changing the aging information for username
Enter the new value, or press ENTER for the default
Minimum Password Age [1]: 0
Maximum Password Age [60]:
Last Password Change (YYYY-MM-DD) [2012-02-08]:
Password Expiration Warning [14]:
Password Inactive [0]:
Account Expiration Date (YYYY-MM-DD) [1969-12-31]:
-M option: which can be used to specify the maximum number of days the password is valid. combine 99999, you could disable password expiration.
$ chage -M 99999 user_name
Create a new Git Remote Repository
#On local machine
if you want to ignore some files or folders from putting them in the repository, you could create a .gitignore file before running git add .
$ cd foo_project
$ git init
$ git add *
$ git commit -m "initial msg" (Do not forget to do this step, or you will enconter "Git error: src refspec master does not match any")
Now, create the repository on your Git server. All of my git repositories are located at /usr/local/git_root/ of the remote server
#On remote machine
$ mkdir git_root/
$ cd /usr/local/git_root/
Create your new project git repo as a bare Git repository
$ mkdir project_name.git
$ cd project_name.git/
$ git --bare init
Make sure permissions are set properly. These are common options I use for my shared repositories
$ git config core.sharedrepository 1
$ git config receive.denyNonFastforwards true
$ find objects -type d -exec chmod 02770 {} \;
#The core.sharedrepository flag tells git to keep everything group readable and writable.
#The receive.denyNonFastforwards flag makes sure that merges can't happen when you push to the repo.
You have to do the merges on your local machine, and then push the result.
Now, go back to your local repository, and add the newly created remote repository so it tracks from the remote repository (origin).
#On local machine, in your git project
adding a remote by:
git remote add origin ssh://ip_address_of_remote_server/usr/local/git_root/project_name.git
git remote add origin user_name@ip_address:/usr/local/git_root/EMAN2.git (I used this command in my case)
git push -u origin master
Install R develop version and RPy2 on CentOS 5.5
Before configure and compile R source code, I did the following updating of CentOS in order to support R capabilities by installing these packages:
[sourcecode language=""]
libtiff libtiff-devel
libpng libpng-devel
libjpeg libjpeg-devel
cairo cairo-devel
libX11 libX11-devel
libXt ibXt-devel
readline readline-devel
[/sourcecode]
and in order to produce the pdf version of the R-manual, I also installed all search results of
[sourcecode language="bash"]
yum search tetex except tetex-doc
[/sourcecode]
The RPy2 requires that you enabling R-shlib when you install R package. To do so you can build your own R package from source code.
1. donwload R source code: from http://cran.r-project.org/src/base/R-2/
[sourcecode language="bash"]
./configure --enable-R-shlib
[/sourcecode]
Here are my configuration results:
[sourcecode language=""]
R is now configured for x86_64-unknown-linux-gnu
Source directory: .
Installation directory: /usr/local
C compiler: gcc -std=gnu99 -g -O2
Fortran 77 compiler: gfortran -g -O2
C++ compiler: g++ -g -O2
Fortran 90/95 compiler: gfortran -g -O2
Obj-C compiler:
Interfaces supported: X11, tcltk
External libraries: readline
Additional capabilities: PNG, JPEG, TIFF, NLS, cairo
Options enabled: shared R library, shared BLAS, R profiling, Java
Recommended packages: yes
configure: WARNING: inconsolata.sty not found: PDF vignettes and package manuals will not be rendered optimally (as for this warning, specific fonts is not found.)
[/sourcecode]
2. Continue the following steps to complete installing R
[sourcecode language="bash"]
make
make check
make install
[/sourcecode]
some other errors you may encounter:
[sourcecode language=""]
configure: error: no acceptable C compiler found in $PATH --install gcc gcc-c++
configure: error: No F77 compiler found --install compat-gcc-34-g77 gcc-gfortran
configure: error: --with-x=yes (default) and X11 headers/libs are not available --install libXt-devel
[/sourcecode]
3. Install RPy2:
[sourcecode language="bash"]
/opt/python2.7/bin/easy_install rpy2
[/sourcecode]
You could use python2.7 if you have made a symbolic link in /usr/bin/python2.7 by
[sourcecode language="bash"]
ln -s /opt/python2.7/bin/python /usr/bin/python2.7
[/sourcecode]
** I had encountered a problem showing that lpython2.7 cannot be found, to solve this problem I created a symbolic link
[sourcecode language="bash"]
cd /usr/lib64
ln -s /opt/python2.7/lib/libpython2.7.so.1.0 libpython2.7.so.1.0
ln -s libpython2.7.so.1.0 libpython2.7.so
[/sourcecode]
If you have more than one R package installed on your system you may encounter some errors, like "rpy2.rinterface.baseenv.get("show") show not found" when you try to use the rpy2 package.
solution:
configure the /etc/ld.so.conf.d/R-x86_64.conf file, create the file if the file does not exist Put the path of the R package whic you used to build your rpy2 into this file. Mine is /usr/local/lib64/R/lib.
Run /sbin/ldconfig
You may solve the problem by now.
3. install libraries in R
[sourcecode language="bash"]
sudo R
install.packages('package_name')
[/sourcecode]
pay attention to the location of the installation of new packages "/usr/local/lib64/R/library/e1071/libs"
Sometimes when you install a package and it requires at least certain version of the R, you could download the source code of the package and do the following installation:
[sourcecode language="bash"]
install.packages("/path/to/the/packages/source/file", repos=NULL, type="source")
[/sourcecode]
How to find the procss using specific port and kill it
I am using PyDev in Eclipse on CentOS. Eclipse crashes sometimes and leaves python still using port 8000. Before you can restart the development server, you have to kill the previous process, to do so,
$ sudo /usr/sbin/lsof -w -n -i tcp:8000
which will list the process pid using port 8000
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
python2.7 6211 htang 3u IPv4 157102 TCP 127.0.0.1:irdmi (LISTEN)
$ sudo kill 6211
which will kill process 6211.
Install R CentOS 5
I have tried installing R on CentOS 5.5 by the following way and it test good.
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum install R
You can run the R with scripts from cmd line by doing one of the following:
R < mean.R
R CMD BATCH mean.R
Rscript mean.R
Datatable static image not found on the server
When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...
-
Here are the simple steps, I used to update eclipse to Kepler on my Ubuntu 12.04.3 box. 1. download the appropriate package of eclipse from...
-
Here is the example of installation of Hadoop on a single machine, UBuntu box in this case. For a simple cluster installation, please refere...
-
Prepare the environment Before configure and compile R source code, I did the following updating of CentOS in order to support R capabilitie...