Skip to content

Instantly share code, notes, and snippets.

View giasraya's full-sized avatar

Gias Ray Aji giasraya

  • Jakarta, Indonesia
View GitHub Profile
@giasraya
giasraya / auto_installer.sh
Created September 18, 2020 09:28 — forked from andhikamaheva/auto_installer.sh
Script to Install Nginx, PHP 7, MariaDB Centos 7
#!env bash
doInstallServer(){
if [[ -e /etc/redhat-release ]]; then
RELEASE_RPM=$(rpm -qf /etc/centos-release)
RELEASE=$(rpm -q --qf '%{VERSION}' ${RELEASE_RPM})
if [ ${RELEASE} != "7" ]; then
echo "Bukan CentOS Release 7."
exit 1
fi
else
@giasraya
giasraya / laravel-nginx.conf
Created June 4, 2020 21:36 — forked from ahmadazimi/laravel-nginx.conf
Laravel Nginx Php-fpm server configuration file (Centos 7)
server {
server_name www.abc.com;
return 301 $scheme://abc.com$request_uri;
}
server {
listen 80;
server_name abc.com;
@giasraya
giasraya / nginx.conf
Created June 4, 2020 21:34 — forked from ahmadazimi/nginx.conf
My customized nginx.conf file for optimization and performance boost.
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
events {
@giasraya
giasraya / docker-resources.md
Created February 21, 2020 11:00 — forked from rgaidot/docker-resources.md
Docker Resources All In One - A collection of docker online resources
@giasraya
giasraya / nginx.conf
Last active February 21, 2020 10:18 — forked from joseluisq/nginx.conf
nginx hack for multiple conditions
if ($request_uri = /) {
set $test A;
}
if ($host ~* teambox.com) {
set $test "${test}B";
}
if ($http_cookie !~* "auth_token") {
set $test "${test}C";
@giasraya
giasraya / .gitconfig
Created February 21, 2020 10:18 — forked from joseluisq/.gitconfig
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@giasraya
giasraya / transfer.fish
Created February 21, 2020 10:18 — forked from joseluisq/transfer.fish
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@giasraya
giasraya / github_deploy.sh
Created February 21, 2020 10:18 — forked from joseluisq/github_deploy.sh
Tiny Github local deployment bash script
#!/bin/sh
# Tiny Github deployment bash script
# @author José Luis Quintana <quintana.io>
# @datetime 2016-10-22
# Settings
REPO_PATH=username/repo-name
DEPLOY_PATH=/deploy/path/on/my/server
@giasraya
giasraya / docker_non_root.md
Created February 21, 2020 10:18 — forked from joseluisq/docker_non_root.md
Manage Docker as a non-root user (without sudo)

Manage Docker as a non-root user

The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The docker daemon always runs as the root user. If you don’t want to use sudo when you use the docker command, create a Unix group called docker and add users to it. When the docker daemon starts, it makes the ownership of the Unix socket read/writable by the docker group.

  • Add the docker group if it doesn't already exist:
sudo groupadd docker