Skip to content

Instantly share code, notes, and snippets.

View diegoos's full-sized avatar
🏠
Working from home

Diego Oliveira diegoos

🏠
Working from home
View GitHub Profile
@diegoos
diegoos / sphinx.rb
Created March 6, 2019 16:22 — forked from korny/sphinx.rb
Sphinx Homebrew formula for MySQL 5.7
class Sphinx < Formula
desc "Full-text search engine"
homepage "http://www.sphinxsearch.com"
url "http://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz"
sha256 "6662039f093314f896950519fa781bc87610f926f64b3d349229002f06ac41a9"
head "https://github.com/sphinxsearch/sphinx.git"
bottle do
sha256 "b890cf523db9777c7d125842fd6b0a53fe9a7a5a4cb816389ba6f5ee6483c78d" => :high_sierra
sha256 "55ce34bdedf13946fa614bde50839d93135eae720f1021e2c87807d04515ab18" => :sierra
@diegoos
diegoos / postgres-brew.md
Created February 13, 2019 23:43 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@diegoos
diegoos / Create wildcard Self-Signed Certificate.md
Last active March 20, 2019 21:14 — forked from lucasmartins1994/sshkey.md
Create certificate on localhost

Create a file named openssl.cnf

Put in this file the following code:

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req

[req_distinguished_name]
@diegoos
diegoos / ApacheHTTPSConfig.md
Created March 29, 2018 20:53 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@diegoos
diegoos / github_post_recieve.php
Created August 17, 2017 15:29 — forked from youhide/github_post_recieve.php
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi

setting autocorrect from git commands

git config --global help.autocorrect 1

ex:

git pulll origin master

WARNING: You called a Git command named 'pulll', which does not exist. Continuing under the assumption that you meant 'pull' in 0.1 seconds automatically...

@diegoos
diegoos / .htaccess.md
Created March 30, 2016 18:17
.htaccess snippets to optimize your website

#10+ .htaccess snippets to optimize your website

All of the snippets below have to be pasted into your .htaccess file, which is located on the root of your Apache server. Waring: Always make sure you have a working backup before editing your .htaccess file!

##Force trailing slash

Many clients of mine asked me for always having a trailing slash at the end of their urls. Looks like it’s great for SEO. The following snippet will alwyas add a trailing slash to your site urls.

@diegoos
diegoos / rails_install.md
Created February 19, 2016 13:30 — forked from ruanltbg/LAMP.md
Set up of a Rails + Nginx + Unicorn server in Ubuntu

Add necessary libs

$ sudo apt-get install autoconf automake autotools-dev build-essential bison bzip2 curl git libreadline5 libsqlite3-0 sqlite3 libsqlite3-dev libxml2-dev libmysqlclient-dev libreadline-gplv2-dev libruby openssl libssl-dev zlib1g zlib1g-dev zlibc vim libv8-dev nodejs libmysqlclient-dev libcurl3 libcurl3-gnutls libcurl4-openssl-dev
# Add rvm
$ \curl -sSL https://get.rvm.io | bash
# Add rvm initializer in .bashrc
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc || source ~/.bashrc
# initializing rvm
$ source ~/.rvm/scripts/rvm

installing requirements