Skip to content

Instantly share code, notes, and snippets.

View sanikkenway's full-sized avatar
💻
rails new unicorn

Nik Saiful Anuar sanikkenway

💻
rails new unicorn
View GitHub Profile
@sanikkenway
sanikkenway / readme.md
Created September 24, 2023 08:58
Postgres Setup Ubuntu with Remote Connection

Installing Postgres

In this step, you will be installing Postgres on your server. The first thing to do is SSH into your server by running:

ssh user@ip

Next, update your server packages and dependencies by running:

sudo apt update
<?php
function kaprekar_constant($number)
{
$constant = 6174;
if (strlen((string)$number) == 3) {
$constant = 495;
}
do {
@sanikkenway
sanikkenway / metabase_deploy.md
Last active February 14, 2022 05:16
Metabase Deploy

Prerequisites

  • A server running Ubuntu 18.04 and above
  • Domain name dedicated for Metabase.

Step 1: Install Java

Once you have completed your instance or server setup you can proceed to install Java 8.

Execute the following command to install OpenJDK 8.

@sanikkenway
sanikkenway / README.md
Created December 30, 2021 08:24
Jitsi Deployment

*** Don't forget to change "jitsi.example.com" to your domain name ***

  1. Configure hostname. 1.1 Change the hostname to your domain name. sudo hostnamectl set-hostname jitsi.example.com 1.2 Add this line to /etc/hosts sudo nano /etc/hosts 127.0.0.1 jitsi.example.com

  2. Configure firewall.

@sanikkenway
sanikkenway / Optional.md
Last active November 19, 2021 04:12
Gitea Setup

Configuring Email Notifications

If you want your Gitea instance to send notification emails, you can either install Postfix or use some transactional mail service such as SendGrid, MailChimp, MailGun, or SES.

To enable email notifications, open the configuration file and edit the following lines:

sudo nano /etc/gitea/app.ini
[mailer]
@sanikkenway
sanikkenway / README.md
Last active November 19, 2021 03:37
Allow Remote Access to MySQL

Update Mysql Config

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Change from 127.0.0.1 to 0.0.0.0

. . .
lc-messages-dir = /usr/share/mysql
skip-external-locking
@sanikkenway
sanikkenway / README.md
Last active December 1, 2021 06:24
MinIO Setup

Setup MinIO on Ubuntu 20.04 LTS with Let's Encrypt SSL

Download Link for Go!

https://golang.org/dl/

Install Go

wget -c https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
$models = \Model::withTrashed()->get();
foreach ($models as $model) {
if (\Str::contains($model->name, ' ')) {
echo $model->id.',';
}
}
def sop_kerajaan_gagal
abang_jamil = true
lockdown = 0
while abang_jamil do
lockdown += 1
initiate_lockdown(lockdown)
end
def surviving_covid19
alive = true
while alive do
wear_mask
aware_distance(1) # in meter
wash_hands
if covid_symptom || close_contact('positive')