Skip to content

Instantly share code, notes, and snippets.

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

João Paulo Pinheiro jotapepinheiro

🏠
Working from home
View GitHub Profile
@jotapepinheiro
jotapepinheiro / nginx.conf
Created December 14, 2019 07:36 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@jotapepinheiro
jotapepinheiro / crowd.php
Created March 18, 2019 12:36 — forked from AsaAyers/crowd.php
PHP Crowd Authentication
<?php
/**
* This file demonstrates using Atlassian Crowd for Single Sign On.
*/
$crowd_app_name = 'REMOVED';
$crowd_app_password = 'REMOVED';
$crowd_url = 'http://crowd.REMOVED.com/crowd/services/SecurityServer?wsdl';
// http://pear.php.net/package/Services_Atlassian_Crowd
@jotapepinheiro
jotapepinheiro / gist:de528a6c4ab5cbf46f26a1d3ae1b1047
Created October 11, 2018 10:41 — forked from mihaiserban/gist:1f35d488405812f2bbd4b16e38e4afb5
aws s3.listObjects recursive including metadata
const aws = require('aws-sdk')
aws.config.update({
accessKeyId: process.env.aws_access_key_id,
secretAccessKey: process.env.aws_secret_access_key,
region: process.env.aws_region});
const options = {
Bucket: process.env.s3_bucket,
region: process.env.aws_region,
@jotapepinheiro
jotapepinheiro / phpstorm-vs-sublimetext-shortcuts.md
Created September 24, 2018 00:14 — forked from silasrm/phpstorm-vs-sublimetext-shortcuts.md
Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

#Teclas de atalhos do PHPStorm com funções semelhantes ao Sublime Text, e outras interessantes.

Sublime Text PHPStorm Função
CMD+P CMD+Shift+O Busca por arquivos no projeto
CMD+R CMD+F12 (1) Lista os métodos da classe e outros símbolos
CMD+F CMD+F Busca no arquivo
CMD+Option+F CMD+R Busca e troca os valores no arquivo
CMD+Shift+F CMD+Shift+F Busca, busca e troca e outros em um determinado caminho com várias regras.
CMD+D (2) Option+Up (2) Seleciona palavra
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts
brew install bash # latest version of bash
# set brew bash as default shell
brew install fortune
brew install cowsay
brew install git
@jotapepinheiro
jotapepinheiro / vst-install.sh
Created December 7, 2017 02:11
Install VestaCP on Ubuntu 16.04
#!/bin/bash
# Vesta Ubuntu installer v.05
# Modified by David B (KernelPanic89) to work for Ubuntu
# Revision 1.0 - Sep 06 2016
#----------------------------------------------------------#
# Variables&Functions #
#----------------------------------------------------------#
@h@export PATH=$PATH:/sbin
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@jotapepinheiro
jotapepinheiro / zipfolders.sh
Last active December 3, 2015 00:29 — forked from icaoberg/zipfolders.sh
Compactar pastas .sh
#!/bin/sh
# Corrigir /bin/sh^m bad interpreter no such file or directory
# dos2unix *.sh
cd /home/proja380/public_html/wp-content/uploads/
caminho=2012
echo 'Compactando pasta '$caminho;
@jotapepinheiro
jotapepinheiro / wget-download-ftp-recursive-folder
Created December 2, 2015 13:39 — forked from mikedamoiseau/wget-download-ftp-recursive-folder
How to download a folder with all its content recursively using wget
Use this command line:
wget -r -nH --cut-dirs=3 -nc --ftp-user=jfc-ftp --ask-password ftp://jfc.bitbakers-kunden.de//htdocs/wp-content/uploads
And give the password. Better to use --ask-password so that the password is not saved in the history of the bash
@jotapepinheiro
jotapepinheiro / gist:53077dc8ad5522f82385
Created December 2, 2015 13:33
.htaccess redirect wp-content/uploads folder to subdomain
.htaccess
# Re-direct wp-content/uploads to subdomain
RewriteRule wp-content/uploads/(.*) http://uploads.example.com/$1 [R=301,L]
wp-config.php
// Make sure that we put uploads in the right place
update_option(
'upload_url_path',
'http://uploads.aubreypwd.com'
);