Skip to content

Instantly share code, notes, and snippets.

@saulopaiva
saulopaiva / extract-pfx.sh
Created November 4, 2021 16:17 — forked from tomfanning/extract-pfx.sh
Shell script to extract certificate and key files suitable for nginx from a PFX file.
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: $0 filename.pfx" >&2
exit 1;
fi
if [ ! -e "$1" ]; then
echo "File not found: $1" >&2
@saulopaiva
saulopaiva / make_certs.sh
Created March 31, 2020 18:55 — forked from mediaupstream/make_certs.sh
extract ca-certs, key, and crt from a pfx file
#!/bin/bash
#
# Usage:
# ./make_certs.sh test.example.com
#
# The required input to make_certs.sh is the path to your pfx file without the .pfx prefix
#
# test.example.com.key
# test.example.com.crt (includes ca-certs)
----------------------------------------------
> Show Conflits:
git config --global alias.conflicts "diff --name-only --diff-filter=U"
Use: git conflicts
----------------------------------------------
> Log
git config --global alias.l "log -n 20 --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
1. instala docker
2. instala zsh através do babun:
(configuração de tema) https://www.sorendam.com/take-control-of-your-console-in-windows-with-babun-oh-my-zsh-and-powerline-fonts/
3. instala git flow
https://github.com/nvie/gitflow/wiki/Windows
4. adiciona plugin git-flow no zsh
5. instala ruby + rubygems
https://github.com/babun/babun/issues/93#issuecomment-160977126
@saulopaiva
saulopaiva / get.php
Created February 5, 2014 13:03
Snippet para fazer Override do get() de propriedades do \Orm\Model (FuelPHP), para verificar a existencia sufixo em propriedade
<?php
public function & get($property, array $conditions = array())
{
if (array_key_exists($property . '_en', static::properties())) {
return parent::get($property . '_en', $conditions);
} else {
return parent::get($property, $conditions);
}
}
@saulopaiva
saulopaiva / .bashrc
Created February 1, 2014 12:22
Configuração de bash
##############################################################################################################
# Configuração bash
#
# Adaptadas de:
# https://plus.google.com/u/0/114896277363762090056/posts/SiB4um66RtL
# http://pastebin.com/MzYSzLGy
##############################################################################################################
if [ -f /etc/bash_completion ]; then
@saulopaiva
saulopaiva / flatten.php
Last active December 31, 2015 21:39
Function for flatten array
<?
/**
Transforms:
$data = array(
'user' => array(
'email' => 'user@example.com',
'name' => 'Super User',
'address' => array(
'billing' => 'Street 1',
'delivery' => 'Street 2'
@saulopaiva
saulopaiva / install-fuelphp.sh
Last active September 2, 2017 21:52 — forked from kenjis/install-fuelphp.sh
Instalação do FuelPHP usando submodules do Git
#!/bin/sh
# FuelPHP Install Script
#
# @author Kenji Suzuki https://github.com/kenjis
# @copyright 2011 Kenji Suzuki
# @license MIT License http://www.opensource.org/licenses/mit-license.php
if [ $# -lt 2 ]; then
echo "Install FuelPHP and Create Application Repository"