Skip to content

Instantly share code, notes, and snippets.

View rafaelqm's full-sized avatar
🎯
Focusing

Rafael Querino Moreira rafaelqm

🎯
Focusing
View GitHub Profile
@rafaelqm
rafaelqm / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rafaelqm
rafaelqm / macosx-install-php-oracle-oci8-pdo_oci.md
Created April 13, 2017 14:28 — forked from krisanalfa/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew

Installation

This procedure is tested on Mac OS X 10.10.5 with Developpers tools installed (xCode).

PHP 5.6 installed with Homebrew.

Preparation

Download the following files from Oracle website (yes, you need to create an account and accept terms):

@rafaelqm
rafaelqm / Instalando OCI8 (Oracle) no Ubuntu 14, 16 e 18.md
Last active January 23, 2021 22:23
Instalação lib para conexão ao Oracle no PHP 7.0 à 7.4

Instalar o módulo OCI8 (Oracle) no Ubuntu 14.04 ou 16.04 ou 18.04 (detalhes no final)

1 - Instalar PHP7 e Apache 2 / Nginx

2 - Baixar o Oracle Instant Client

Para que o módulo php-oci8 funcione, é necessário baixar o Instant Client.

@rafaelqm
rafaelqm / install wkhtmltopdf 0.12.4 on Linux Ubuntu.md
Last active August 5, 2019 14:59
How to install WKHTMLtoPDF on Linux Ubuntu

Installing WKHTMLtoPDF 0.12.4 (fixed DPI error)

cd ~
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar -xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
cd wkhtmltox/bin/
sudo mv wkhtmltopdf  /usr/bin/wkhtmltopdf
sudo mv wkhtmltoimage  /usr/bin/wkhtmltoimage
sudo ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
Open a terminal.
Install ack-grep by typing sudo apt-get install ack-grep
Change to the directory you want to search under, and type ack-grep foo. it lists out all the matches in all files under that directory.
@rafaelqm
rafaelqm / macosx-install-php-oracle-oci8-pdo_oci.md
Created April 11, 2018 00:01 — forked from alexbonhomme/macosx-install-php-oracle-oci8-pdo_oci.md
Install OCI8 and / or PDO_OCI on OSX via Brew
@rafaelqm
rafaelqm / Laravel PHP7 LEMP AWS.md
Created August 27, 2018 19:33 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@rafaelqm
rafaelqm / delete_merged_remote_branches.sh
Created September 17, 2018 14:26 — forked from Emuentes/delete_merged_remote_branches.sh
Delete remote git branches that have been merged into develop
# Breakdown of the process
# NOTE: I am searching for branches merged into Develop because I'm using GiT flow
# 1) git branch -r --merged develop
# Get remote branches that have been merged into develop
# 2) grep -v -E '(\*|master|develop)'
# From those branches returned by the above command,
# exclude: master, develop, & the currently selected branch (the branch name beggining with an asterisk)
Nginx Tip 1. – Organize Nginx Configuration Files
Normally Nginx configuration files are located under /etc/nginx path.
One good way to organize configuration files is use Debian/Ubuntu Apache style setup:
## Main configuration file ##
/etc/nginx/nginx.conf
## Virtualhost configuration files on ##
/etc/nginx/sites-available/
@rafaelqm
rafaelqm / backup_entire_site.sh
Created June 7, 2019 14:20
Backup your site when for any reason you lost the server access
wget \
--recursive \ # Download the whole site.
--no-clobber \ # Don't overwrite existing files.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
--restrict-file-names=windows \ # Modify filenames to work in Windows as well.
--domains yoursite.com \ # Do not follow links outside this domain.
--no-parent \ # Don't follow links outside the directory you pass in.