Fix : No sound on Ubuntu (16.04) after a Bluetooth audio device power off.

Problem : After Bluetooth speakers were abruptly switched off, Ubuntu 16.04 on Alienware (17 R2) stopped producing sounds on its analog sound card.

Reason : Doubt an inviable configuration was left behind for the sound card.

Solution :

  • Open terminal
  • Run –
    killall pulseaudio; rm -r ~/.config/pulse/* ; rm -r ~/.pulse*
  • Wait for 10 seconds.
  • Reboot the machine. (Fully power off and then boot)
  • This should fix the problem, else look into the reference link below.

Reference : https://help.ubuntu.com/community/SoundTroubleshootingProcedure

Installing NetBeans IDE in Linux

 

Go to the link – https://netbeans.org/downloads/
Select Platform as Linux(x86/x64).

Download the installer for NetBeans.

Net1

 
From the terminal, navigate to the directory that contains the installer (netbeans-8.1-linux.sh)

 
Run the following command to change the permissions –
$ chmod +x netbeans-8.1-linux.sh

Start the installer using the command –
$ ./netbeans-8.1-linux.sh

Follow the steps and NetBeans would be installed.

Opening Folder in same Window in Linux

 

Its quite frustrating sometimes to have a situation in which whenever you open a new folder, a new window is opened to display its contents.

Problem

 

Follow the steps to open the folder in the same window –
Go to Edit -> Preferences -> Behaviour

Problem2
Select the check-box – (Always open in browser windows)

Problem3
Apply the changes.

AngularJS

 

angular-js

AngularJS is a Javascript framework maintained by Google which simplifies the development and testing of web applications for developers and testers.

Core features –

1. MVC Framework –

Model is data. It can be static data or dynamically fetched from a data source using JSON.
View – This is UI (User Interface) or whatever is visible in the browser.
Controller – Controls the business logic of the application.

2. Two-way Data Binding –

It simply means that –
1. When properties in the model get updated, so does the UI.
2. When UI elements get updated, the changes get propagated back to the model.

3. Templates –

It allows you to create templates which can be used in other HTML pages.

4. Single Page Applications –

It simply points to the fact that navigation between different screens of the website is achieved without loading a different web-page in the browser.

Example – GMAIL – When you click on a message in your INBOX, browser stays on the same web-page, but JavaScript code hides the INBOX and brings the MESSAGE BODY on screen.

Installing Oracle Database XE in Linux

To install Oracle Database XE:

1. Log on to your computer with root permissions.

2. Go to the following Web site:
http://www.oracle.com/technetwork/database/express-edition/downloads/index.html

3. Accept License Agreement and download the Linux version of Oracle Database XE.

4. Run the Oracle Database XE executable oracle-xe-11.2.0-1.0.x86_64.rpm to install Oracle Database XE using the command –
# rpm -ivh downloads/oracle-xe-11.2.0-1.0.x86_64.rpm

The installation displays a status of its progress.

5. When prompted, run the following command –
# /etc/init.d/oracle-xe configure

6. Enter the following configuration information –
A valid HTTP port for the Oracle Application Express (the default is 8080)
A valid port for the Oracle database listener (the default is 1521)
A password for the SYS and SYSTEM administrative user accounts
Confirm password for SYS and SYSTEM administrative user accounts
Whether you want the database to start automatically when the computer starts (next reboot)

This completes configuration.

Changing the default port of HTTP Preview Server of Eclipse

 

Problem –

When HTTP Preview Server is started after adding the project and the following error pops up –

error

 

Solution –

  • Go to your workspace directory.
  • Unhide all the hidden files and folders if using Linux.
  • Open the folder .metadata -> .plugins -> org.eclipse.wst.server.core.
  • Open file severs.xml.
  • Add attribute port=”XXXX” to tag server with id=”HTTP Preview at localhost” where XXXX is the new port number.
  • Restart Eclipse.

 

 

 

ERROR:The processing instruction target matching “[xX][mM][lL]” is not allowed

This error is very common while parsing any XML(Extensible MarkUp Language) string or file.

Solutions-

1. Make sure the XML file starts with <?xml version=”1.0″ encoding=”utf-8″?>. There should no leading spaces or blank characters before “<?xml…”.

2. Make sure that at the end, there should no new line or blank characters after the closing tag.

Example of ideal XML file –

<?xml version=”1.0″ encoding=”utf-8″?>
<STUDENT>
<NAME>Saurabh Garg</NAME>
<AGE />
<PROFESSION>Blogger</PROFESSION>
</STUDENT>

Using Database Link in Oracle

Suppose data from a table X in database D is to be copied into table Y in the same database, then the problem can be solved easily by executing the query –

Assumption

X(C(1),C(2),C(3)….C(N)) == Y(C(1),C(2),C(3)….C(N)) where C(1),C(2),etc. denote the columns of the table.

INSERT INTO Y SELECT * FROM X;
COMMIT;

Problem –

Data from a table X in database D1 has to be copied to table Y in database D2.

Assumption –

X(C(1),C(2),C(3)….C(N)) == Y(C(1),C(2),C(3)….C(N)) where C(1),C(2),etc. denote the columns of the table.

Workaround –

Oracle SQL Developer allows you to create INSERT query for each record in the table. The queries generated can be executed in database D2. But, suppose the table contains 2,00,000 records, it would take approximately 30 minutes to generate the INSERT script and almost an hour to execute the script.

Solution –

Login as SYSDBA(Database Administrator) using the query –

CONNECT SYS/ AS SYSDBA;

Allow the user to create database links using the query –

GRANT CREATE DATABASE LINK TO <userSchemaName(D2 in this case)>;

Connect to schema D2 and execute the query –

CREATE DATABASE LINK DATABASE_LINK_NAME CONNECT TO “SCHEMA_NAME(D1 IN THIS CASE)” IDENTIFIED BY “”
USING ‘(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = HOST_NAME)(PORT = XXXX))(CONNECT_DATA = (SERVICE_NAME = ##SERVICE_NAME##)))’;

Execute the query –

INSERT INTO Y
SELCT * FROM X@DATABASE_LINK_NAME;
COMMIT;

Add Desktop Shortcut in Ubuntu

 

ubuntuhero

Here’s how to create a desktop shortcut in Ubuntu –

  1. Go to the location of the file you want to access from Desktop (using the file explorer).
  2. Right click => Make Link
  3. Right click newly created link file => Click Move to..
  4. Select Desktop as the location in the target selection dialog box.