Posts

Showing posts from September, 2019

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&