Skip to content

Instantly share code, notes, and snippets.

Avatar
⚛️
Microservices

Afonso Rodrigues afonsoaugusto

⚛️
Microservices
View GitHub Profile
View plot_map.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View getImageNasa.py
"""sudo apt-get install python-beautifulsoup
sudo pip2 install httplib2 --upgrade
sudo pip install beautifulsoup4
reg add "HKCU\Control Panel\Desktop" /v Wallpaper /f /t REG_SZ /d c:\images\wallpaper.bmp
"""
import httplib2
from bs4 import BeautifulSoup,SoupStrainer
View ListAllModules.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Install_gmaps_notebook.txt
#https://github.com/pbugnion/gmaps
#Ambiente Windows com Anaconda instalado:
#terminal
conda install -c conda-forge gmaps
jupyter nbextension enable --py widgetsnbextension --sys-prefix
conda update conda
ou
conda install -c conda-forge googlemaps
View TelegramBot.py
#sudo ap-get update
#sudo pip install python-telegram-bot --upgrade
#https://github.com/python-telegram-bot/python-telegram-bot/wiki/Extensions-%E2%80%93-Your-first-Bot
from sys import path
from configparser import ConfigParser
from telegram import ParseMode, Emoji
from telegram.ext import Updater, CommandHandler
from telegram.ext import MessageHandler, Filters
@afonsoaugusto
afonsoaugusto / plano_cartesiano.py
Created Jan 10, 2018
plano cartesiano em python com as opções de marcação do matplot lib
View plano_cartesiano.py
a = ['-','--','-.',':','.',',','o','v'
,'^','<','>','1','2','3','4','s','p'
,'*','h','H','+','x','D','d','|','_']
b = ['b' ,'g' ,'r' ,'c' ,'m' ,'y' ,'k' ,'w']
pp = []
for i in a:
for j in b:
pp.append(j+i)
@afonsoaugusto
afonsoaugusto / plano_cartesiano.py
Created Jan 10, 2018
plano cartesiano em python com as opções de marcação do matplot lib
View plano_cartesiano.py
a = ['-','--','-.',':','.',',','o','v'
,'^','<','>','1','2','3','4','s','p'
,'*','h','H','+','x','D','d','|','_']
b = ['b' ,'g' ,'r' ,'c' ,'m' ,'y' ,'k' ,'w']
pp = []
for i in a:
for j in b:
pp.append(j+i)
View enable_query_log_mysql.sql
20 CONFIGURAR LOGS DE PROFILING
EXECUTAR SET GLOBAL GENERAL_LOG_FILE = '/PATH/FILENAME1' ;
EXECUTAR SET GLOBAL LONG_QUERY_TIME = 0.2;
EXECUTAR SET GLOBAL SLOW_QUERY_LOG_FILE = '/PATH/FILENAME2';
30 LIGAR COLETA DE SLOW QUERIES
EXECUTAR SET GLOBAL SLOW_QUERY_LOG = 'ON';
40 DESLIGAR COLETA DE SLOW_QUERIES
EXECUTAR SET GLOBAL SLOW_QUERY_LOG = 'OFF';
View enable_security_mongo.js
use admin
db.createUser(
{
user: "alice",
pwd: "secret",
roles: [ { role: "root", db: "admin" } ]
}
)
sudo mongod --auth --port 27017 --dbpath=/var/lib/mongodb
View create_spatial_index_mysql.sql
-- Inclusão no CREATE TABLE:
CREATE TABLE point_example (p POINT NOT NULL, SPATIAL INDEX(p));
-- Inclusão com ALTER TABLE:
drop table point_example;
CREATE TABLE point_example (p POINT NOT NULL);
ALTER TABLE point_example ADD SPATIAL INDEX(p);
--com CREATE INDEX:
drop table point_example;
You can’t perform that action at this time.