Friday, March 23, 2018

Configure OpenVPN + PIA CLI on Redhat/Centos 7

Configure OpenVPN + PIA CLI on CentOS 7
(Source : http://web.archive.org/web/20160517121855/http://blog.jordan-english.com:80/configure-openvpn-pia-cli-on-centos-7/ )


login as root or sudo

# yum install epel-release
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install openvpn unzip curl wget easy-rsa

Configure OpenVPN
cd /etc/openvpn
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip
unzip openvpn.zip
vi /etc/openvpn/cred.conf

#supply the following two lines and write/quit (this is supplied by PIA)
[username]
[password]

chown root:root /etc/openvpn/cred.conf
chmod 400 /etc/openvpn/cred.conf
ln -s /etc/openvpn/[PIA-Region-config].ovpn /etc/openvpn/server.conf

vi [PIA-Region-config].ovpn
#add the following lines
auth-user-pass cred.conf
auth-nocache

#create a backup of the DNS config
cp /etc/resolv.conf /etc/resolv.conf.orig

#edit DNS config
vi /etc/resolv.conf
#add the following lines
nameserver 209.222.18.222
nameserver 209.222.18.218

#reset the security context - SELinux labels
restorecon -Rv /etc/openvpn/


#enable OpenVPN to start on boot
systemctl enable openvpn@server.service
#start OpenVPN service
systemctl start openvpn@server.service
#check status of OpenVPN service
systemctl status openvpn@server.service
#check your new IP address - verify with another workstation
curl ipecho.net/plain ; echo

#reboot and check again
systemctl reboot
systemctl status openvpn@server.service
Here is my output from systemctl status openvpn@server.service

 openvpn@server.service - OpenVPN Robust And Highly Flexible Tunneling Application On server
   Loaded: loaded (/usr/lib/systemd/system/openvpn@.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-03-23 15:56:25 PDT; 16s ago
 Main PID: 10784 (openvpn)
   Status: "Initialization Sequence Completed"
   CGroup: /system.slice/system-openvpn.slice/openvpn@server.service
           └─10784 /usr/sbin/openvpn --cd /etc/openvpn/ --config server.conf

Mar 23 15:56:25 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:25 2018 T...
Mar 23 15:56:25 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:25 2018 U...
Mar 23 15:56:25 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:25 2018 U...
Mar 23 15:56:25 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:25 2018 [...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 a...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 T...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 d...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 /...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 /...
Mar 23 15:56:26 zareason.raka.home openvpn[10784]: Fri Mar 23 15:56:26 2018 I...
Hint: Some lines were ellipsized, use -l to show in full.
[root@zareason openvpn]# 


systemctl status openvpn@server.service

You can also check the tunnel that OpenVPN opened

ifconfig tun0

Friday, March 9, 2018

sudo pacman -S archlinux-keyring  && sudo pacman -Syu

Tuesday, February 13, 2018

getting hardware information on Linux

cat /sys/devices/virtual/dmi/id/product_name

/sys/devices/virtual/dmi/id/sys_vendor

sudo lshw
sudo lshw -short

cat /proc/cpuinfo
cat /proc/meminfo


Friday, February 9, 2018

connecting pdb user to oracle 12c gives error ORA-01033

If you connect to a user in a PDB and u get error ORA-01033

and following query returns MOUNTED

SELECT name, open_mode FROM v$pdbs;

then we need to open it in read write mode and save state so that it would survive a shutdown.



sqlplus / as sysdba

SELECT name, open_mode FROM v$pdbs;


alter pluggable database PDBORCL open read write;


alter pluggable database all save state;



Oracle 12c: ORA-65096: invalid common user or role name

SQL> create user rakesh identified by rakesh;
create user rakesh identified by rakesh
            *
ERROR at line 1:
ORA-65096: invalid common user or role name


Fix;

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> select PDB from V$services;

PDB
------------------------------
PDBORCL
CDB$ROOT
CDB$ROOT
CDB$ROOT
CDB$ROOT

SQL> alter session set container=PDBORCL;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDBORCL
SQL> create user rakesh identified by rakesh;
create user rakesh identified by rakesh
                                 *
ERROR at line 1:
ORA-01109: database not open


SQL> alter database open;

Database altered.

SQL> create user rakesh identified by rakesh;

User created.


SQL> GRANT CONNECT, RESOURCE, DBA TO rakesh;

Grant succeeded.

SQL>

Saturday, January 20, 2018

Arch Linux - Installing packages from AUR repository

goto https://aur.archlinux.org/

goto Packages tab

select your package to install

copy the git clone url ( copy link location)


Now
open terminal window
cd to Downloads folder

for eg to install google chrome

git clone https://aur.archlinux.org/google-chrome.git


now cd to the directory created

cd google-chrome

makepkg -s
(makes package from the git source files)

(All above commands to be run as regular user)

sudo pacman -U   google-chrome-63.0.3239.132-1-x86_64.pkg.tar.xz
(google-chrome-63.0.3239.132-1-x86_64.pkg.tar.xz was created by the prev command)


thats all. :)

Saturday, January 13, 2018

getting ins_ctx.mk error - Oracle 11g R2 install on centos 7

The information below solved the problem:

 

Source :

https://www.davemalpass.com/oracle-database-11g-install-on-centos-7/

 

Oracle Database 11g install on Centos 7

Problem encountered when installing Oracle 11g on Centos 7

Google suggested this was a fairly common problem with machines with a newer GLIBC. Most of the suggested solutions didn’t work for me (writing a glib memcpy shim etc). Instead I was able to statically link this executable against the glibc archive which didn’t have the problem with the missing memcpy@GLIBC reference.
yum install glibc-static.x86_64
yum install glibc-static.i686
vi /u01/app/oracle/product/11.2.0/dbhome_2/ctx/lib/ins_ctx.mk
ctxhx: $(CTXHXOBJ)
-static $(LINK_CTXHX) $(CTXHXOBJ) $(INSO_LINK) /usr/lib64/stdc.a
I additionally had to patch the the ins_emagent.mk to link to the libnnz11 library:
vi /u01/app/oracle/product/11.2.0/dbhome_2/sysman/lib/ins_emagent.mk
Search for the line
$(MK_EMAGENT_NMECTL)
Change it to:
$(MK_EMAGENT_NMECTL) -lnnz11
Then press the Retry button and it should install correctly!

——
ALTER SYSTEM SET PROCESSES=500 SCOPE=SPFILE;
ALTER SYSTEM SET OPEN_CURSORS=500 SCOPE=SPFILE;

Followers

About Me

Torrance, CA, United States