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
| //do tutorial | |
| dotnet new console | |
| dotnet restore | |
| dotnet run | |
| //para adicionar um pacote de manipulacao de json | |
| dotnet add package Newtonsoft.Json |
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/python | |
| # -*- coding: utf-8 -*- | |
| import sys, unicodedata | |
| from bs4 import BeautifulSoup | |
| import pymongo as Pymongo | |
| from pymongo import MongoClient | |
| client = MongoClient('localhost', 27017) | |
| db = client['MongoTestes'] |
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
| def byteify(input): | |
| if isinstance(input, dict): | |
| return {byteify(key): byteify(value) | |
| for key, value in input.iteritems()} | |
| elif isinstance(input, list): | |
| return [byteify(element) for element in input] | |
| elif isinstance(input, unicode): | |
| return input.encode('utf-8') | |
| else: | |
| return input |
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/python | |
| # -*- coding: utf-8 -*- | |
| import datetime | |
| dat1 = '1994-10-08T23:14:05Z' | |
| dat2 = str(datetime.datetime.date(datetime.datetime.now())) | |
| dat1f = dat1.split("T")[0] | |
| d1 = datetime.datetime.strptime(dat1f, "%Y-%m-%d") |
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 urllib2 | |
| import datetime | |
| import json | |
| import urlparse | |
| from multiprocessing import Pool | |
| num = 725 | |
| qtDivs = 4 | |
| numvet = [] | |
| vetDivs = [] |
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
| def add_cors_headers(response): | |
| response.headers['Access-Control-Allow-Origin'] = '*' | |
| if request.method == 'OPTIONS': | |
| response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT' | |
| headers = request.headers.get('Access-Control-Request-Headers') | |
| if headers: | |
| response.headers['Access-Control-Allow-Headers'] = headers | |
| return response | |
| app.after_request(add_cors_headers) |
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 axios from "axios"; | |
| import { getToken } from "./auth"; | |
| const api = axios.create({ | |
| baseURL: "http://127.0.0.1:5000" | |
| }); | |
| api.interceptors.request.use(async config => { | |
| const token = getToken(); | |
| if (token) { |
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
| echo "zerando o firewall" | |
| iptables -F | |
| iptables -t nat -F | |
| iptables -t mangle -F | |
| iptables -P INPUT ACCEPT | |
| iptables -P OUTPUT ACCEPT | |
| iptables -P FORWARD ACCEPT | |
| Crie os seguintes cenários de rede: | |
| # 1. Mascare todos os pacotes de rede que saem da LAN para a Internet. | |
| echo 1 > /proc/sys/net/ipv4/ip_forward |
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
| iptables -A INPUT -p udp --sport 53 -j ACCEPT | |
| iptables -A OUTPUT -p udp --dport 53 -j ACCEPT | |
| iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT | |
| iptables -A INPUT -p tcp --sport 443 -j ACCEPT | |
| iptables -A INPUT -p tcp --sport 80 -j ACCEPT | |
| iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT |
OlderNewer