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 / job.rb
Last active February 3, 2019 12:12
if dev.is_bored? || job.sucks?
Job::search(:flexible_hours true, :company_culture 100)
end
<?php
$photoid = <photoid>;
$alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
// function to encode from photoid to shortcode
function base_encode($photoid, $alphabet)
{
$base_count = strlen($alphabet);
$encoded = '';
@sanikkenway
sanikkenway / default
Created April 27, 2021 00:29
Nginx Server Block With PHP-FPM
server {
listen 80;
root /var/www/html;
index index.php;
server_name example.com;
location / {
try_files $uri $uri/ =404;
}
def surviving_covid19
alive = true
while alive do
wear_mask
aware_distance(1) # in meter
wash_hands
if covid_symptom || close_contact('positive')
def sop_kerajaan_gagal
abang_jamil = true
lockdown = 0
while abang_jamil do
lockdown += 1
initiate_lockdown(lockdown)
end
$models = \Model::withTrashed()->get();
foreach ($models as $model) {
if (\Str::contains($model->name, ' ')) {
echo $model->id.',';
}
}
@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 / 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 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
@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.