Skip to content

Instantly share code, notes, and snippets.

View pablocampina's full-sized avatar

Pablo pablocampina

View GitHub Profile
@pablocampina
pablocampina / solve_ssh_problems.txt
Created November 16, 2016 16:04
Solve ssh problems to user "ubuntu"
sudo chown -R username:username /home/username/.ssh
sudo chmod 0700 /home/username/.ssh
sudo chmod 0600 /home/username/.ssh/authorized_keys
PHP_VER="5.5.14"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract
SETUP VIRTUAL HOSTS
atom /usr/local/etc/nginx/sites-available/mydomain.dev
CONFIG EXAMPLE
server {
listen *:80;
server_name mydomain.dev;
access_log /usr/local/etc/nginx/logs/mydomain.access.log;
error_log /usr/local/etc/nginx/logs/mydomain.error.log;
@pablocampina
pablocampina / gist:64588a55c2399218efd1
Created March 16, 2016 06:34 — forked from mgmilcher/gist:5eaed7714d031a12ed97
Nginx, PHP-FPM, MySQL and phpMyAdmin on OS X

This is my take on how to get up and running with NGINX, PHP-FPM, MySQL and phpMyAdmin on OSX Yosemite.

This article is adapted from the original by Jonas Friedmann. Who I just discovered is from Würzburg in Germany. A stonesthrow from where I was born ;)

Xcode

Make sure you have the latest version of XCode installed. Available from the Mac App Store.

Install the Xcode Command Line Tools:

xcode-select --install

@pablocampina
pablocampina / 01-README.md
Created February 26, 2016 18:32 — forked from petemcw/01-README.md
Mac OS X LEMP Configuration

Mac OS X LEMP Configuration

This Gist is a collection of configuration files that can be used to easily setup a Homebrew-based LEMP stack on Mac OS X.

Files in this repository are numbered and named for ordering purposes only. At the top of each file is a section of metadata that denote what component the file belongs to and the default name & location of the file. Feel free to implement it however you want.

Note: some configuration files have hard-coded paths to my user directory -- fix it for your setup

Setup

@pablocampina
pablocampina / Gulpfile.js
Created November 22, 2015 22:11
My Gulpfile.js
// LOAD PLUGINS
var gulp = require('gulp');
var minifyCss = require('gulp-minify-css');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var cache = require('gulp-cache');
var imagemin = require('gulp-imagemin');
var rename = require('gulp-rename');
var notify = require('gulp-notify');
@pablocampina
pablocampina / wp_new_user_admin_sql
Created March 17, 2015 21:13
Insert new user with Admin privileges into wordpress (SQL)
INSERT INTO `your_db`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('5', 'admin', MD5('password'), 'admin', 'email@email.com', 'http://www.yoursite.com', '2011-06-15 00:00:00', '', '0', 'Admin');
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
INSERT INTO `your_db`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_user_level', '10');
@pablocampina
pablocampina / wp_local_to_on
Last active August 29, 2015 14:14
Change all URL into wordpress
UPDATE wp_options
SET option_value = REPLACE(option_value, 'http://localhost', 'http://www.seudomino.com')
WHERE option_name = 'home'
OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://localhost', 'http://www.seudomino.com');
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://localhost', 'http://www.seudomino.com');