Montando uma VM para o desenvolvimento de aplicações em PHP, utilizado o CentOS 7
This file contains hidden or 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
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import java.io.Reader; | |
| import java.net.URL; | |
| import java.net.URLConnection; | |
| import java.security.InvalidKeyException; | |
| import java.security.KeyManagementException; |
This file contains hidden or 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 | |
| use Zend\Db\Sql\Select; | |
| // basic table | |
| $select0 = new Select; | |
| $select0->from('foo'); | |
| // 'SELECT "foo".* FROM "foo"'; |
This file contains hidden or 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 | |
| // start PHP with: php -S localhost:8888 -t . spider.php | |
| $site = 'http://www.targetwebsite.org/'; | |
| $path = $_SERVER["REQUEST_URI"]; | |
| if ($path == '/') { | |
| $path = '/index.html'; |
This file contains hidden or 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 | |
| setup(); | |
| $t = new Tree('top', 'T'); | |
| $t->append(new TreeNode('one', 1)); | |
| $t->append($x = new TreeNode('two', 2)); | |
| $t->append(new TreeNode('three', 3)); | |
| $t->append(new TreeNode('foo', 'foo')); |
This file contains hidden or 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
| #!/usr/bin/php | |
| <?php | |
| /** | |
| * Because you want "tree", but cannot find the source code quick enough | |
| * on the web to compile for OS.X or there is no suitable implementation | |
| * on windows. | |
| */ | |
| // set error reporting | |
| error_reporting(E_STRICT | E_ALL); |
This file contains hidden or 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
| ### /etc/supervisor/conf.d/beanstalkd.conf | |
| [program:beanstalkd] | |
| command=/usr/local/bin/beanstalkd.sh | |
| directory=/home/rails | |
| user=ubuntu | |
| startsecs=10 | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/var/log/supervisor/beanstalkd.log |
This file contains hidden or 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
| combine files into ssl.pem | |
| sudo su (login as root) | |
| cd /etc/letsencrypt/live/yourdomain | |
| cat privkey.pem cert.pem > ssl.pem | |
| Forward Secrecy & Diffie Hellman Ephemeral Parameters | |
| cd /etc/ssl/certs | |
| openssl dhparam -out dhparam.pem 4096 | |
| Copy and paste the following into /etc/lighttpd/lighttpd.conf dont forget to change yourdomain to your domain |
This file contains hidden or 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 | |
| /* | |
| * Quick 'n Dirty Laravel 5.1 decrypter. | |
| * | |
| * Based directly off the source code at: | |
| * https://github.com/laravel/framework/blob/5.1/src/Illuminate/Encryption/Encrypter.php | |
| * | |
| * Have access to an application key from a .env? | |
| * Have some encrypted data you want to decrypt? | |
| * Well: (new Crypt($key))->decrypt($payload); should have you sorted |

