Search This Blog

Thursday, 13 October 2016

GCC and G++ -4.8 installation in Ubuntu 12.04

Version of gcc, for 12.04, is 4.8.1 and is available in the toolchain PPA.

Adding the toolchain/test PPA:

To add the PPA to your system, open a terminal(Ctrl+Alt+t) and run the following commands:

sudo apt-get install python-software-properties  sudo add-apt-repository ppa:ubuntu-toolchain-r/test  sudo apt-get update  sudo apt-get install gcc-4.8 g++-4.8  sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50  
If you need gcc-4.8 on 12.04 now, your only option is to build it from source.

Please read the GCC installation FAQ prior to installation.

You can download gcc-4.8 from one of gnu.org's mirror sites or directly from their SVN server.

Here is an example of steps to compile from source (see here for additional details.) Note that these may vary depending on your system and preferences.

  1. Download the source code

  2. Install some additional libraries (sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev libc6-dev)

  3. Compile the source: ./gcc-4.8.0/configure --prefix=/app/gcc/4.8.0
  4. Run make (This will take some time to complete. Go make some coffee, or bake some cookies. ;-))
  5. Install the code: sudo make install

Once this process has completed, run the command gcc --version to verify that the installation has completed successfully. You should see something similar to the following output:

getmefollks@kickyou:~$ gcc --version  gcc (Linaro 4.8.0) 4.8.0  Copyright (C) 2013 Free Software Foundation, Inc.  This is free software; see the source for copying conditions.  There is NO  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
​

Wednesday, 12 October 2016

USB Keyboard and Mouse not working in Ubuntu Desktop Version.

Reinstall input device drivers
sudo apt-get install xserver-xorg-input-all

sudo apt-get update


Oracle user creation script

1) Enable the script execution:

Alter session set "_ORACLE_SCRIPT"=true;

2) User creation script with required privileges:

create user TestUser identified by TestUser;
grant connect , resource to TestUser ;
grant query rewrite to TestUser ;
grant create table to TestUser ;
grant create procedure to TestUser ;
grant create sequence to TestUser ;
grant create synonym to TestUser ;
grant create trigger to TestUser ;
grant create type to TestUser ;
grant create view to TestUser ;

grant connect, resource, create view, create public synonym to TestUser
with admin option;


grant alter any role, alter any sequence, alter any table, alter tablespace,
alter any trigger, comment any table, create any sequence, create any table,
create any trigger, create role, create tablespace, create user, drop any
sequence, drop any table, drop any trigger, drop tablespace, drop user, drop
any role, grant any role, insert any table, select any table, update any
table to TestUser;




Sunday, 9 October 2016

Install the Team Foundation Server Plug-in for Eclipse

​After making sure your computer meets all the prerequisites, you're ready to install the plug-in.

To install the plug-in

  1. Open Eclipse.

  2. On the Help menu, choose Install New Software.

    The Install dialog box appears.

    Install Team Explorer Everywhere

    The install wizard looks slightly different for different versions of Eclipse.

  3. Choose Add.

    The Add Repository dialog box appears.

    Add site
  4. In Name, enter TFS Plugin for Eclipse.

  5. In Location, enter http://dl.microsoft.com/eclipse/tfs, and then choose OK.

  6. In the list of features in the Install dialog box, select the check box that corresponds to Team Explorer Everywhere, and then choose Next two times.

    Available Software
    Note Note

    Make sure to clear Contact all update sites during install to find required software if you just want to install Team Explorer Everywhere at this time.

  7. Accept the Microsoft Software License Terms, and then choose Finish.

    Review licenses
  8. Restart Eclipse when prompted.

​

Tuesday, 4 October 2016

How to change default text editor in Linux


​sudo update-alternatives --config editor

Note:NANO is the default text editor. Prefer to have vim.
For example:

There are 4 choices for the alternative editor (providing /usr/bin/editor).

  Selection    Path                Priority   Status
------------------------------------------------------------
  0            /bin/nano                   40        auto mode
  1            /bin/ed                    -100        manual mode
  2            /bin/nano                   40        manual mode
* 3            /usr/bin/vim.basic     30         manual mode
  4            /usr/bin/vim.tiny       10         manual mode

Press <enter> to keep the current choice[*], or type selection number: ​

How to clear Linux buffer and cache space

If you ever want to empty it you can use this chain of commands.

[root@test ~]# free -m && sync && echo 3 > /proc/sys/vm/drop_caches && free -m
total used free shared buffers cached
Mem: 5855 4469 1385 0 21 952
-/+ buffers/cache: 3495 2360
Swap: 4095 50 4045
total used free shared buffers cached
Mem: 5855 4412 1442 0 0 917
-/+ buffers/cache: 3493 2361
Swap: 4095 50 4045

You can signal the Linux Kernel to drop various aspects of cached items by changing the numeric argument to the above command.

  • To free pagecache:

    # echo 1 > /proc/sys/vm/drop_caches  
  • To free dentries and inodes:

    # echo 2 > /proc/sys/vm/drop_caches  
  • To free pagecache, dentries and inodes:

    # echo 3 > /proc/sys/vm/drop_caches  

Non root users run with Sudo:

$ sudo sh -c 'echo 1 >/proc/sys/vm/drop_caches'  $ sudo sh -c 'echo 2 >/proc/sys/vm/drop_caches'  $ sudo sh -c 'echo 3 >/proc/sys/vm/drop_caches'  

NOTE: There's a more esoteric version of the above command if you're into that:

$ echo "echo 1 > /proc/sys/vm/drop_caches" | sudo sh  

Why the change in syntax? The /bin/echo program is running as root, because of sudo, but the shell that's redirecting echo's output to the root-only file is still running as you. Your current shell does the redirection before sudo starts.

Monday, 3 October 2016

Openssl-0.9.8 for SAP HANA

​(1) Download openssl-0.9.8 source code from here, and uncompress it.

(2) To build dynamic library, you should add shared option when configuring:

./config shared  make  make install_sw  

(3) Because the default installation directory is /usr/local/ssl, to let SAP HANA find the openssl library, you should add/usr/local/ssl/lib into /etc/ld.so.conf file:

# cat /etc/ld.so.conf  /usr/local/ssl/lib  /usr/local/lib64  /usr/local/lib  include /etc/ld.so.conf.d/*.conf  # /lib64, /lib, /usr/lib64 and /usr/lib gets added  # automatically by ldconfig after parsing this file.  # So, they do not need to be listed.  

Then execute ldconfig command:

# ldconfig  

It is OK for installing SAP HANA now.