Skip to content

Instantly share code, notes, and snippets.

View steinkel's full-sized avatar

Jorge M. González Martín steinkel

View GitHub Profile
@steinkel
steinkel / ubuntu-11xx-nginx-base.sh
Last active October 19, 2021 16:36 — forked from simkimsia/ubuntu-11xx-nginx-base.sh
CakePHP + Nginx + PHP 5.4 FPM setup script, tested on Ubuntu 12.04 LTS, Using CakePHP 2.x only, Using latest PHP version, Using /sites instead of /var/virtual for sites, Adding a default enabled cakephpsite.com config
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http://cakedc.com)
#
# Ubuntu 11.04 and 12.04 LTS based web server installation script
# Run this by executing the following from a fresh install of Ubuntu Server:
#
@steinkel
steinkel / gitlab_ubuntu_server_1204.sh
Last active December 24, 2015 19:59
Gitlab 6.1 automated setup script for ubuntu 12.04 LTS
#!/bin/sh
# GITLAB
# By: steinkel at gmail.com
# App Version: 6.1 stable https://github.com/gitlabhq/gitlabhq/tree/6-1-stable
# ABOUT
# This script performs a complete installation of Gitlab for ubuntu server 12.04.1 x64:
# * packages update
# * git, postfix etc
@steinkel
steinkel / pre-receive
Last active January 5, 2016 03:15
git php pre-receive hook to detect syntax and phpcs errors for CakePHP projects
#!/usr/bin/php
<?php
/**
* This hook is a rewrite of http://git.661346.n2.nabble.com/Odd-results-writing-a-Git-pre-receive-hook-to-syntax-check-PHP-files-td5471120.html
* Thanks to Chris Patti for this thread
* @todo: detect when a new subdirectory is comitted and process all files recursive
*/
function finish($exitCode = 0, $message = '') {
if (!empty($message)) {
@steinkel
steinkel / getsimple
Created May 16, 2014 09:10
getsimple cms nginx config file
server {
listen 80; ## listen for ipv4; this line is default and implied
root /var/virtual/www
index index.php;
server_name example.com;
charset utf-8;
access_log off;
location / {
@steinkel
steinkel / terminator-shortcuts
Created June 18, 2014 10:53
Terminator shell keys keybinding shortcuts I use
ZOOM
<Ctrl>+ / <Ctrl>- / <Ctrl>0
TABS
<Ctrl><Shift>T / <Ctrl><Shift>Tab
SWITCH SCREENS
<Alt> Up/Down/Left/Right
SPLIT
@steinkel
steinkel / init.sh
Last active August 29, 2015 14:05
Ubuntu 14.04 CakePHP Min Server
#!/bin/bash
#
# Hey, this is minimal
# curl -L gist-raw-url | bash
#
#sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php5-cli git php5-mcrypt php5-intl screen cowsay mysql-server php5-mysql && \
sudo ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini && \
echo "downloading composer" && \
curl -sS https://getcomposer.org/installer | php && \
@steinkel
steinkel / database.sql
Last active August 29, 2015 14:05
sample database
-- MySQL dump 10.13 Distrib 5.5.38, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: cfws
-- ------------------------------------------------------
-- Server version 5.5.38-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@steinkel
steinkel / example.php
Created August 14, 2014 19:55
getting the Table of a given Entity in CakePHP 3.0
<?php
$table = Cake\ORM\TableRegistry::get($entity->source());
@steinkel
steinkel / gist:f1540cec633379067a11
Created September 12, 2014 20:59
TP-Link MA180
# TP-Link MA180
DefaultVendor= 0x2357
DefaultProduct=0x0200
TargetVendor= 0x2357
TargetProduct= 0x0201
MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
@steinkel
steinkel / init.sh
Last active August 29, 2015 14:21
Cakefest 2015 minimal setup
#!/bin/bash
#
# Hey, this is minimal
# curl -L gist-raw-url | bash
#
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php5-cli git php5-intl screen cowsay mysql-server php5-mysql && \
echo "downloading composer" && \
curl -sS https://getcomposer.org/installer | php && \
echo "creating CakePHP project" && \
php composer.phar create-project cakephp/app cakefest && \