Posts

Showing posts from 2020

PowerShell to find hyperlink text in word or pdf

In continuation to my previous article on PowerShell to find hyperlink texts in ppt , here I am going to show how to find hyperlinks in Word or PDF files. Sample code below, tweak it for your purpose and drop me a comment if you need help. $FilePath= "C:\Users\xxx\"  $OurDocuments = Get-ChildItem -Path "$FilePath" -Filter "*.pdf" -Recurse #change to .doc* for word $Word = New-Object -ComObject word.application $Word.Visible = $false $i = 0 $OurDocuments | ForEach-Object { try {     $Document = $Word.Documents.Open($_.FullName,$false,$true)      #"Processing file: {0}" -f $Document.FullName          try{     $Document.Hyperlinks | ForEach-Object {         if ($_.Address -like "https://domain.com*" -or $_.Text -like "https://domain.com*")          {                 "Found issues {0} `r`n" -f $Document.Fullname       ...

Installing MariaDB-Server on Ubuntu using sudo

This article demonstrate steps to install MariaDB/MySQL on Ubuntu using sudo. This is part of our getting started journey to learn MariaDB/MySQL. I will be covering PostgreSQL in another article. Before we get started, very first step would be to install MariaDB/MySQL Server and client. You can install any of these RDBMS on Windows but this blog will mostly be following Ubuntu OS. There are various tools to access MariaDB/MySQL Server, we are going to use mysqlclient and Heidisql. Lets get started with installation of MariaDB. Step 1: Open your Ubuntu terminal window or bash and run following cmd. This step is going to check if mariadb-server is already installed and is going to remove it. You can either continue using the current setup or go to next step to do a fresh installation sudo apt-get remove mariadb-server Step 2: run sudo apt-get install software-properties-common Step 3: Check for Ubuntu updates sudo apt-get updates Step 4: Install Ubuntu updates sudo ...

PostgreSQL PSQL Commands

To connect to postgresql using psql, update port, dbname, user and your_password in cmd below psql "host=localhost port=5432 dbname={your_database} user=user password={your_password} sslmode=require" To import data dump from .sql file using psql, use following cmd psql > \i 'path-to-dump.sql' Having single quote around the path is important else you may see C:: permission denied error. If using sudo  sudo -u postgres psql db_name < 'file_path' Create user  postgres=# create user user_name password 'password'; Create database  postgres=# create database mydb owner user_name ; Install PostgreSQL Client on Ubuntu bash:=# apt install postgresql-client- ; To Quit bash:=# \q ; Help bash:=# \h ; To describe attributes of a table. bash:=# \d tablename ; To get list of databases. bash:=# \l ; To connect to a database. bash:=# \c databasename ; To list all details of a database. bash:=# \z or select * from pg_tables where s...

Drop database in Oracle

Steps to drop a container database in oracle Step 1 : Connect to the database as sysdba bash#$ sqlplus / as sysdba Step 2 : Shutdown the database SQL> shutdown immediate; Step 3 : Start mount the database with exclusive restrict to avoid the database being opened SQL> startup mount exclusive restrict; Step 4 : Drop database SQL> drop database;