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 / 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

@virbo
virbo / install-composer.sh
Last active October 1, 2019 12:58
Install Composer on CWP (Centos 7)
#!/bin/bash
# Install Composer on Centos, Ubuntu, Debian
# Author Yusuf Ayuba
user_allow="root"
if [ "$(whoami)" != $user_allow ]; then
echo "==================================================================="
echo " Installasi gagal. Install composer harus menggunakan user: "$user_allow" ="
echo "==================================================================="
@virbo
virbo / remote_postgres.sh
Last active April 14, 2018 01:03
Step by step configuration postgres form remote open (Server Centos 7)
Path to pgsql config: /var/lib/pgsql/data
PART 1 (edit postgresql.conf)
1. Edit postgresql.conf where
#listen_addresses = 'localhost'
change to
listen_addresses = '*'
2. Edit postgresql.conf where
@virbo
virbo / pdo-pgsql.sh
Last active February 28, 2018 13:54
Enable pdo_pgsql php7.1.13 on Centos Web Panel
#!/bin/bash
# Enable pdo_pgsql on Centos Web Panel with PHP 7.1.13
# Author Yusuf Ayuba
# inisial variabel
tgl=$(date +'%H:%M:%S_%d-%m-%Y')
pathIni=/usr/local/php
fileBackup=$tgl"_php.ini"
if [ -e "/usr/local/lib/php/extensions/no-debug-non-zts-20160303/pdo_pgsql.so" ]; then
@virbo
virbo / pdo_pgsql.c
Created February 28, 2018 03:10
Install pdo_pgsql in CWP
1. Download file binary PHP dari http://php.net/downloads.php (sesuaikan dengan versi php yang digunakan)
2. Extract file tersebut, kemudian masuk ke folder ext/pdo_pgsql
3. konfigurasi kembali php dengan perintah
~~
phpize
./configure --with-pdo-pgsql
make && make install
~~
4. restart apache
5. pdo_pgsql telah aktif
@virbo
virbo / LC_CTYPE.txt
Created February 21, 2018 03:10 — forked from jampajeen/LC_CTYPE.txt
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@virbo
virbo / php_upgrade_to_71.sh
Last active January 21, 2018 13:33 — forked from pixeline/php_upgrade_to_71.sh
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick php71-pdo-pgsql
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@virbo
virbo / ws_insert.php
Last active December 3, 2017 04:37
WSFeeder insert mahasiswa dan riwayat pendidikan
<?php
public function actionInsert()
{
$rec = [
'nama_mahasiswa' => 'Yusuf Ayuba',
'jenis_kelamin' => 'L',
'tempat_lahir' => 'Tanobonunungan',
'tanggal_lahir' => '1980-08-23',
'id_agama' => 1,
return [
'class' => 'yii\db\Connection',
'dsn' => 'pgsql:host=localhost;dbname=test',
'username' => 'user_database',
'password' => 'password_database',
'charset' => 'utf8',
];
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
io.on('connection', function(socket){
console.log('new client connected');
socket.on('disconnet', function(){
console.log('a client disconnect');
})
socket.on('notif',function(msg){