TLDR;
NSW Open Data Trip Planner API is a convenient API which provides loads of data related to New South Wales. It can be used to plan journeys from one place to another. (Ex : How to get from Central Station to Burwood city center, which trains buses/trains/ferried should I take to accomplish that, and when will those vehicles arrive)
Author Archives: Ishan Thilina Somasiri
Fixing “Authentication is needed to run /usr/bin/dropbox as the super user” error in Linux
Following is a screenshot of the problem.
Fixing this problem is easy. Find where your dropbox executable is using the following command.
which dropbox
In my case it is /bin/dropbox. Open the file as root using a text editor. Then find the following lines.
PARENT_DIR = os.path.expanduser("/var/lib/dropbox") DROPBOXD_PATH = "%s/.dropbox-dist/dropboxd" % PARENT_DIR
You’ll notice that DROPBOXD_PATH is incorrect due to PARENT_DIR pointing to an invalid dropbox installation location. Now all you have to is to point PARENT_DIR to the correct place. Since my dropbox installation is in ~/.dropbox-dist/ and I am the only user in the system using dropbox, I edited the entry as follows. Edit the entry as it suits for you.
PARENT_DIR = os.path.expanduser("~")
Now save the file and try running the dropbox start -i using your user account (not root). It will work without any problems.
A Comprehensive Guide To Run Yii Framework On XAMPP In Linux
Yii is professional PHP framework best for developing Web 2.0 applications. This guide elaborates on how to set up the Yii framework in XAMPP under a Linux environment.
First you need to download and install XAMPP as indicated in the XAMPP guide in http://www.apachefriends.org/en/xampp-linux.html. Then you need to get write permissions to the /opt/lampp/htdocs folder (where all the websites will be stored). First look at who is owning /opt/lampp/htdocs .
ls -ld /opt/lampp/htdocs
This should return something like
drwxr-xr-x. 5 root root 4096 Dec 22 22:55 /opt/lampp/htdocs
drwxr-xr-x. denotes the file permissions of the folder. The part root root specifies the owner of the directory and the owning group of the directory. Let’s first change the owning group of the folder. Let’s create a group called www and change the group ownership of the folder to www.
sudo groupadd www sudo chgrp -R www /opt/lampp/htdocs
Now a ls -ld should return something like the following
drwxr-xr-x. 5 root www 4096 Dec 22 22:55 /opt/lampp/htdocs
Now the XAMPP server should be configured to run using the group www. Open the /opt/lampp/etc/httpd.conf file.
sudo vim /opt/lampp/etc/httpd.conf
Then find the entry,
User daemon Group daemon
(yours might be slightly different). Change the User entry to your user name and Group entry to www. Now you need to set the permissions of the /opt/lampp/htdocs folder.
sudo chmod 2775 /opt/lampp/htdocs usermod -aG www
You’ll need to logout and log in to the system since group memberships are read at login time. But before doing that, let’s carry out another task that will require a logout. We need to add PHP to our PATH. So open your .bashrc as follows.
vim /home/.bashrc
Then add the following lines to the end of that file.
##Adds XAMPP bin to PATH export PATH=/opt/lampp/bin:$PATH
Now logout and login. Then extract the Yii framework to a folder named yii in the /opt/lampp/htdocs folder, start the XAMPP server and go to the address http://localhost/yii/requirements/index.php to check whether Yii is working. Then to create a Yii application, follow the following commands. I have used the test name blog.
cd /opt/lampp/htdocs/ php ./yii/framework/yiic webapp blog
After completing the creation, visit http://localhost/blog/ to verify the functionality of the created Yii application…!.
References :
- http://superuser.com/questions/268987/cant-create-any-folder-in-htdocs-on-ubuntu
- http://stackoverflow.com/questions/14318699/xampp-virtual-host-access-denied
- http://www.yiiframework.com/forum/index.php/topic/1838-install-yii-on-xampp-on-linux/page__p__10296__hl__yii+linux+in+tallation#entry10296
- http://www.yiiframework.com/doc/blog/1.1/en/start.testdrive