Posts

Showing posts from 2024

AWS using Ansible? Yes, it's possible!

  Although, I've used Ansible extensively for a lot of automation and orchestration tasks, using Ansible for AWS was indeed, a new territory for me.  This turned out to be a blessing, since along with using Ansible for AWS tasks, I also learnt how to use WSL (Windows Subsystem for Linux) on a Windows machine. Though WSL's been around for some time, I still hadn't come around to using it since I was mostly using my Macbook pro. Not anymore, though!  Anyway, I have listed below the steps to: Install WSL on Windows 11 23H2 patch Install AWS CLI on Ubuntu 22.04 (Exact version - 22.04.3 LTS) Install Ansible and the amazon.aws collection Use AWS CLI to get the list of  VPCs in the region - us-east-1 (or a region of your choice) Create a python file/script to get the list of VPCs in the region - us-east-1 (or a region of your choice) Create an Ansible playbook to get the list of VPCs in the region - us-east-1 (or a region of your choice.   You may download the comple...

AWS using Ansible? Yes, it's possible!

  Although, I've used Ansible extensively for a lot of automation and orchestration tasks, using Ansible for AWS was indeed, a new territory for me.  This turned out to be a blessing, since along with using Ansible for AWS tasks, I also learnt how to use WSL (Windows Subsystem for Linux) on a Windows machine. Though WSL's been around for some time, I still hadn't come around to using it since I was mostly using my Macbook pro. Not anymore, though!  Anyway, I have listed below the steps to: Install WSL on Windows 11 23H2 patch Install AWS CLI on Ubuntu 22.04 (Exact version - 22.04.3 LTS) Install Ansible and the amazon.aws collection Use AWS CLI to get the list of  VPCs in the region - us-east-1 (or a region of your choice) Create a python file/script to get the list of VPCs in the region - us-east-1 (or a region of your choice) Create an Ansible playbook to get the list of VPCs in the region - us-east-1 (or a region of your choice.   You may download the comple...

Fetch Languages and Platforms from MOS Patch Search using WGET

 As promised, I am back to blogging with the script to fetch the languages and platforms and their codes used during patch search/download in My Oracle Support (MOS). This script, again, uses the wget command in order to fetch this data and of course, needs one's MOS' username and password (that gets saved in a wgetrc file) as inputs. You may download the script from git. Here's the usage and the output: $ ./Fetch_Languages_And_Platforms_From_MOS_Patch_Search.sh The executable 'wget' is indeed available in the PATH variable. Proceeding further..... Enter your MOS Username: username@example.com Enter you password: 537P - Acme Packet 1100 529P - Acme Packet 3820 540P - Acme Packet 3900 561P - Acme Packet 3950 530P - Acme Packet 4500 538P - Acme Packet 4600 560P - Acme Packet 4900 534P - Acme Packet 6100 531P - Acme Packet 6300 551P - Acme Packet 6350 527P - Acme Packet OS 512P - Apple iOS 293P - Apple Mac OS X (Intel) (32-bit) 522P - Apple Mac OS X (Intel...

Automate MOS Patch Downloads using WGET

Recently, I was searching for a way to completely automate the process of MOS patch downloads when I stumbled upon this blog post - a very well written blog explaining the intricacies of automating patch download from MOS using CURL. This set me thinking if it could be done using WGET command instead of CURL and I found out that it can, indeed, be done. Though the blog post that I have referenced offers a completely automated solution, it uses CURL command beacuse CURL comes installed, by default, with most of the Linux based Docker images, while wget doesn't. Most of the other blog posts that describe patch download using wget, rely on manual authentication with MOS or manually fetching the download URL from MOS. However, I present to you a completely automated way of My Oracle Support Patch Downloads using wget. NOTE: I have assumed the OS to be Linux x86-64 bit and accordingly, hard-coded the platform ID as 226P ( plat_lang=226P ). I plan to publish another blog post det...

From unique values of first column, get all the values of the 2nd column and print them in the same line by separating them with commas

The what: I have a file as below: $ cat sample.csv DEPT_ID,EMP_NAME 100,Keshava 100,Madhava 100,Narayana 100,Govinda 100,Vishnu 110,Madhusudana 110,Trivikrama 110,Vamana 110,Shridhara 110,Hrishikesha 110,Padmanabha 120,Damodara 120,Sankashana 120,Vasudeva 120,Pradyumna 130,Aniruddha 130,Purushottama 130,Adhokshaja 130,Narasimha 140,Achyuta 140,Janardana 140,Upendra 140,Hari 140,Krishna  The challenge is to make it look like below: $ cat sample.csv DEPT_ID: EMP_NAME (SEPARATED BY COMMA) 100: Keshava, Madhava, Narayana, Govinda, Vishnu 110: Madhusudana, Trivikrama, Vamana, Shridhara, Hrishikesha, Padmanabha 120: Damodara, Sankashana, Vasudeva, Pradyumna, Aniruddha 130: Purushottama, Adhokshaja, Narasimha 140: Achyuta, Janardana, Upendra, Hari, Krishna The How: Method 1 - Using pure shell commands tail -n +2 sample.csv | cut -d "," -f1 | sort -u | while read dept_id; do emp_names=$(grep "${dept_id}" sample.csv | cut -d "," -f2 | tr '\n' ...

Popular posts from this blog

Check if UTL_FILE and FND_FILE are working fine

Modify retention period of workflow queues

Clone database home (clone.pl) deprecated in Oracle 19c