Skip to main content

Posts

Showing posts from 2017

Create HTML pages using python and open automatically on execution.

This process of creation of HTML pages using python is similar to process of creation of any other file. To automatically open the pages after execution, we will use selenium webdriver. Following are the steps: 1. Open any text editor and create a python file with .py extension. 2. Import selenium packages. (Make sure you download them first.) For downloading on Ubuntu, use these commands in terminal: $ sudo apt-get install python-pip $ sudo pip install selenium Import: from selenium import webdriver 3. Write the following to create HTML file on execution. f = open ( ' helloworld.html ' , ' w ' ) 4. In order to write in this file, use the following code: f.write( """ <!DOCTYPE HTML> < html > < header > < title > This is title </ title > </ header > < body > Hello world </ body > </ html > """) 5. Close command : f.close() 6. Use the

Fix for eclipse oxygen icon not displaying in ubuntu.

There is a bug in the latest version of eclipse IDE. The icon is not displayed. If you are facing the same problem then I might have a fix for you. There are various reasons why this may occur. One of the problems is caused because icon of eclipse is not present in pixmaps folder. To add it simply copy the icon of eclipse into /use/share/pixmaps folder. Note: You need to have root access to do that.  Also, make sure the name of the icon is eclipse.xpm  For this, use the terminal to fire the command: sudo cp /eclipse_path/icon.xpm /usr/share/pixmaps/eclipse.xpm Here replace the eclipse_path with your eclipse folder path. E.g. /home/leena/eclipse/java-oxygen/eclipse/icon.xpm

Fix 'UNEXPECTED INCONSISTENCY; Run fsck manually' on Ubuntu

If you have the following Ubuntu error, I might have a fix for it. fsck from util-linux 2.26.2 /dev/sda1 contains a file system with errors, check forced. /dev/sda1: Inodes that were part of a corrupted orphan linked list found. /dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.         (i.e., without -a or -p options) fsck exited with status code 4 The root filesystem on /dev/sda1 requires a manual fsck Busybox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built in shell (ash) Enter 'help' for a list of built-in commands. (initramfs) _ And believe me help command does nothing. Solution: Just fire a simple command to execute  fsck manually. fsck /dev/sda1 If some other filesystem is causing the error then mention that name after fsck. It will show some processing. If it asks any questions like Fix(y/n)? always enter y . In the end when (initramfs) reappears enter: reboot Well, that's all! It worked for me. Hope it works for you.

Install MongoDB on Ubuntu with these easy steps

Various methods are available online to install and use MongoDB on Ubuntu. However following are the least steps one can use to achieve this purpose. Steps: 1. Open the terminal and type: sudo apt-get install mongodb Enter password. 2. Copy paste:  sudo apt-get update 3. Start mongodb service. Type: sudo service mongodb start 4. Open mongodb. mongo 5. Use mongo commands. Let's start with: show dbs 6. Exit mongo. exit 7. After using, it is recommended that we stop the service. For this, type: sudo service mongodb stop

How to add buttons and its functionality dynamically using HTML,MySQL and PHP?

There are times when we wish to add button dynamically in a webpage based on the entries in the database. If that is true in your case, please read on. (This guide assumes you have the basic knowledge of HTML, PHP and MySQL.) Following are the steps one will need to apply to create buttons dynamically: 1. Use PHP to connect to the database. <?php  $db = mysqli_connect('localhost','root','','media') //root is the username and no password.  or die('Error connecting to MySQL server.'); ?> Here, 'media' is the database name and it is running on WAMP. 2. Use a while loop to fetch contents from the database.     For each entry add a Button.   <form method="POST">  <?php $query = "SELECT * FROM post"; mysqli_query($db, $query) or die('Error querying database.'); $result = mysqli_query($db, $query); while ($row = mysqli_fetch_array($result)) { $varid=$row['postID

How to access Wamp (Apache) server from mobile?

WAMP is by default configured to permit access to only the machine on which it is running. So if you try to access it from your mobile or any other device on the network it will give you the following error : “Forbidden You don't have permission to access /phpmyadmin/ on this server.”     To solve this you need to grant permission. For that follow the following steps: 1. Click on the WAMP icon. 2. Click on Apache. 3. Open httpd-vhosts.conf 4. Change 'Require local' to 'Require all granted'. 5. Restart your server. Remember, when the server and the client are not the same device, you cannot access via localhost. You need the IP address of the device. For that follow the following steps: 1. Open Command Prompt. 2. Type ipconfig. 3. Read the IPv4 address under the Wireless LAN adapter Wi-Fi. 4. Use this address to access the files from the mobile browser. (Make sure you are connected to the same wireless network.) Example: 192.168.1.5/temp/index.