This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# script by Douglas V. Pasqua <[email protected]> | |
# | |
# this script is based on original: https://github.com/maxharlow/aws-ip-rotator/blob/master/aws-ip-rotator.sh | |
# the improvement in this scrtipt is that it works with ec2 in vpc (at releasing the old ip) | |
# | |
# To run this script install aws-cli and jq (JSON Processor) | |
# $ sudo apt install awscli | |
# $ sudo apt install jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); // Sessao do php deve estar ativa | |
// datetimezone | |
date_default_timezone_set('America/Sao_Paulo'); | |
// autoloader gerado pelo composer | |
require_once "vendor/autoload.php"; | |
// configurar APP_ID e SECRET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Cria a instancia da aplicacao, informando o appid e o secret | |
$facebook = new Facebook(array( | |
'appId' => $APP_ID, | |
'secret' => $SECRET, | |
)); | |
// obtem o id do usuario | |
$user = $facebook->getUser(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* script que realiza publicação de foto no perfil do usuário do facebook | |
* no exemplo também é realizado uma marcação na foto | |
*/ | |
// incluir a lib fo facebook | |
require 'facebook-php-sdk-master/src/facebook.php'; | |
// Cria a instancia da aplicacao, informando o appid e o secret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Controller; | |
use Zend\Mvc\Controller\AbstractActionController; | |
class DownloadController extends AbstractActionController | |
{ | |
public function indexAction() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script que irá executar um determinado comando a cada 15 segundos. | |
# Script é ideal para ser utilizado no crontab, caso queira um processo seja executado em intervalos | |
# menores que 1 minuto, que é o intervalo mínimo permitido no crontab. | |
# | |
# Pode ser facilmente adaptado para outros intervalos diferente de 15 segundos. | |
# Neste exemplo, o script será executado nos momentos: 0, 15, 30 e 45 (para por aqui). | |
# O próximo momento será executado pelo crontab que iniciará um novo ciclo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// incluir a lib fo facebook | |
require 'facebook-php-sdk-master/src/facebook.php'; | |
// Cria a instancia da aplicacao, informando o appid e o secret | |
$facebook = new Facebook(array( | |
'appId' => '', | |
'secret' => '', | |
)); |