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
prompt_kubectl() { | |
currentCluster=$(kubectx -c 2>/dev/null) | |
currentNamespace=$(kubens -c 2>/dev/null) | |
if test -n "$currentCluster"; then | |
prompt_segment yellow black "kubernetes($currentCluster:$currentNamespace)" | |
fi | |
} |
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
➜ go run ./main.go | |
Running .... | |
Active cluster: europe-west1-b/gke-eu | |
Grid emissions percentage: 48 | |
Active cluster: europe-west1-b/gke-eu | |
Grid emissions percentage: 48 | |
Active cluster: europe-west1-b/gke-us | |
Grid emissions percentage: 40 | |
Active cluster: europe-west1-b/gke-us | |
Grid emissions percentage: 40 |
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
# coding: utf-8 | |
from ftplib import FTP | |
import log | |
import logging | |
#log.criarLog() | |
log.atualizarLog() | |
# A função abaixa um arquivo definido por 'filename' na pasta definida por local com o nome | |
# especificado por 'name' | |
def download(handler, name, filename="musica1.mp3"): |
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
#encoding: utf-8 | |
from pyftpdlib.authorizers import DummyAuthorizer | |
from pyftpdlib.handlers import FTPHandler | |
from pyftpdlib.servers import FTPServer | |
import sys | |
# importante: a biblioteca pyftpdlib não é padrão do python, precisa ser instalada | |
# link: https://code.google.com/p/pyftpdlib/downloads/list |
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
# coding: utf-8 | |
import requests | |
from multiprocessing import Process, Pipe | |
def downloader(url, chunk_size, conn): | |
downloaded_parts = 0 | |
with open('download', 'wb') as fp: |
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
# coding: utf-8 | |
import requests | |
chunk_size = 1024 * 1024 # 1mb | |
download_url = 'http://speedtest.ftp.otenet.gr/files/test10Mb.db' | |
downloaded_parts = 0 | |
with open('download', 'wb') as fp: | |
response = requests.get(download_url, stream=True) |
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 pprint import pprint | |
from datetime import datetime | |
from project_files import * | |
from git_hub_scrapper import * | |
from file import * | |
DOMAIN = 'https://github.com' | |
def main(): | |
print('[INICIO.{_date:%Y/%m/%d %H:%M:%S}]'.format(_date=datetime.now())) |
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
def get_depth(self): | |
parent = self.parent | |
depth = 0 | |
while parent is not None: | |
parent = parent.parent | |
depth += 1 | |
return depth | |
# coloca isso na classe Link |
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
# coding: utf-8 | |
""" | |
pip install requests beautifulsoup4 | |
""" | |
import requests | |
from bs4 import BeautifulSoup |
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 java.util.List; | |
public class Teste { | |
public static void main(String[] args) { | |
Estoque e = new Estoque(); | |
//cadastrando carros |
NewerOlder