Skip to content

Instantly share code, notes, and snippets.

Avatar

Çetin ARDAL kral2

View GitHub Profile
@kral2
kral2 / add_oci_user_api_key.tf
Last active Mar 8, 2020
Generate RSA key pair in pem format, then add it as OCI API key to specified user using Terraform
View add_oci_user_api_key.tf
/*
Last update : March, 2020
Author: cetin.ardal
Description: Add OCI API key to specified user.
*/
# OCI Home Region
provider "oci" {
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
@kral2
kral2 / add_oci_user_api_key.sh
Last active Mar 8, 2020
Generate RSA key for OCI API usage and upload it to specified user.
View add_oci_user_api_key.sh
#!/bin/sh
# Last update : March, 2020
# Author: cetin.ardal
# Description: Generate RSA key for OCI API usage and upload it to specified user.
COLOR_TITLE="\033[32m" # green
COLOR_TITLE1="\033[91m" # light red
COLOR_NORMAL="\033[39m"
@kral2
kral2 / fn-cli_autoconfig.sh
Last active Feb 27, 2020
This script auto-configure your OCI Cloud Shell Fn CLI context.
View fn-cli_autoconfig.sh
#!/bin/sh
# Last update : February, 2020
# Author: cetin.ardal@oracle.com
#
# This script auto-configure your Fn CLI context on OCI Cloud Shell.
# 1. On OCI Console, create an OCIR repository named like your tenant
# 2. Then just run this one-liner at the Cloud Shell prompt:
#
# sh <( curl -L http://xxx.xxx/xxxxxx )
@kral2
kral2 / custom-image.json
Last active Jul 24, 2019
sample Packer file with variable file for oracle-oci builder
View custom-image.json
{
"variables": {
"tenancy_ocid": "null",
"compartment_ocid": "null",
"user_ocid": "null",
"fingerprint": "null",
"key_file": "null",
"region": "null",
"base_image_ocid": "null",
"image_name": "null",
@kral2
kral2 / send-myip-gmail.ps1
Created Oct 18, 2014
Get IPv4 and mail it with gmail in powershell
View send-myip-gmail.ps1
# Quick powershell script to :
# Get the IPv4 and send it using gmail smtp server. Handy when there is no local SMTP server available
# !! Warning !! You need to provide your credentials in plain text ...
$date = (get-date).ToString()
# Get IPv4. Quick filter with -like "1*" to exclude IPv6. There should be a better way to do it ...
$IP = Get-WmiObject -Class Win32_NetworkAdapterConfiguration -filter "ipenabled=true" |
Where { $_.IPAddress -like "1*"} |
Select -ExpandProperty IPAddress | select -First 1
You can’t perform that action at this time.