Skip to content

Instantly share code, notes, and snippets.

View virbo's full-sized avatar
💭
I may be slow to respond.

Yusuf Ayuba virbo

💭
I may be slow to respond.
View GitHub Profile
@virbo
virbo / proxy.inc
Last active October 24, 2023 03:14
Nginx Reverse Proxy for PDDIKTI Feeder (Linux version)
# More info here: http://wiki.nginx.org/HttpProxyModule
# Source from Centos Web Panel
proxy_buffering off;
proxy_connect_timeout 59s;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_buffer_size 64k;
proxy_buffers 16 32k;
proxy_busy_buffers_size 64k;
@virbo
virbo / yii-queue.service
Created May 27, 2019 05:07
Yii Queue Service Daemond
# Service worker Yii Queue
# Artikel: https://dutainformasi.net/2019/05/22/implementasi-yii2-queue
# Guide: https://github.com/yiisoft/yii-queue/blob/master/docs/guide/worker.md
# Author Yusuf Ayuba
[Unit]
Description=Yii Queue Worker
After=network.target
# Enable the following two lines only apply if your queue backend is mysql
# replace this with the service that powers your backend
#!/bin/bash
# Backup database postgres (SIAKAD AKPER Luwuk)
# Author Yusuf Ayuba (hello@yusufayuba.net)
# inisial variabel
tgl=$(date +'%H:%M:%S_%d-%m-%Y')
username=<username database>
dbname=<db name>
folderBackup=<folder temporary backup>
fileBackup="backup_"$tgl".sql.gz"
@virbo
virbo / group-objects-by-property.md
Created March 28, 2019 05:32 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group Array of JavaScript Objects by Key or Property Value

Implementation

const groupBy = key => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = obj[key];
    objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
    return objectsByKeyValue;
@virbo
virbo / reactnative.md
Last active February 22, 2020 04:42
Change Display Name and Package Name in React Native

Delete Folder android and ios

$ rm -rf android
$ rm -rf ios

Change name in app.json and package.json for change package name

app.json

"name": "dutainformasi.siakad",
@virbo
virbo / emulator.md
Last active February 7, 2019 12:34
Running emulator Android from CLI

Running emulator Android from CLI

change to home android

$ cd ${ANDROID_HOME}/emulator

list AVD

$ ./emulator -list-avds
# Add these three lines to CORSify your server for everyone.
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
@virbo
virbo / configuration.h
Last active December 13, 2018 14:59
Configuration File v3D Printer for Marlin Firmware
/**
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@virbo
virbo / host-react-app-on-apache-server.md
Created May 31, 2018 02:36 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@virbo
virbo / http2.md
Last active April 19, 2018 15:27
Enable http2 on CWP

source: https://www.mysterydata.com/how-to-enable-http-2-on-cwp7-centos-web-panel/

HTTP/2 will make our applications faster, simpler, and more robust — a rare combination — by allowing us to undo many of the HTTP/1.1 workarounds previously done within our applications and address these concerns within the transport layer itself. Even better, it also opens up a number of entirely new opportunities to optimize our applications and improve performance!

[link]How to Enable IPv6 on CWP Centos WebPanel[/link]

[link]Apache HTTP to HTTPS htaccess redirect on CWP – Centos WebPanel[/link]

The primary goals for HTTP/2 are to reduce latency by enabling full request and response multiplexing, minimize protocol overhead via efficient compression of HTTP header fields, and add support for request prioritization and server push. To implement these requirements, there is a large supporting cast of other protocol enhancements, such as new flow control, error handling, and upgrade mechanisms, but these are the most importan