Skip to content

Instantly share code, notes, and snippets.

View andrekutianski's full-sized avatar
🇺🇦
StandWithUkraine

Andre Kutianski andrekutianski

🇺🇦
StandWithUkraine
View GitHub Profile
@andrekutianski
andrekutianski / git-deployment.md
Created August 25, 2017 12:01 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

@andrekutianski
andrekutianski / iugu_boleto-add-cliente.php
Created August 8, 2017 01:59
busca informações da fatura no banco local para comparação e verificação
// busca o usuario no banco local
$iuguClientId = iugu_boleto_search_client( $userid );
// se não retornar o usuário, presume-se que ele não existe. Então vamos cadastra-lo.
if( !$iuguClientId ){
try {
$iuguClientId = iugu_boleto_add_client( $params );
}catch (\Exception $e) {
echo "Não foi possível cadastrar o cliente na Iugu. {$e->getMessage()}";
@andrekutianski
andrekutianski / iugu_boleto.php
Created August 8, 2017 01:25
Função para o WHMCS Cadastrar o cliente na Iugu com os dados disponíveis no WHMCS
// Cadastra o cliente na Iugu com os dados disponíveis no WHMCS
function iugu_boleto_add_client( $params ){
// busco o campo personalizado referente ao documento do cliente configurado no modulo
$campoDoc = $params['cpf_cnpj_field'];
try{
Iugu::setApiKey($params['api_token']);
$iuguCustomer = Iugu_Customer::create(Array(
"email" => $params['clientdetails']['email'],
@andrekutianski
andrekutianski / README.md
Created August 3, 2017 03:37 — forked from nichtich/README.md
How to automatically deploy from GitHub

Deploy your site with git

This gist assumes:

  • you have an online remote repository (github / bitbucket etc.)
  • you have a local git repo
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by Apache
  • the Apache user is named www-data (may be apache on other systems)
ansible -i inventories/servers all -m service -a "name=salt-minion state=restarted"
- hosts: all
gather_facts: yes
remote_user: craun
serial: "25%"
sudo: yes
tasks:
- name: Update OpenSSL and OpenSSH (Debian)
apt: name={{ item }}
state=latest
# Installing all packages with one task (faster)
- name: install required packages using the apt module
apt: package={{ item }} update_cache=yes
sudo: True
with_items:
- git
- memcached
- nginx
$ ansible-playbook install-jenkins.yml --list-tasks
$ ansible localhost -m setup
localhost | SUCCESS => {
"ansible_facts": {
"ansible_all_ipv4_addresses": [
"10.0.0.100",
"192.168.100.100"
],
(MANY more facts)
}
TASK [setup] ********************************************** *********************
Ok: [servername]