Skip to content

Instantly share code, notes, and snippets.

View kral2's full-sized avatar
☁️

Çetin ARDAL kral2

☁️
View GitHub Profile
@kral2
kral2 / add_oci_user_api_key.tf
Last active March 8, 2020 01:53
Generate RSA key pair in pem format, then add it as OCI API key to specified user using Terraform
/*
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 March 8, 2020 01:52
Generate RSA key for OCI API usage and upload it to specified user.
#!/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 February 27, 2020 20:28
This script auto-configure your OCI Cloud Shell Fn CLI context.
#!/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 July 24, 2019 00:10
sample Packer file with variable file for oracle-oci builder
{
"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 October 18, 2014 16:43
Get IPv4 and mail it with gmail in powershell
# 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