PHP on Linux (Ubuntu 11.04 – Natty Narwhal)

These are some of the codes that helped me getting started in using Apache server on Ubuntu 11.04 (Natty Narwhal)

Finding out the user group

 <?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?> 

(often it is www-data )

source : http://php.net/manual/en/function.exec.php


Check you have the permission. If not change the pormissions for the var/www folder on Linux (in case of a 403 error)

If you make /var/www writeable by its group and add the user to the group, that user will not have to use sudo. Try this:
sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
The user should then be able to edit /var/www/ files without hassle.

The first line adds the user to the www-data group, the second line clears up any files with messed up ownership, and the third makes it so that all users who are members of the www-data group can read and write all files in /var/www.

source : http://askubuntu.com/questions/19898/whats-the-simplest-way-to-add-files-to-var-www


Location of the Apache error log :

/var/log/apache2/error.log

Quickly access the last few lines of the Apache access log tail -f  /var/log/apache2/error.log

http://php.net/manual/en/function.exec.php
http://php.net/manual/en/function.exec.php

Abaqus (V 6.10, 6.11) installation on Ubuntu (10.04 and 11.04)

I installing Abaqus (both versions 6.10 and 6.11) on Ubuntu (versions 10.04 and 11.04)

This was not a trivial task. Here are the links which helped me do this :

Abaqus 6.10 on Ubuntu 10.04

Details on installing Abaqus 6.8 on Ubuntu 10.04 (Lucid-Lynx) can be found here :
http://sites.google.com/site/abaqus2010/help_0

Using the same details, I was able to install Abaqus 6.10 on Ubuntu 10.04.

On installing, the files are in .exe format. The above link, gives details on how to start the CAE (GUI modeling) part of Abaqus.

Abaqus 6.10 on Ubuntu 11.04

I was able to install Abaqus on Ubuntu 11.04 following the same guidelines as the above one. But this link, http://oswald-lab.wikispaces.asu.edu/Installing+ABAQUS gives details specific to Ubuntu 11.04. Following these instructions, I was able to install Abaqus 6.10 on Ubuntu 11.04.

Other files you might need…

I was not able to get termcap from the Ubuntu repos. I got it from here : http://geco.phys.columbia.edu/~rubab/iraf/iraf_step_by_step_installation_64bit

Getting Organized – how to include your Gmail calendar in your TiddlyWiki

There is a simple way to embed your Google Calendar anywhere in your pages (Note: the calendar is displayed only when you are logged in)

[html]



[/html]

This is an iframe element. You can control the height and the width of the calendar in the html code

Mathematica – specifying 3D vertex coordinates for a 3D graph

This is specific to Mathematica 8.*, where Graphs are atomic expressions

There was no simple way to assign the 3D vertex-coordinates to the vertices of a graph.
Whereas a 2D graph’s vertex-coordinates can be initialized as follows :
[text]
vertices = {1, 2, 3};
coords = {{0, 0}, {1, 0}, {2, 0}};
connectivity = {1 -> 2, 2 -> 3};
myGraph = Graph[connectivity, VertexCoordinates -> coords]
[/text]
the same when tried on a 3D vertex fails :
[text]
vertices = {1, 2, 3};
coords = {{0, 0, 0}, {1, 0, 0}, {2, 0, 0}};
connectivity = {1 -> 2, 2 -> 3};
myGraph = Graph[connectivity, VertexCoordinates -> coords]
[/text]
The workaround was simple – you use a separate property for for each vertex. In my case I used a property called “VertexCoordinate3D” as follows and got the rest of the code up and running :
[text]
vertices = {1, 2, 3};
coords = {{0, 0, 0}, {1, 0, 0}, {2, 0, 0}};
connectivity = {1 -> 2, 2 -> 3};
(*myGraph = Graph[connectivity, VertexCoordinates->coords]*)

myGraph = Graph[connectivity];
(PropertyValue[{myGraph, vertices[[#]]}, “VertexCoordinates3D”] =
coords[[#]]) & /@ Range@Length@VertexList[myGraph];
[/text]

Installing GD image manipulation capabilities in PHP on Ubuntu 11.04

I wanted to enable the image manipulation functions using Php. It was documented that the that GD library is included in Php versions 4.3 and above. I had PHP version 5.3.5 on my Ubuntu 11.04.

I tested the GD support using the code:

[php]
< ?php echo "GD Info :
“;
var_dump(gd_info());

if (imagetypes() & IMG_PNG) {
echo “PNG Support is enabled”;
}
?>[/php]

I found out the the GD extension had to be enabled in the PHP.ini file (which can be found at /etc/php5/apache2/php.ini ). I had to add the following line

[shell]extension=gd.so;[/shell]

Then restart the Apache server :

[shell]sudo /etc/init.d/apache2 restart [/shell]

Then I tested the GD support again and I confirmed that it works !

[text]
GD Info
array(12) { [“GD Version”]=> string(3) “2.0” [“FreeType Support”]=> bool(true) [“FreeType Linkage”]=> string(13) “with freetype” [“T1Lib Support”]=> bool(true) [“GIF Read Support”]=> bool(true) [“GIF Create Support”]=> bool(true) [“JPEG Support”]=> bool(true) [“PNG Support”]=> bool(true) [“WBMP Support”]=> bool(true) [“XPM Support”]=> bool(false) [“XBM Support”]=> bool(false) [“JIS-mapped Japanese Font Support”]=> bool(false) } PNG Support is enabled
[/text]

My first 3D jigsaw puzzle

Today I was strolling the malls with my friend. We went into a gift shop to buy a hat for my friend. I cuaght sight of some puzzles that were there. One of them that caught my attention was this 3D jigsaw-puzzle. I have seen one of them before, but that was a simple one, made up of 3 pieces (where one had to assemble it into a tetrahedron). This one had more (13) pieces! So I bought it right away

Here is a snapshot of the pieces

TiddlyWiki

This post is about a nice program I stumbled upon

TiddlyWiki –  a reusable non-linear personal web notebook

This is comparison of  a few tools that I used (NOTE  USED not REVIEWED), which I think could help someone out there who is looking for one

I believe that human-memory/thinking is highly nonlinear. And I was in search of some tool to organize my notes efficiently.  I am an academic researcher and I crave for perfection ( and I know too much of it is not good though).

I had previously tried various options including Microsoft One Note,  simple notepad, MindMaps, web-blogs (like this one) etc., before I got lucky and bumped into TiddlyWiki!

Microsoft OneNote:

I believe it is a (very) free-form notes organizer. It allows one to just copy about anything one can think of, be it HTML(it automatically inserts the link while doing so – which I think is nice ), audio (including your own), files (just drag-n-drop and it can save the complete file or save a link to the file), images (it can do text search inside an image) and has sync options (which I have never tried) and much more.

But the downsides are it is not free (obv.) and working concurrently from multiple places (and multiple Operating systems) makes is difficult to mange my files (particularly if you have inserted references to the files and the folder structures are different across different computers). [ Maybe it has some feature which allows to cross-reference different files, which I wanted – c.f. nonlinear! ]

So it turns out that OneNote is not a good option (esp. for me given my requirements). I still use OneNote to quickly take screenshots of the screen and insert it into my OneNote slide

Simple Text files:

I subscribe to the idea that simplicity is the ultimate sophistication.  After briefly confronting the sync issues (particularly across OSes), I resorted to a simple note keeping using text files. I use Notepad++ which I think is a COOL text organiser (exp. because I also do a lot of programming, and use different languages and Notepad++ seamlessly understands a lot of languages – it has become my universal editor and its open-source!)

I used to organize things using indent-level (c.f. Python!) and was copy-pasting links (web-links and links to files and folders) that needed to go in. I used to carry them around in my USB.

The shortcomings are obvious – I could not insert images to it and the contents were static (simple?). I expanded the number of text files to include new items and at one point of time I had a tough time to manage all of the files. And cross-linking contents across files was a serious issue – I had to remember trivial things like which info went where (which I hated) to get them (because it turned out doing ctrl+f was not an intelligent option).

MindMaps (using Freemind) :

Mind maps are a good way to store academic

I was using Freemind to get things organized. It is free and written in Java. So it works seamlessly across OSes and there is portable version in case you needed to work on stray comps too!. And one more nice thing about it is, the files are saved in human-readable format (which I think is well-thought and a nice idea!)

This was looking good initially when I started out. Though it had some nice features, one feature which I think was missing is that the links are good in one direction and reverse links were not working that good (note : this can change in the future though). This made it difficult for bidirectional navigation. Also (as I am writing this post) the startup time of Freemind is a bit long (on my comp(s)) which makes it a bad choice to make simple changes – I feel lazy to wait for more than 10 seconds to make a simple change – so I open a text file and dump the contents into it and sync it later to my FreeMind notes.  Personally this did not seem to be a viable solution for me.

TiddlyWiki

When I was searching for something to get organized, I came across TiddlyWiki. And the tag-line a reusable non-linear personal web notebook” caught my attention and I moved it to my “To-Explore” list. That weekend I started fiddling around with it. It has several nice features which I was looking for :

  • Must work across OSes – the data is stored in a single file and it works on multiple browsers.
  • Must be nonlinear – its your PERSONAL WIKI ( it can get as webby as u can stretch it !)
  • Easy ways to organize
    • open-source, free and well-thought of piece of software!
    • can interlink entries – “tiddler”(a basic piece of content in TiddliWiki) other “Tiddlers”
    • understands http:// and links it automatically! ( good for the lazy me!)
    • can link/insert pictures ( from a folder with relative links )
    • can automatically backup before saving (version control-simplified. beware of the size!)
    • options of adding plugins (c.f. Open-source)
    • options to sync online and with mobile (Android,..)

Simply put, it has recently become my (minimalistic yet powerful – easily-expandable) personal (nonlinear) Wiki in a single file. (I am a fan of Wikipedia! – right now I am only a reader though). This allows me to seamlessly integrate my pieces together and get organized .

And whats more, as I am getting used to the different tags and symbols, I know that I am getting closer to being able to seamlessly contribute to work /contribute to Wikipedia which I always wanted (I like the idea that the sum of human0knowledge must be available to everyone for free)

A collection of my Academic blogs n links

http://www.technologyreview.in/ (MIT’s technology review)

http://biocurious.com/

http://www.symmetrymagazine.org/

Does one have to be a genius to do maths?

http://love-python.blogspot.com/

http://calnewport.com/blog/

http://college.alltop.com/

http://chrisguillebeau.com/3×5/articles/

http://nanopolitan.blogspot.com/search/label/Free%20stuff

http://twitter.com/sciam

http://www.blogger.com/profile/01044958813811039891

About