Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Antoni Putra antoniputra

🏠
Working from home
View GitHub Profile
View redis-autostart-osx.md

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

@antoniputra
antoniputra / ssl_nginx.conf
Created Dec 26, 2017 — forked from achmadfatoni/ssl_nginx.conf
letsencrypt laravel configuration
View ssl_nginx.conf
## http://domain.com and http://www.domain.com redirect to https://www.domain.com
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name domain.com www.domain.com;
include /etc/nginx/snippets/letsencrypt.conf;
location / {
return 301 https://www.domain.com$request_uri;
View link-sangar.js
@antoniputra
antoniputra / README.md
Created Feb 11, 2016 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@antoniputra
antoniputra / ssl-ubuntu.txt
Created Jan 1, 2016
SSL in ubuntu localhost
View ssl-ubuntu.txt
# create this under the Nginx configuration directory:
sudo mkdir /etc/nginx/ssl
# Now that we have a location to place our files,
# we can create the SSL key and certificate files in one motion by typing:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
# The only thing we would need to do to get SSL working on this same server block,
# while still allowing regular HTTP connections, is add a these lines:
View Gruntfile.js
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass
@antoniputra
antoniputra / macros.php
Created Nov 15, 2014
Macro for easily create link with method (POST, PUT, DELETE) - Laravel 4
View macros.php
<?php
/**
* Usage..
* Just save this code to your helpers file (eg: routes, filters, etc...)
*
* Then..
* {{ Form::link('Delete Item', 'DELETE', route('anything.page'), array('class' => 'btn btn-primary'), 'Are you sure ?') }}
**/
View jenkins.md

Creating a new Jenkins Server

First step, make sure java -version reports 1.6 or higher. If the command fails or the version isn't high enough, download the latest version of Java JDK from Oracle (http://www.oracle.com/technetwork/java/javase/downloads/index.html) (jdk-7u25-linux-x64.tar.gz at the time of writing) - a quick uname -m will let you know if you need the 32 or 64bit version. Installation instructions are available here (http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html#install-64).

My preference is to extract these to /usr/local and then ln -s /usr/local/jdk1.7.0_25 /usr/local/jdk.

Add /usr/local/jdk/bin to your $PATH.

Download the latest Jenkins WAR (1.519 currently) file from http://mirrors.jenkins-ci.org/war/latest/.

View ngxhost.sh
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxvhost\""
exit 1
fi
# May need to run this as sudo!
# I have it in /usr/local/bin and run command 'ngxvhost' from anywhere, using sudo.
@antoniputra
antoniputra / laravel-eflinder-config.php
Last active Apr 18, 2017
example laravel-elfinder configuration permission. ( https://github.com/barryvdh/laravel-elfinder )
View laravel-eflinder-config.php
'roots' => array(
array(
'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED)
'path' => public_path() .'/assets', // path to files (REQUIRED)
'URL' => 'http://domain.com/assets',
'alias' => 'Your Assets', // The name to replace your actual path name. (OPTIONAL)
'accessControl' => 'access',
'attributes' => array(
array( // example for lock all dir and file
'pattern'=> '/.+/',
You can’t perform that action at this time.