Skip to content

Instantly share code, notes, and snippets.

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

Yoga Hanggara yohangdev

🏠
Working from home
View GitHub Profile
@yohangdev
yohangdev / php.ini
Last active July 23, 2018 15:11
PHP FPM Hardening php.ini
upload_tmp_dir = "/var/php_tmp"
session.save_path = "/var/lib/php/sessions"
open_basedir = "/var/www:/var/lib/php/sessions:/var/php_tmp"
file_uploads = Off
allow_url_fopen = Off
disable_functions = "php_uname, getmyuid, getmypid, passthru, leak, listen, diskfreespace, tmpfile, link, ignore_user_abord, shell_exec, dl, set_time_limit, exec, system, highlight_file, source, show_source, fpaththru, virtual, posix_ctermid, posix_getcwd, posix_getegid, posix_geteuid, posix_getgid, posix_getgrgid, posix_getgrnam, posix_getgroups, posix_getlogin, posix_getpgid, posix_getpgrp, posix_getpid, posix, _getppid, posix_getpwnam, posix_getpwuid, posix_getrlimit, posix_getsid, posix_getuid, posix_isatty, posix_kill, posix_mkfifo, posix_setegid, posix_seteuid, posix_setgid, posix_setpgid, posix_setsid, posix_setuid, posix_times, posix_ttyname, posix_uname, proc_open, proc_close, proc_get_status, proc_nice, proc_terminate, phpinfo"
expose_php = Off
error_reporting = E_ALL
display_error = Off
display_startup_errors = Off
@yohangdev
yohangdev / rsync.sh
Last active June 6, 2017 00:35
Rsync Snippets Collections
rsync -vr --delete --include '/dir/***' --exclude='*' $(mktemp -d)/ [email protected]:/module/path/to/
rsync --list-only username@servername:/directoryname/
@yohangdev
yohangdev / mikrotik-ip-cloud-updater.txt
Created May 29, 2017 02:31
Mikrotik IP Cloud Updater
#get mynetname hostname
:local hostname [/ip cloud get dns-name]
#resolve current dns-address
:local resolvedIP [:resolve "$hostname"]
#get current external IP
:local resolver [:resolve resolver1.opendns.com]
:local currentIP [:resolve myip.opendns.com server=$resolver]
@yohangdev
yohangdev / xiaoyi_smart_ipcamera.sh
Created June 20, 2017 15:44
Fix Xiaomi Xiao Yi Ant HOME – This camera can only be used in China (1.8.6.1)
# ps | grep /home/watch_process | grep -v "grep" | awk '{print $1}' | xargs kill -9
# ps | grep /home/cloud | grep -v "grep" | awk '{print $1}' | xargs kill -9
# sed -i 's|api.xiaoyi.com/v4/ipc/check_did|api.xiaoyi.cox/v4/ipc/check_did|g' /home/cloud
# reboot
# https://diy.2pmc.net/solved-xiaomi-xiao-yi-ant-home-camera-can-used-china/
@yohangdev
yohangdev / parel_durov_indonesia.txt
Last active July 16, 2017 02:27
Parel Durov (Creator Telegram): Some thoughts on Indonesia
Some thoughts on Indonesia
A lot of Telegram's early adopters come from Indonesia, and now we have several
million users in that beautiful country. I am personally a big fan of Indonesia
– I’ve been there a few times and have many friends there.
So it made me upset to hear that the Indonesian Ministry of Communication and IT
suggested they would have to block Telegram in Indonesia. It turns out that the
officials of the Ministry recently emailed us a list of public channels with
terrorism-related content on Telegram, and our team was unable to quickly
@yohangdev
yohangdev / vuejs-axios-await.vue
Created August 13, 2017 10:35
Example VueJS Axios Await/Async Raw
<template>
<div id="app">
<h3>Hello World</h3>
<h4>{{ user.name }}</h4>
<h4>{{ role.name }}</h4>
</div>
</template>
<script>
import axios from 'axios'
@yohangdev
yohangdev / AppServiceProvider.php
Created August 21, 2017 15:22
Logging/Monolog Guzzle Requests
<?php
// Source: https://michaelstivala.com/logging-guzzle-requests/
class ServiceProvider extends BaseServiceProvider
{
private $logger;
/**
* Bootstrap any application services.
@yohangdev
yohangdev / brew_reset_password.sh
Created August 23, 2017 05:52
OSX Homebrew Reset MySQL Password
$(brew --prefix mysql)/bin/mysqladmin -u root password asdf1234
@yohangdev
yohangdev / php_xdebug_start.sh
Created September 20, 2017 12:33
PHPStorm XDebug Auto Start
php -S 0.0.0.0:8000 -t ./public -d xdebug.remote_enable=1 -d xdebug.remote_autostart=1
@yohangdev
yohangdev / git_extract_between_commits.sh
Created October 10, 2017 07:28
Git Extract/List Modified Files Between Commits and Compress ZIP
zip modified-files.zip $(git diff --name-only SHA1 SHA2)