Wednesday, October 29, 2014

Paste text in Mac Powerpoint - from Crome - Work around

Some times it fails to paste text in Mac Powerpoint  when something is copied from Crome, or some browsers. Here is the work around:


Use Paste special. 

  • Edit->Paste Special
  • Its keyboard shortcut is Control-Command-v.

Tuesday, October 28, 2014

Installing Dokuwiki on Mac OS X (Mavericks)

For the first time I was successful in installing Dokuwiki on my mac (Its a MacBook Air running Mavericks).

I used info from a combination of these weblinks (almost in that order)
http://machiine.com/2013/how-to-install-apache-and-php-on-a-mac-with-osx-10-8-mamp-part-1/
http://machiine.com/2013/how-to-setup-mysql-on-a-mac-with-osx-10-8-mamp-part-2/
http://machiine.com/2013/how-to-setup-phpmyadmin-on-a-mac-with-osx-10-8-mamp-part-3/
and
https://www.dokuwiki.org/install:macosx
and
http://metadata.mx/personal-wiki/

Please remember you have use some common sense in implementing this. For example I didnt use MAMP or Fluid. But some info like use: http://localhost/~username/dokuwiki/doku.php to access the dokuwiki, etc. 

Tuesday, September 30, 2014

Shrink Preview PDF files without ruining image quality

The following instructions at the given link are pretty useful.

http://www.macworld.com/article/1168311/shrink_preview_files_without_ruining_image_quality.html

If you are not satisfied with results of the Reduce File Size filter (which we use to make PDFs small enough to send by e-mail, etc), follow these steps:

Go to the folder /System/Library/Filters, and open the XML file: Reduce File Size.qfilter

Now rename (copy) that into three files: Reduce File Size Good.qfilter, Reduce File Size Better.qfilter, and Reduce File Size Best.qfilter. Then change the parameters of each file: 0.25, 0.5 and 0.75 for Compression Quality (respectively) and 842, 1684, and 3508 for ImageSizeMax (ditto). (The first is A4-size at 72dpi, the second A4 at 144dpi, and the third A4 at 300dpi).
Finally, change the default string for the Name Key at the end of each file—which is what displays in the Export menu—to match its file name. 
You will have 3 versions of PDF quality filters, when you "export" files to PDF next time. 

Sunday, September 29, 2013

CUDA Clang Error on Mac OSX 10.8

If you got the following error in compiling CUDA sample codes on your Mac OSX 10.8

  1. clang: error: unsupported option '-dumpspecs'
  2. clang: error: no input files
The best solution lies here: devtalk.nvidia.com forum link 
 
This is what is been suggested and that worked for me: 

I had the same problem, thanks to martindeveloper. I found the 
findcudalib.mk but didn't have llvm-g++ (tried to install it but lost 
like 2 hours for nothing, because it doesn't come anymore with XCode and 
compiling it from llvm.org didn't work). Tried with gcc/g++ but nothing
 worked



Finally, I changed GCC ?= g++ to GCC ?= /usr/bin/clang (on findcudalib.mk) 
and everything worked fine (even if clang support is beta)

Monday, April 23, 2012

To find out lines of codes in a source code directory

Use:

find ./name-of-dir '*.php' | xargs wc -l
 
OR
 
( find ./name-of-dir -print0 | xargs -0 cat ) | wc -l 
 
ref: link 

Monday, November 14, 2011

Start and access Amazon EC2 micro ubuntu instance.

Logon/sign in: http://aws.amazon.com/ec2/

Start an ubuntu micro-image, Eg:
ebs/ubuntu-images-milestone/ubuntu-oneiric-alpha2-amd64-server-2011*** (ami-00b14b69)

create a keypair:_ something.pem

change the permission of something.pem to 400:
sudo chmod 600 something.pem

create security group:
- open ssh, tcp - in the security group, by editing/adding rules.

access the virtual machine using ssh, using public DNS of instance:
For ubuntu machines, default user is ubuntu:

So, access it like:
ssh -i something.pem ubuntu@ec2-67-202-**-***.compute-1.amazonaws.com

To install gcc/openmpi

sudo apt-cache search make g++ libopenmpi-dev openmpi-bin openmpi-doc build-essential gcc-multilib libstdc++6
sudo apt-get -y update
sudo apt-get -y install make libopenmpi-dev openmpi-bin openmpi-doc build-essential gcc-multilib libstdc++6

Sunday, March 13, 2011

iweb parsing error - fix

If there is a Parse error: syntax error, unexpected T_STRING, etc in publishing a website developed using iweb on web hosting servers, try the following. I got it fixed.

  • create a file named ".htaccess", where you put "index.html" (or folder called "public", some say - I havent tried this).
  • Add either of the following line to that file:
    • php_flag short_open_tag off
      -- OR -- 
    • php_value short_open_tag 0
That should fix the problem. I got the tip from the following link. It works for me.

http://answers.yahoo.com/question/index?qid=20081022040450AAY1T8u

Thursday, February 10, 2011

BACKUP USING RSYNC & CRON



I wanted to backup my home directory using rsync to a separate drive, and to make it happen automatically.
I spent ages doing research into the various commands, and found everything I needed to know, but not all in the same place. While it was fun for me, others may just want to know how to do it immediately.  So here goes!
The rsync command
sudo rsync -av --progress --delete --log-file=/home/your-username/Desktop/$(date +%Y%m%d)_rsync.log --exclude "/home/your-username/.gvfs" /home /media/HomeBackup
the -av bit: 'a' means archive, or copy everything recursively preserving things like permissions, ownership and time stamps. The 'v' is verbose, so it tells you what its doing, either in the terminal, or in this case, in the log file.  --progress gives you more specific info about progress.
--delete checks for changes between source and destination, and deletes any files at the destination that you've deleted at the source. --log-file saves a copy of the rsync result to a date-stamped file on my desktop.
--exclude leaves out any files or directories you don't want copied. In my case, the .gvfs directory in Hardy Heron was a pain as even with sudo it errored and wouldn't copy properly, so I excluded it (Its not necessary to copy it anyway)  If you don't use Hardy yet, or any distro using the latest Gnome, skip this line, or upgrade!
/home is the directory I want copied. /home copies the directory and its contents, /home/ would just copy the contents
/media/HomeBackup is the separate drive.  Change this to whatever your backup location is. You can actually have this drive off-site and use ssh, but that will be a tutorial for another day!
The bash script
I was just pasting this command into Terminal each day, but wanted something automatic, so step one was a bash script.
Very easy, just open a new document in your favourite text editor, and type #!bin/bash followed by the command itself on a new line. So:
#!/bin/bash
sudo rsync -av --progress --delete --log-file=/home/your-username/Desktop/$(date +%Y%m%d)_rsync.log --exclude "/home/your-username/.gvfs" /home /media/HomeBackup
Save that as rsync-shell.sh on your Desktop and make it executable by typing
sudo chmod +x /home/your-username/Desktop/rsync-shell.sh   
or by right-clicking the file, select Properties, Permissions and then checking the Execute box
You can now double click that .sh file, choose 'Run in Terminal', it will ask you for your password and run, then leave a log file on your desktop.
or, you can make a cron job to do it for you!
The cron job
My biggest obstacle with this was the sudo bit. rsync won't be able to backup all files, or delete any, without root privileges. I didn't want to have to be there when it runs to type in my password, but after a bit of searching I found out how to make a root cron job.
Copy your .sh file to /root by typing
sudo cp /home/your-username/Desktop/rsync-shell.sh /root
Then type
sudo crontab -e
You'll see a line which reads:   # m h  dom mon dow   command
Under that type
0 22 * * * /root/rsync-shell.sh
What this all means is:
1. The number of minutes after the hour (0 to 59)
2. The hour in military time (24 hour) format (0 to 23)
3. The day of the month (1 to 31)
4. The month (1 to 12)
5. The day of the week(0 or 7 is Sun, or use name)
6. The command to run
So at 22:00 (10pm) every day root will run the shell script, without prompting you for sudo password (because its running as root already)
Now press Control-X, then type Y, then press enter.
You'll see   crontab: installing new crontab
And you're done!
 
"I hope this helps!" <--- I borrowed this line from Verbal, but I am sure he's made it Creative Commons!


The original quoted link:
http://www.linuxbasement.com/content/backups-using-rsync-bash-cron

Follow this link to create loginless ssh:
http://blogs.sun.com/jkini/entry/how_to_scp_scp_and

Friday, January 28, 2011

apt-get - how to update, upgrade

It is not necessary that apt-get fetches the latest versions you needed always. You have to update the list of places from where new versions can be fetched.

It works like this:

apt-get looks at:

/etc/apt/sources.list

You have to update that file with proper links:

This post explains it well: https://help.ubuntu.com/community/Repositories/CommandLine

remember Ubundu 8.xx is called hardy, other versions have got different names.. find out and use accordingly.
use: "cat /etc/issue" or "lsb_release -a" to find out the version of linux u r running

once updated the list use
man apt-get to know how to update and upgrade the version list.

then use apt-get install .... to update your libraries with the new versions.



Installing different versions of open mpi - NFS cluster

It can be bit tricky.

Basically we can have different versions of open mpi running on the same machine, because they can work independent if we install them in different folders.

choose an NSF folder which is common to all machines. Eg: /opt
create a folder called /opt/mpi
create a folder for the version you are planning to install. Eg: /opt/mpi/ompi-4.3.1
(u need root privileges)

Now download tar (.gz) file of the version u r planning to install from openmpi site.

http://www.open-mpi.org/software

(better not to build from the svn checkout version. get the native one)

Now make sure that your system has got the correct versions of autoconf, automake, libtool, gcc, ffortran, g++ etc
(this link will help you to know the requirements: http://www.open-mpi.org/svn/building.php)

if apt-get does not get you the latest or the right version, manually install them.
Eg: from the gnu site: ftp://ftp.gnu.org/gnu/

(manual installation tips:
./configure,
./make all install

you may have to set the correct symbolic links using "ln -s" command at: /usr/bin/ as well.

check versions using --version command. Eg: gcc --version
)

Once your env is ready, start installing open-mpi.

Unzip the tar file

(in the below step, adding prefix is important, otherwise the installation will conflict with the previous or next version installations)

./configure --prefix=/opt/mpi/ompi-4.3.1

(a lot of output)

./make all install

(a lot of output)

If you are lucky, your new open mpi will be installed at /opt/mpi/ompi-xxx folder, without any fuss. Or address the bugs :( and install.

Now, set the PATH and LD_LIBRARY_PATH at .bashrc file to /opt/mpi/ompi-xxx/bin and /opt/mpi/ompi-xxx/lib as follows:

PATH=/opt/mpi/ompi-1.4.3/bin:$PATH
export PATH

LD_LIBRARY_PATH=/opt/mpi/ompi-1.4.3/lib
export LD_LIBRARY_PATH

Logout and login again....
Now this open mpi version should be accessible by all nodes in the NFS cluster. Happy open-mping..

Sunday, March 14, 2010

Solve Conflict between IEEEtran class and 'listings' in creating captions

This tip works like a charm.

Use this patch code after IEEEtran loads:

\makeatletter
\let\@ORGmakecaption\@makecaption
\long\def\@makecaption#1#2{\@ORGmakecaption{#1}{#2}\vskip\belowcaptionskip\relax}
\makeatother

Monday, October 5, 2009

mpirun and "test"

I had a great revelation today! I was unable to run my MPI program named "test.cpp" using mpirun (Open MPI) 1.3.2

I was stuck up for 3 days!

I couldnt find any problem with my code. I tried, tried, tired. It didnt work!

I changed the name of file to "client.cpp"

Alleluia! It worked. It seems that "test" is a reserved word/file in MPI. Dont mess with it, ever!

Wednesday, August 26, 2009

Differences between C++ Classes and Structs

Quoted from Ref:

Probably the most frequently asked interview question that I have received is one that explores the difference between C++ classes and structs. Such a question was asked by a Northrop Grumman recruiter during a career fair at UC Irvine. I was also asked this sort of question during an on-site interview at Heavy Iron Studios. Recently, it has been asked during a phone interview with Amazon.com.

My answer typically states that members of a class are private by default, whereas members of a struct are public by default. Inheritance between classes is also private by default, and inheritance between structs is public by default. The interviewer was usually satisfied with this answer, which Dr. Raymond Klefstad fed to my first computer science class. Lately, I was interested in the nontrivial cases that bring me uncertainty: a struct inheriting from a class and a class inheriting from a struct.

Tuesday, March 10, 2009

IEEEtran latex - url in reference

The url representation in reference (using bibtex in latex) may break up. U can avoid that by using:

usepackage{hyperref}

in latex file.

Monday, February 16, 2009

Installing Husband.

I got this email from one of my friends.. hilarious.

------------------------------------------------------------------
A desperate woman writes to the Technical support Guy,



Dear Tech Support,

Last year I upgraded from Boyfriend 5.0 to Husband 1.0 and I noticed a distinct slowdown in the overall system performance, particularly in the flower and jewellery applications, which operated flawlessly under Boyfriend 5.0.

In addition, Husband 1.0 uninstalled many other valuable programs, such as
Romance 9.5 and Personal Attention 6.5, and then installed undesirable programs such as NEWS 5.0, MONEY 3.0 and CRICKET 4.1.

Conversation 8.0 no longer runs, and Housecleaning 2.6 simply crashes the system.

Please note that I have tried running Nagging 5.3 to fix these problems, but to no avail.

What can I do?

Signed,

Desperate Woman


DEAR DESPERATE Madam,

First, keep in mind, Boyfriend 5.0 is an Entertainment Package, while Husband 1.0 is an operating system.

Please enter command: ithoughtyoulovedme.htmland try to download Tears 6.2 and do not forget to install the Guilt 3.0 update.
If that application works as designed, Husband1.0should then automatically run the applications Jewellery 2.0 and Flowers 3.5.

However, remember, overuse of the above application can cause Husband 1.0 to default to Silence 2.5, Happy Hour 7.0 or Beer 6.1.
Please note that Beer 6. 1 is a very bad program that will download the Farting and Snoring Loudly Beta.

Whatever you do, DO NOT under any circumstances install Mother-In-Law 1.0 (it runs a virus in the background that will eventually seize control of all your system resources.)

In addition, please do not attempt to reinstall the Boyfriend 5.0 program. These are unsupported applications and will crash Husband 1.0.

In summary, Husband 1.0 is a great program, but it does have limited memory and cannot learn new applications quickly.
You might consider buying additional software to improve memory and performance.
We recommend: Cooking 3.0 and Hot Looks 7..7.

Good Luck

Tech Support .

Saturday, January 31, 2009

Find the disk space usage in Mac and Linux

To find the total space usage of all the files/folders in a particular folder, in human readable form, use:

du -sh *

(on Terminal)

Thursday, September 4, 2008

Find free disk space

Use

df -h

or

df -k

To Increase the hard disk size of OS in Parallels (Mac OSX)

Refer the link:




In case, if you dont find it there:

1. Find your hard disk image file on the host machine (in this case Mac OS). Run the Parallels Image Tool.app on it and expand it to the desired size.

My Parallels disk image is located in:

~/Library/Parallels/Microsoft Windows XP/winxp.hdd

These days, Parallels is installing that image in:

~/Documents/Parallels


2. Use the Finder to duplicate the hard disk image you wish to expand.

3. Open Parallels but do not start Windows. Open the Parallels Preferences for the virtual machine. Change the hard disk image path to the duplicate image. (Note, this is not the "Default Folder for Virtual Machine" setting you first see. It is the Hard Disk setting, lower on the Preferences screen.)

4. Add a new hard disk via the Add button at the bottom of the screen. Set the new hard disk's path to the original image. The purpose of this and the above step is to boot from the duplicate disk, so that Windows can have full access to the disk (original image) you wish to expand.

5. Boot up Windows. Windows will report that it has identified new hardware. After that is finished, then navigate to Start -> Run. Type (no and no quotes), and press Run/Enter.

6. In the new window that appears type:

7. After that process runs, a list of disks appears. Notice that Volume 1 and Volume 2 look identical. Note: Volume 2 should be the original hard disk image.

8. Select Volume 2 by typing: select return. Then extend it by typing . Once that is complete type exit return. Then shut down Windows.

9. Before starting Windows, clean up the Virtual Machine preferences by using the Parallels preferences to delete the second hard disk, and to switch the Hard Disk 1 path back to the original hard disk image. You can put the duplicated Win XP hard disk image into the Mac Trash.

10. Restart Windows. Rebooting may be necessary if Windows "detects new hardware."

Create shared folders between Mac OSX and Parallels Linux OS

Follow the link:

http://ubuntuforums.org/archive/index.php/t-325768.html

To install a new version of gcc in RHEL (any linux)

Ref:

http://www.tellurian.com.au/whitepapers/multiplegcc.php

About Me

My photo
Jaison Paul Mulerikkal is the Vice Principal of Rajagiri School of Engineering and Technology (RSET), Kochi. He was the Principal of Jyothi Engineering College (JEC), Cheruthuruthy, Trissur, India. He is a member of CMI Sacred Heart Province, Kochi. He is a civil engineer by profession, but did his Masters in Information Systems from RMIT University, Melbourne, Australia and subsequently received his PhD in High Performance Scientific Computing from the Australian National University. He had worked as a computational scientist at the University of Auckland, New Zealand.