- Para Windows descarregar a última versão do PHP (http://windows.php.net/download/) e descompactar para c:\php
- Descompactar o
php-*.zip
para c:\php - Renomear c:\php\php.ini-development para c:\php\php.ini (fazer overwrite do antigo)
- Install composer https://getcomposer.org/
- Abrir uma consola e correr o comando
php -S localhost:3000
ouphp -S localhost:8080
para ativar o servidor PHP integrado
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 | |
echo "Running /etc/rc.local" >> /var/log/messages | |
control_file=/etc/.rc.local.done | |
if [ -f $control_file ]; then exit 0; fi | |
# Install Oracle JVM 8 | |
apt-get -y install software-properties-common |
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
require "./guronsan/*" | |
require "json" | |
require "http" | |
module Guronsan | |
module Command | |
extend self | |
def run(command, args = nil) | |
io = String::Builder.new |
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 | |
#set -e | |
green="\033[32m" | |
red="\033[31m" | |
normal="\033[0m" | |
log() { | |
if [ $? -eq 0 ]; |
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
from flask import Flask | |
import re | |
app = Flask(__name__) | |
script = '''#!/bin/bash | |
cat <<EOF | |
============================ | |
My name is ${0} | |
I was input via user data |
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
import random | |
import string | |
def random_string(size=8): | |
rnd = random.SystemRandom() | |
chars = string.ascii_lowercase + string.digits | |
return ''.join(rnd.choice(chars) for i in range(size)) |
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 | |
# find the interface with the default route | |
interface=$(ip route | grep default | awk '{ print $5; exit }') | |
# get ip address from discovered interface | |
address=$(ifconfig $interface | egrep '([0-9]{1,3}\.){3}[0-9]{1,3}' -o | head -1) | |
# prepare address for sed | |
escaped_address=$(echo $address | sed -E 's/\./\\\./g') | |
# what to replace | |
search_address=127\.0\.1\.1 |
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
#!/usr/bin/env ruby | |
require 'rack' | |
require 'rack-rewrite' | |
include Rack | |
app = Builder.new do | |
use Rewrite do | |
rewrite '/', '/index.html' |
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
Show hidden characters
{ | |
"cmd": ["rbenv", "exec", "ruby", "$file"], | |
"selector": "source.ruby" | |
} |