Get driving or straight line distance between coordinates

To get straight line distance:

http://www.movable-type.co.uk/scripts/latlong.html

To get driving distance:

http://www.travelmath.com/drive-distance/

21. August 2014 by Basri MY
Categories: General | Leave a comment

Ubuntu – how to enable root account

By default the root has no password and may not be used to login.

In order to enable it:

sudo passwd root

It will ask for the administrative password.

Then will ask for new root password.

To disable back:

sudo passwd -l root

Ref: http://askubuntu.com/questions/44418/how-to-enable-root-login

21. August 2014 by Basri MY
Categories: Linux | Leave a comment

Ubuntu – no wireless LAN interface

After installing Ubuntu on my old HP netbook, I found that the wi-fi interface is not auto configured.

Later I knew that it was due to the outdated driver.

Run this line:

sudo apt-get update; sudo apt-get install bcmwl-kernel-source

21. August 2014 by Basri MY
Categories: Linux | Leave a comment

Ubuntu – add name servers to host

/etc/network/interfaces

iface eth0 inet static
address 172.24.111.49
netmask 255.255.255.0
broadcast 172.24.111.255
dns-nameservers 8.8.8.8

19. August 2014 by Basri MY
Categories: Linux | Leave a comment

Ubuntu – add existing user to existing group

usermod -g www-data jerry

Ref: http://www.cyberciti.biz/faq/ubuntu-add-user-to-group/

19. August 2014 by Basri MY
Categories: Linux | Leave a comment

Download a file and save to path

To do it in PHP:

$f = file_get_contents($url);
file_put_contents($path_to_new_file, $f);

19. August 2014 by Basri MY
Categories: PHP | Leave a comment

Ubuntu – add new user from command line

sudo useradd -d /home/testuser -m testuser
sudo passwd testuser

11. August 2014 by Basri MY
Categories: Linux | 3 comments

Webmin – add new website

Most of the example I found showing how to add new domains. But I just want to add new websites.

Example:

I already setup LAMP on 10.10.10.5, and now http://10.10.10.5 is reachable.

How do I create http://10.10.10.5/intra1 and http://10.10.10.5/intra2 ??

This is based on try and error, with my not-so-much exposure to Linux.

1. Login to webmin.
2. Click Servers > Apache Webserver
3. On Existing Virtual Hosts, click Virtual Server icon
4. Click on Alis & Redirects
5. From: /intra1 To: /home/user1/htdocs (you must add user with home and then create htdocs or whatever folder in the home)
6. Click save
7. Back to Servers > Apache Webserver > Existing Virtual Hosts > Virtual Server
8. Check Create Per-Directory, Files or Location Options
7. Type: Directory Regexp: Exact match Path: /home/user1/htdocs, click Save
8. Back to Servers > Apache Webserver > Existing Virtual Hosts > Virtual Server
9. Click Edit Directive
10. Under put “Require all granted” (without double quote).

Done!

11. August 2014 by Basri MY
Categories: Linux | Leave a comment

vsftpd: connection timed out

Add these lines to /etc/vsftpd/vsftpd.conf

pasv_enable=YES
pasv_min_port=11000
pasv_max_port=11010

service vsftpd restart

Ref: http://forums.fedoraforum.org/showthread.php?t=97374

11. August 2014 by Basri MY
Categories: Linux | Leave a comment

vsftpd: refusing to run with writable root inside chroot ()

chmod a-w /home/user

Ref: https://www.benscobie.com/fixing-500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/

11. August 2014 by Basri MY
Categories: Linux | Leave a comment

← Older posts