Skip to content

Instantly share code, notes, and snippets.

View dodyagung's full-sized avatar
🏠
Working from home

Dody dodyagung

🏠
Working from home
View GitHub Profile
@dodyagung
dodyagung / daemon.json
Created March 4, 2020 08:56
Could you specifically explain how I would configure the Docker Daemon to only use the 172.*.0.0/16 network ranges in /etc/docker/daemon.json?
# cat /etc/docker/daemon.json
{
"default-address-pools":
[
{"base":"172.17.0.0/16","size":24}
]
}
@dodyagung
dodyagung / Handler.php
Last active March 3, 2018 17:25
Lumen 5.6 Exception Render in JSON
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\HttpException;
Add this to your http {} of the nginx.conf file normally located at /etc/nginx/nginx.conf:
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
Then add this to your php location block, this will be located in your vhost file look for the block that begins with location ~ .php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
@dodyagung
dodyagung / .htaccess
Created September 4, 2017 08:24
laravel 5.4 openlitespeed rewrite rules
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
@dodyagung
dodyagung / How Do I Start Oracle Service in UNIX or Linux?
Created December 5, 2016 04:00
How Do I Start Oracle Service in UNIX or Linux?
---- Copied from https://www.cyberciti.biz/faq/how-do-i-start-oracle-service-in-unix/ ----
How To Startup Oracle Database on a Unix/Linux
Use the su - username command to login as oracle user. Open the Terminal or login using ssh and type the following command to login
$ su - oracle
Start Oracle server in UNIX/Linux
Now, use the lsnrctl command to start service (usually located at /home/oracle/oracle/product/10.2.0/db_1/bin directory):
$ lsnrctl start
ANDROID_HOME C:\Program Files\Android\android-sdk
ANT_HOME D:\Apps\apache-ant-1.9.4
JAVA_HOME C:\Program Files\Java\jdk1.7.0_71
PATH C:\Users\Dody\AppData\Roaming\npm;
%ANT_HOME%\bin;
%ANDROID_HOME%/tools;
%ANDROID_HOME%/platform-tools
@dodyagung
dodyagung / PHP weekdays
Created October 16, 2014 07:37
PHP weekdays
<?php
$now = date('j F Y');
echo 'now = ' . $now . '<br />';
$mod = strtotime($now . " + 10 weekdays");
echo 'next 10 weekdays = ' . date('j F Y', $mod);
?>
@dodyagung
dodyagung / Install PHP-FPM + APC on Centos 6.5
Last active August 29, 2015 14:05
Install PHP-FPM + APC on Centos 6.5
rpm -Uvh http://kartolo.sby.datautama.net.id/EPEL/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update
yum install php-fpm php-mysql php-pecl-apc php-mcrypt --enablerepo=remi,epel
vi /etc/php.ini
cgi.fix_pathinfo=0
@dodyagung
dodyagung / Install MySQL 5.5 on Centos 6.5
Created September 1, 2014 17:10
Install MySQL 5.5 on Centos 6.5
rpm -Uvh http://kartolo.sby.datautama.net.id/EPEL/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update
yum install mysql mysql-server
service mysqld start
/usr/bin/mysql_secure_installation
@dodyagung
dodyagung / Install Varnish 3.0.5 on Centos 6.5
Last active August 29, 2015 14:05
Install Varnish 3.0.5 on Centos 6.5
rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-3.0.el6.rpm
yum update
yum install varnish
chkconfig --levels 235 varnish on
service varnish restart