Skip to content

Instantly share code, notes, and snippets.

View afonsoaugusto's full-sized avatar
👾
SRE & DevOps

Afonso Rodrigues afonsoaugusto

👾
SRE & DevOps
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#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
#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 January 10, 2018 13:50
plano cartesiano em python com as opções de marcação do matplot lib
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 January 10, 2018 13:51
plano cartesiano em python com as opções de marcação do matplot lib
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)
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';
use admin
db.createUser(
{
user: "alice",
pwd: "secret",
roles: [ { role: "root", db: "admin" } ]
}
)
sudo mongod --auth --port 27017 --dbpath=/var/lib/mongodb
-- 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;