Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Saturday, November 17, 2018

Rewrite URLs or Enable with mod_rewrite for Apache2 on Ubuntu 16.04

In this POST I will show how to enable mod_rewrite for apache2

First, we need to install  Apache2, Before that Update Ubuntu with below command.

sudo apt-get update

Install Apache

sudo apt-get install apache2

Now activate mod_rewrite using below command

Sunday, July 15, 2018

error unknown filesystem entering rescue mode grub rescue ubuntu

In this POST I will show how to get rid of

error: unknown filesystem.
Entering rescue mode...
grub rescue
Switch on the System, wait untill you get the Grub Rescue Screen.
Type the following commands



  • ls
  • It will display list of partions you had in your system.
    You will get something like this (hd0),(hd0,msdos1)(hd0,msdos2)(hd0,msdos3) based on no of partitions

  • set prefix= (hd0,msdos1)/boot/grub
  • If it’s not the root drive you will get an error message "unknown filesystem". In that case try the same command with the next partion.
    You need to find which drive is Ubuntu root. For that type the following:
    Ex: set prefix=(hd0,msdos2)/boot/grub
  • set prefix=(hd0,msdos1)/boot/grub
  • insmod normal
  • normal
  • sudo update-grub
  • sudo grub-install /dev/sda

  • If you are not getting an error: You can proceed to the next command after that:
    Your PC will now boot successfully. Now select Ubuntu & login.
    Open Terminal( Ctr+Alt+T or use the search)
    Now the bootloader error is fixed you should be able to boot your System normally & even your data is intact.

    Tuesday, December 12, 2017

    How to create a file, write, read and append to file in python

    In the post I will show how to create a File, Write, read and append in python.

    Before that lets see the File Modes in Python


    File Modes in Python
    Mode
    Description
    'r'
    Open a file for reading. (by default)
    'w'
    Open a file for writing. Creates a new file if it does not exist or deleates the file if it exists.
    'x'
    Open a file for exclusive creation. If the file already exists, the operation fails.
    'a'
    Open for appending at the end of the file without replacing it. Creates a new file if it does not exist.
    't'
    Open in text mode. (by default)
    'b'
    Open in binary mode.
    '+'
    Open a file for updating (reading and writing)


    Saturday, July 1, 2017

    How to set up your user account to Hibernate on critical battery level in Ubuntu

    In this post I will show how to hibernate Ubuntu on critical battery level.
    In the previous posts I had shown How to...
    Set critical battery percentage using the command in terminal
    
    gsettings get org.gnome.settings-daemon.plugins.power percentage-critical
    
    
    To modify this value, set to 20% by using the below command in the terminal

    How can I hibernate on Ubuntu 16.04?

    In this post I will show how to Enable Hibernate in Ubuntu.

    In the previous posts I had shown How to...
    OutPut:

    Sunday, June 11, 2017

    How to create cron job in ubuntu

    In this POST I will show how to create a cron job in Ubuntu. For this we will use python script to print current date and time in log file.

    In the previous posts I had shown How to....
    OutPut:

    2017-06-10 21:35:01.655477
    2017-06-10 21:36:01.686346
    2017-06-10 21:37:01.711900
    2017-06-10 21:38:01.740353
    2017-06-10 21:39:01.767497
    2017-06-10 21:40:01.792622
    2017-06-10 21:41:01.823149

    Saturday, June 10, 2017

    How To Install WordPress, Apache, MySQL and PHP on Ubuntu 16.04

    In this post I will show, how to install WordPress, Apache, MySQL and PHP on Ubuntu 16.04.

    Install Apache:

    When you’re done installing Apache2, the below commands allow you to start it up
    
    sudo apt-get update
    sudo apt-get install apache2
    
    sudo systemctl start apache2
             OR
    sudo service apache2 start
    

    Failed to start mongod.service unit mongod.service not found. ubuntu 16.04

    In this post I will show you how to resolve Failed to start mongod.service unit mongod.service not found.

    Previously I had shown how to install MongoDB on Ubuntu & Windows

    First Open Terminal and enter the below command.
    
    sudo vim /etc/systemd/system/mongodb.service
    
    Now it should look as shown below.























    How to Install MongoDB on Ubuntu 16.04

    In this post I will show how to Install MongoDB on Ubuntu 16.04.
    Previously I had shown how to install MongoDB on Windows

    Execute the following commands in the terminal one by one

    Wednesday, May 24, 2017

    Reset MySQL root password in Ubuntu

    In this POST I will show how to reset MySQL Server root password in Ubuntu

    In the previous posts I had shown how to .....

    Use the following steps to reset a MySQL root password by using the command line interface in Linux.
    Stop the MySQL service
      
    
    sudo /etc/init.d/mysql stop
    
    
    Start MySQL without a password