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
package kikaha.mojo; | |
import java.io.*; | |
import java.net.URL; | |
import java.security.CodeSource; | |
import java.util.HashSet; | |
import java.util.Set; | |
import com.amazonaws.auth.*; | |
import com.amazonaws.regions.Regions; | |
import com.amazonaws.services.codedeploy.*; |
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
1. Executar os comandos: | |
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024 | |
mkswap /var/swap.1 | |
chmod 600 /var/swap.1 | |
swapon /var/swap.1 | |
2. Editar o /etc/fstab adicionando a linha: | |
/var/swap.1 none swap sw 0 0 | |
3. Comandos p/ verificar: |
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 | |
get_instance_region() { | |
echo $(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | awk -F '"' '/\"region\"/ { print $4 }') | |
} | |
get_instance_id() { | |
curl -s http://169.254.169.254/latest/meta-data/instance-id | |
return $? | |
} |
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
<profiles> | |
<profile> | |
<id>run-app</id> | |
<properties> | |
<config.skip.tests>true</config.skip.tests> | |
</properties> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>io.skullabs.kikaha</groupId> |
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
// Get query parameters with js | |
var QueryParameters = { | |
all: function() { | |
var result = {} | |
location.search.substr(1).split("&").forEach(function (item) { | |
var keyValue = item.split("=") | |
result[keyValue[0]] = decodeURIComponent(keyValue[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
app.factory('utils', function() { | |
return { | |
validCpf: function(cpf) { | |
if ( !cpf || cpf.length != 11 | |
|| cpf == "00000000000" | |
|| cpf == "11111111111" | |
|| cpf == "22222222222" | |
|| cpf == "33333333333" | |
|| cpf == "44444444444" | |
|| cpf == "55555555555" |
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
character_set_client: utf8 | |
character_set_connection: utf8 | |
character_set_database: utf8 | |
character_set_filesystem: binary | |
character_set_results: utf8 | |
character_set_server: utf8 | |
collation_connection: utf8_unicode_ci | |
collation_server: utf8_unicode_ci | |
init_connect: set time_zone = '-03:00'; |
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 | |
class Csv{ | |
private $output; | |
private $delimiter; | |
function __construct($file_name, $delimiter = ';'){ | |
$this->output = fopen('php://output', 'w'); | |
$this->delimiter = $delimiter; |
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/python | |
from BaseHTTPServer import BaseHTTPRequestHandler | |
import SocketServer | |
import logging | |
PORT = 80 | |
class ServerHandler(BaseHTTPRequestHandler): |
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
<VirtualHost *:80> | |
ProxyPreserveHost On | |
ProxyRequests Off | |
ServerName host-origem-na-porta-80.com.br | |
ProxyPass / http://host-de-destino:8080/ | |
ProxyPassReverse / http://host-de-destino:8080/ | |
</VirtualHost> |
NewerOlder