Posts

Showing posts from 2019

Attaching a second VNIC card to compute in OCI

Image
Well, just under 30 days ago, Oracle announced a series of resources you can use in OCI for free. One thing that had stopped me signing up and trying out OCI in the past was that I wanted to make the best use of the free credits, and knowing I wouldn't get a full chance to try things out in the 30 days, I didn't want to sign up prematurely. Now that they offer some free resources, this prompted me to sign up. I am now at the end of the 30-day period where I have some credits to use non-free resources. One final thing I wanted to try out was attaching multiple VNIC (Virtual network interface card) to a single compute instance. One use-case of these is that you may want a machine accessible in 2 different networks. It's not just a matter of attaching it in the OCI console - to bring the interface up you have to perform a couple of extra steps. When I was first trying this, I didn't read the docs and figured I would just have to edit the interface config script and bri

OCI: Logging Object Events with the Streaming Service

Image
There are two functionalities in OCI that we can leverage in order to support logging - Streaming and Events service. With the events service we can define on which events to match whereby you specify a service name and the corresponding event types. So for object storage, we log events based on create, update and delete:  The next part is that we can define the action type, with three possible options: Streaming Notifications Functions For this article, we are looking into Streaming. So, the first step is to go ahead and make a stream. Nothing too complex here, just go to the Analytics, Streaming menu in the console, and create a new stream. When you create it, you specify a retention policy where it's defaulted to 24 hours. SO I will leave it at the default. Actually, I'm leaving it all at the default. The next step is that we need to define an IAM policy so that cloud events can leverage this streaming functionality. So, head over to IAM and create a new poli

Setting up a simple web server on OCI

Image
Did you miss the news? Oracle has announced that a free tier for usage of OCI which includes 2 compute instances, 2 autonomous databases, among a set of other free resources up to a certain limit. This tier isn't going to be suitable for high performance workloads, but hey, it's a pretty good deal I think. if you've been following my activity, you will notice I've been starting to do a bit more with OCI, and for me, what better time to have an actual play around. In this post, starting from a completely clean slate (no Virtual networks, no compute instances, etc), I wanted to see how I go about setting up an accessible web server. I opted to try with Ubuntu, since that is my daily driver so I'll just be consistent. So, head over to the console and navigate to the compute section: Once there, click the Create Instance button. You will see that it has by default selected Oracle Linux. So, let's see what else is available by clicking the Change Image So

Saving git credentials when pushing to a remote

When you want to push changes upstream, git will prompt for your login details. To ease pushing changes, you may want to avoid doing this each and every time. Last time I set this up I followed this steps detailed on AskUbuntu . This answer basically details the steps to: 1. Install the package libgnome-keyring-dev 2. Compile some files that git provides 3. Updating your Git config to use this compiled code Just reviewing that to set up a new instance, this method is actually deprecated now since it's steps specific to gnome. Actually, the steps are very much the same, with one underlying change - the package you install in the first step. More detail on StackOverflow , but basically the steps to set this up: sudo apt install libsecret-1-0 libsecret-1-dev cd /usr/share/doc/git/contrib/credential/libsecret sudo make git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret That's all there is to it! Now when yo

Correctly classifying PL/SQL source code on GitHub

Image
GitHub provides an engine that classifies source code that takes into account various factors, so may not always get it right. When it comes to relational database development, a common file extension would be .sql. However, with many different relational databases, it can be hard to determine which is the correct RDBMS the code relates to. A case in point is a repository I came across, has the following classifications: However, I happen to know in this scenario all source code directly relates to an Oracle database and such I believe all should be classified as PL/SQL. So, how can we solve this dilemma for accurate reporting? The engine for determining the language is under the package linguist . Within that repository there is a section Override which explains how you can override the chosen language very easily. As it explains, create a file in the root of your repository if you don't already have one, .gitattributes, and specify the linguist-language property

Get OCI compartment ID by name from bash

Image
If you work with Oracle Cloud, it stands to reason you probably want some tooling around it to simplify your regular tasks. You have the option of using a client library with your programming language of choice, or you can use the command line client and have some bash scripts for your regular tasks. One common argument you will need in performing some tasks is the compartment ID. For this we can run the command: "oci iam compartment list --all". This will give us a JSON list of all the compartments: { "data": [ { "compartment-id": "ocid1.tenancy.oc1..xxxxx", "defined-tags": {}, "description": "Compartment for Foo", "freeform-tags": {}, "id": "ocid1.compartment.oc1..xxxxx", "inactive-status": null, "is-accessible": null, "lifecycle-state": "ACTIVE", "name"

Installing Oracle Instant Client on Ubuntu

Now that Oracle has enabled us to download instant client without any click through for accepting the license , I wanted to revisit a seamless install of the instant client on a new set up. Ubuntu has the documentation about installing the instant client here: https://help.ubuntu.com/community/Oracle%20Instant%20Client. First - because Oracle provides their releases in RPM archive format (or a tarball), in order to have an installer you need to create a DEB archive. There is a package in the archives, alien, which aids this process. This gives the start of the script: #!/bin/bash # Install dependencies sudo apt install alien The 3 packages the Ubuntu documentation tells us to retrieve are: - devel - basic (I opt for basiclite instead) - sqlplus So, over at the downloads page: https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html we can grab the link. # Download files. Example specific to 19.3 # Some links were not correct on the do

Testing software targeting Ubuntu with multipass

Image
If you a regular reader of my blog, you're probably across the fact that my primary system is Ubuntu (Linux). When developing, we test our software to make sure everything is working as expected - especially if we want other users to install it, you may have some software installed on your system that other users don't have. So it's a good idea to test in a "clean" environment. One strategy is with Docker - you can just boot up a docker container and run your scripts: docker run -it ubuntu:latest This will put you in a new shell where you can begin trying out your software, or install instructions to make sure there's nothing missing. Docker however is not the purpose of this article - so on to multipass. Mutlipass is a tool to fire up instances of Ubuntu - it's the technology that snapcraft uses when building snaps. The GitHub repo for the projects describes it best: Multipass is a lightweight VM manager for Linux, Windows and macOS. It&

Consuming node packages from the GitHub registry service

Image
Recently I was using GitHub, and I noticed at the top of the page a new button/number combo, used by. So, that was interesting - it's showing how many repositories are using a particular node package. Today, I was scrolling through by Twitter feed and I saw a JavaScript develop posting that he's using the GitHub package registry service for his packages moving forward, and not so much the npm registry service. That GitHub had a registry service was news to be, so I was curious to see how one would use packages stored there rather than on npm. It's worth pointing out, that this service currently seems to be in the beta phase, but here is the page that describes the new offering: https://github.com/features/package-registry . Within GitHub itself, if you navigate to an Organisation or User profile, you will spot a new tab "Packages". A simple search on GitHub reveals there are currently 125 npm packages on the GitHub registry service. So,

Oracle Cloud Infrastructure command line client and object storage

Image
Yesterday I blogged about a Google Drive client, and 2 years back a blogged about a custom workflow I was using to push and pull file(s) from/to Google Drive on Linux. I recently got access to Oracle Cloud Infrastructure so thought doing an equivalent task might be a good way to get my toes wet. As with most of the cloud infrastructure platforms available, Oracle provides us with a command line tool we can use. This project source code is open sourced (under UPL 1.0 and Apache 2.0) and hosted over on GitHub . Christoph Ruepprich has previously blogged about this tool, but I wanted to go through it myself - so a lot of this information may be redundant if you already followed along with his blog post . For my test case, I wanted to test in an isolated environment so I went ahead and pulled the latest ubuntu release using Docker: docker pull ubuntu:latest Then I enter that environment by running: docker run -it ubuntu:latest This will bring me to a shell prompt with root ac

Updating my CLI Google Drive Client

Image
A couple of year back I blogged about a custom Google Drive workflow . The tool I'm using I recently noticed is facing some issues - when trying to pull the file I am presented with the following: The problem seems to be that this tool is using a single API key/secret amongst all users - and with the popularity of this tool it's exceeding the daily usage limit each day. The product seems to be not actively maintained for a while now - so back to the drawing board. There is another popular tool on GitHub, which supports overriding the API credentials used based on some environment variables. This tool is aptly called "drive" - and the project is found here: https://github.com/odeke-em/drive Per the documentation, you can set up your own API client credentials to use with this tool to avoid the possibility of any usage limit violations (assuming it's just for personal use, it's unlikely you would exceed these): > Optionally set the GOOGLE_API_CLIEN

Why is my date format not staying in uppercase?

Image
In my application, I have my date format defined as "DD-MON-YYYY". In my page, I have defined a default date as `sysdate`. So my date renders with the current date, and everything looks good: However, as soon as I change the date, the month name is not persisting to be in all caps, per: So, what is going on here? If we look at the HTML node for selecting another date, we can see it runs the following code: $.datepicker._selectDay( id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this ); In the latest APEX, we can view the source for this call in: https://static.oracle.com/cdn/apex/18.2.0.00.12/libraries/jquery-ui/1.12.0/jquery-ui-apex.js?v=18.2.0.00.12 This in turn makes a call to: this._selectDate( id, this._formatDate( inst, inst.currentDay, inst.currentMonth, inst.currentYear ) ); Which in turn returns by: return this.formatDate

Personal Project Activity Stream on JIRA

Image
I wanted to show my personal activity within JIRA - sometimes it's tricky to find tickets but that you know you recently commented on one, so an activity stream can be a way to do this. I know that if on my project view, I click the project icon: I get taken to a page that will show an activity stream. This however shows all activity on all tickets on the project, not just for the current user. I also know that I can go to my user profile I can get an activity stream just for my account, but this will show activity across all projects. A better approach I would say is to create a dashboard. From your main menu, select Dashboard -> Manage Dashboards. At the top right, you will see a button to create a new dashboard - click that button. Now that you have the dashboard created, once you navigate to it you will see a blank slate that you can add gadgets to. Gadgets are little components to present data to the viewer, whether that be graphs, data grids or acti