Friday, March 14, 2014

Ubuntu: Change default location of localhost

localhost
By default, localhost (127.0.0.1) points to /var/www/ directory in Ubuntu. I prefer the location to be in my home directory.
To change the default location, open the file:
/etc/apache2/sites-available/000-default.conf
 and change it to look as follows:
(My wokspace is located at /home/chaithanya/www)

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/chaithanya/www

        <Directory /home/chaithanya/www/>
                Options Indexes FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
        ErrorLog /var/log/apache2/error.log
        CustomLog /var/log/apache2/access.log common
</VirtualHost> 
Note: This works for Ubuntu 13.10+

Tuesday, March 4, 2014

Ubuntu: Install with video drivers disabled

Ubuntu: Install with video drivers disabled
When I tried to install Ubuntu 12.04 on my PC, it halted with 4/5 dots under Ubuntu. It's stuck at that point and no progress. Sometimes you may see some distorted image or white screen. All these problems are due to incompatible video drivers.

To get pass behind this screen and boot into the system, hold down SHIFT button while booting from CD/USB and press F6. Now select "nomodeset" option to prevent video drivers from loading.

Now you can install Ubuntu successfully. But you may face the problem again while booting (after installation). Then boot in "Recovery Mode" and install graphics drivers from GRUB menu or command line.

Monday, March 3, 2014

Ubuntu: rSync without git subdirectory

Ubuntu: rSync without git subdirectory
Previously I blogged about a good backup/sync tool rSync.

While using it, I faced some problems. It replaced my .git repository and there by affected my git repo settings.
I found a way to exclude sync'ing some files/folders. For this we have to use --exclude option. To exclude git sub-directory:
rsync -a --exclude='.git/'
 And to include some specific files, (Eg: 'c' files)
rsync -a --include='*.c/'

Source

Sunday, March 2, 2014

Ubuntu: Access a usb flash drive from the terminal

Access a usb flash drive from the terminal

 

 

1. Find what the drive is called

You'll need to know what the drive is called to mount it. To do that fire off:
sudo fdisk -l
You're looking for a partition that should look something like: /dev/sdb1. Remember what it's called.

2. Create a mount point

Create a new directory in /media so you can mount the drive onto the filesystem:
sudo  mkdir /media/usb

3. Mount!

sudo mount /dev/sdb1 /media/usb
When you're done, just fire off:
sudo umount /media/usb


Source: StackOverflow