Skip to content

Instantly share code, notes, and snippets.

@gravitano
gravitano / post-receive.sh
Last active August 29, 2015 14:18
New Git Hook Script (bash)
#!/bin/sh
#
## store the arguments given to the script
read oldrev newrev refname
# The deployed directory (the running site)
DEPLOYDIR=/var/www/html/
# Repository Directory
REPODIR=$HOME/repo.git
@gravitano
gravitano / Envoy.blade.php
Last active December 24, 2016 06:25
Envoy as Deployer
@servers(['web' => 'deploy-ex'])
@setup
$repo = '[email protected]:Servers-for-Hackers/deploy-ex.git';
$release_dir = '/var/www/releases';
$app_dir = '/var/www/app';
$release = 'release_' . date('YmdHis');
@endsetup
@macro('deploy', ['on' => 'web'])
@gravitano
gravitano / install.sh
Last active August 29, 2015 14:18 — forked from fideloper/install.sh
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
#!/bin/bash
# install monaco font
curl -kL https://raw.github.com/cstrap/monaco-font/master/install-font-ubuntu.sh | bash
# Add elementary update repository
sudo apt-add-repository ppa:versable/elementary-update
# Add Moca Repository
sudo add-apt-repository ppa:moka/stable
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<!--
Created using JS Bin
http://jsbin.com
Copyright (c) 2015 by anonymous (http://jsbin.com/tusafajege/1/edit)
@gravitano
gravitano / contoh-file-php.php
Created February 13, 2015 15:26
Contoh File PHP
<?php
// ini contoh file PHP
@gravitano
gravitano / gitbash.sh
Created February 9, 2015 03:56
Setup a new git repository on your private server
REPONAME=$1
REPODIR=$2
### Setup A New Git Repository
mkdir $REPONAME
chown -R git:developers $REPODIR
chmod g+rws $REPODIR
cd $REPODIR
git init --bare
@gravitano
gravitano / install-hhvm.sh
Created November 12, 2014 04:04
Install HHVM on Ubuntu 12.04/Elementary
sudo apt-get install git-core cmake g++ libmysqlclient-dev \
libxml2-dev libmcrypt-dev libicu-dev openssl build-essential binutils-dev \
libcap-dev libgd2-xpm-dev zlib1g-dev libtbb-dev libonig-dev libpcre3-dev \
autoconf automake libtool libcurl4-openssl-dev \
wget memcached libreadline-dev libncurses-dev libmemcached-dev libbz2-dev \
libc-client2007e-dev php5-mcrypt php5-imagick libgoogle-perftools-dev \
libcloog-ppl0 libelf-dev libdwarf-dev subversion python-software-properties \
libmagickwand-dev libxslt1-dev ocaml-native-compilers libevent-dev
# Update GCC
sudo add-apt-repository -y ppa:elementary-os/stable
sudo apt-get update
sudo apt-get install elementary-desktop
# To get over the wallpaper bug, open a terminal and paste the below oneliner:
gsettings set org.gnome.settings-daemon.plugins.background active true
# Also, if you want a closer look to Elementary OS, you should install plank, from ricotz PPA:
sudo add-apt-repository ppa:ricotz/docky
sudo apt-get update
@gravitano
gravitano / ModelTrait.php
Created November 3, 2014 06:44
Model trait
<?php
use Illuminate\Database\Eloquent\ModelNotFoundException;
trait ModelTrait {
/**
* Get the very last record.
*
* @return static|null