Skip to content

Instantly share code, notes, and snippets.

View ihsanbudiman's full-sized avatar

Moh Ihsan Budiman ihsanbudiman

View GitHub Profile
for _, row := range data {
for idx2, row2 := range row {
row2map := row2.(map[string]any)
cell, _ := excelize.CoordinatesToCellName(activeCol, activeRow)
f.SetCellValue("Sheet1", cell, idx2)
# Update all your packages
sudo apt update
sudo apt upgrade -y
# Add postgresql repository and key
sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
# Update again

Install and Configure Postgresql

The Nautilus application development team has shared that they are planning to deploy one newly developed application on Nautilus infra in Stratos DC. The application uses PostgreSQL database, so as a pre-requisite we need to set up PostgreSQL database server as per requirements shared below:

a. Install and configure PostgreSQL database on Nautilus database server.

b. Create a database user kodekloud_rin and set its password to TmPcZjtRQx.

c. Create a database kodekloud_db10 and grant full permissions to user kodekloud_rin on this database.

d. Make appropriate settings to allow all local clients (local socket connections) to connect to the kodekloud_db10 database through kodekloud_rin user using md5 method (Please do not try to encrypt password with md5sum).

e. At the end its good to test the db connection using these new credentials from root user or server's sudo user.

Click on ✔ and Do Task Again

Solution:

@ihsanbudiman
ihsanbudiman / openclosed.go
Created February 2, 2022 09:57
openclosed in golang
package main
import (
"fmt"
"math"
)
type BangunDatar interface {
Luas() float64
}
@ihsanbudiman
ihsanbudiman / openclosed.go
Created February 2, 2022 09:52
openclosed in golang
type BangunDatar interface {
Luas() float64
}
type Persegi struct {
Sisi float64
}
func (p Persegi) Luas() float64 {
return p.Sisi * p.Sisi
@ihsanbudiman
ihsanbudiman / openclosed.go
Created February 2, 2022 09:41
openclosed in go
type Persegi struct {
Sisi float64
}
type Segitiga struct {
Alas float64
Tinggi float64
}
type Kalkulator struct{}
@ihsanbudiman
ihsanbudiman / main.js
Created January 9, 2022 07:16
looping data yang mempunyai detail
const { performance } = require("perf_hooks");
// biasanya ini terjadi di website POS dimana
// ada laporan yang harus group sesuai master nya
// lalu keluarin detailnya
// ========= start fill data master + detail ============
const masters = [];
const details = [];
function post_data()
{
// ini seperti biasa kalian juga kalo engga menggunakan AJAX pake cara ini
// perhatikan $this->input->post('username'); username tersebut adalah data dari input yang name nya "username"
// sama juga dengan input lainnya
$username = $this->input->post('username');
$password = $this->input->post('password');
$config = [
[
<!-- kalian bebas kasih id apa aja -->
<!-- tapi utuk memudahkan sekarang kita kasih id form -->
<form id="form">
<input type="text" placeholder="username" name="username" id="username">
<!-- biar ada jarak aja sih jadi pake br-->
<br>
<div class="check_username"></div>
<br><br>
@ihsanbudiman
ihsanbudiman / Controller_kalian.php
Last active May 18, 2021 13:39
Tutorial Post data CodeIgniter menggunakan Jquery Ajax
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Controller_kalian extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->library('form_validation');
}