Featured Posts

Installing MathabxInstalling Mathabx Mathabx is an important symbol library for latex. The full list of available symbols in latex can be found here. Following steps will help one to install mathabx in ...

Readmore

cronScheduled Tasks using cron Learn how to schedule tasks using cron in Linux!

Readmore

Joomla!Getting started with Joomla! Joomla! is a great open source tool for making great websites with very little effort and absolutely no cost ...

Readmore

Rss

Using Ghostscript to concatenate two pdf files

0

Posted by Sandeep Pathak | Labels: Ghostscript, Linux | Posted on Monday, December 6, 2010

Install Ghostscript and use the following syntax -

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=final.pdf file1.pdf file2.pdf

Extracting fields from multiple files using awk

1

Posted by Sandeep Pathak | Labels: awk, Linux | Posted on Sunday, February 7, 2010

Say, you have two files file1 and file2 containing data in the tabular form in 3 columns each and you want to extract column 2 of file1 and column 1 of file2. We can do it using the combination of paste and awk commands as follows:

paste file1 file2 | awk '{print $2 " " $4}'


We can do more! Suppose you want to add column 1 of file1 to column 3 of file2. This can be accomplished using the following command:

paste file1 file2 | awk '{print $1-$6}'

Installing Mathabx package for latex in Ubuntu

1

Posted by Sandeep Pathak | Labels: Latex, Linux, Mathabx, Ubuntu | Posted on Sunday, September 27, 2009

Mathabx is an important symbol library for latex. The full list of available symbols in latex can be found here. Following steps will help one to install mathabx in Ubuntu 9.04.

  1. Download mathabx.zip from the following link.
  2. $ unzip mathabx.zip
  3. $ cd mathabx
  4. $ sudo mkdir $TEXMF/fonts/source/public/mathabx
    In Ubuntu 9.04, TEXMF is /usr/share/texmf-texlive
  5. sudo cp source/*.mf $TEXMF/fonts/source/public/mathabx
  6. sudo cp texinputs/* $TEXMF/tex/generic/misc/
  7. Update the database
    $ sudo texconfig rehash
  8. Update the format file
    $ sudo fmtutil --refresh
  9. When you build your tex document, you might get an error that /Asterisk is defined again - To avoid that, comment the line in mathabx.dcl where /Asterisk is defined.
    $ sudo gedit $TEXMF/tex/generic/misc/mathabx.dcl
    Search for line where /Asterisk is present in mathabx.dcl and put a % sign at the start of the line.
  10. You are all set!

Scheduled Shutdown using cron

0

Posted by Sandeep Pathak | Labels: Ubuntu, Utilities | Posted on Thursday, May 14, 2009

Use the command
$ crontab -e
In the editor window write
0 9 * * * /sbin/shutdown -h now
This will shutdown your computer at 9 hrs. After this restart cron service:
sudo /etc/init.d/cron restart

Change file permissions recursively without affecting directories

0

Posted by Sandeep Pathak | Labels: Linux | Posted on Tuesday, May 12, 2009

If you want to change the permissions of the file to 600 without affecting the directories permissions, use the following command:

find . ! -type d -exec chmod 600 {} \;

Starting enumerate with a specified number in Latex

0

Posted by Sandeep Pathak | Labels: Latex | Posted on Tuesday, November 25, 2008

If you want to start your enumerate with a specified number but 1, you should use \newcounter tag. The following example illustrates the use of the tag if, for example, we need to start our enumeration from 6 and not 1:

\begin{enumerate}
\setcounter{enumi}{5}
\item Hello
\item Bye
\end{enumerate}

TRICK TO GET FONTS CORRECT IN FEDORA 9

0

Posted by Sandeep Pathak | Labels: Fedora, Font Problems, Mathematica | Posted on Tuesday, November 18, 2008

Install libQtCore and libQtGui first. Then,

On a 32-bit machine

rm -f /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4

rm -f /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4

ln -s /usr/lib/libQtCore.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4

ln -s /usr/lib/libQtGui.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4

On a 64-bit machine,

rm -f /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4

rm -f /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4

ln -s /usr/lib64/libQtCore.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtCore.so.4

ln -s /usr/lib64/libQtGui.so.4 /usr/local/Wolfram/Mathematica/6.0/SystemFiles/Libraries/Linux/libQtGui.so.4