A Pen by Fabrizio Giordano on CodePen.
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
from modules import defines | |
import ndjson | |
from google.cloud import bigquery | |
import pymysql | |
database = pymysql.connect(host='IP', user='USER', passwd='PWD', db='DB_NAME',use_unicode=True, cursorclass=pymysql.cursors.DictCursor, charset="utf8") | |
def select_exe(query_select): | |
mydb = pymysql.connect(host='IP', user='USER', passwd='PWD', db='DB_NAME',use_unicode=True, cursorclass=pymysql.cursors.DictCursor, charset="utf8") | |
try: |
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 subprocess | |
import os | |
import subprocess | |
import requests | |
def is_service_running(name): | |
with open(os.devnull, 'wb') as hide_output: | |
exit_code = subprocess.Popen(['service', name, 'status'], stdout=hide_output, stderr=hide_output).wait() | |
return exit_code == 0 |
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/env python3.7 | |
# -*- coding: utf-8 -*- | |
__author__ = "Michele Berardi" | |
__copyright__ = "Copyright 2020" | |
__license__ = "GPL" | |
__version__ = "1.0.8" | |
__maintainer__ = "Michele Berardi" | |
__email__ = "[email protected]" | |
__status__ = "Production" |
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 requests | |
class Authorization: | |
def __init__(self, username, password, company_uid): | |
self.username = username | |
self.password = password | |
self.company_uid = company_uid | |
def token(self): | |
url = "https://api.domain.com/3.0/login/?username=" + self.username + "&password=" + self.password + "&company_uid=" + self.company_uid + "" |
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
#sudo apt-get install libmysqlclient-dev | |
#pip install mysqlclient | |
import csv | |
import MySQLdb | |
import tensorflow as tf | |
mydb = MySQLdb.connect(host='localhost', | |
user='root', | |
passwd='root') | |
cursor = mydb.cursor() |
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
sudo yum -y install epel-release | |
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel | |
# use pip or pip3 as you prefer for python or python3 | |
pip install --upgrade virtualenv | |
virtualenv --system-site-packages ~/venvs/tensorflow | |
source ~/venvs/tensorflow/bin/activate | |
pip install --upgrade numpy scipy wheel cryptography #optional | |
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl | |
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions | |
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl |
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
michelone@bd01$ ./mysqlsh root:@localhost:3307 -e "util.checkForServerUpgrade();" | |
mysqlsh: [Warning] Using a password on the command line interface can be insecure. | |
The MySQL server at localhost:3307 will now be checked for compatibility issues for upgrade to MySQL 8.0... | |
MySQL version: 5.7.24 - Source distribution | |
1) Usage of db objects with names conflicting with reserved keywords in 8.0 | |
No issues found | |
2) Usage of utf8mb3 charset | |
No issues found |
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
{'data': [{'access_token': 'EAAHR3c1UymABAN6W47KDb08KLUcbNq8zJidVO4MJTx1SAZC{ | |
'data': [ | |
{ | |
'access_token': 'EAAHR3c1UymABAN6W47KDb08KLUcbNq8zJidVO4MJTx1SAZCmAF6VqR92jesPIQt773U5ZCBxvnTE0HQC8t2HS8j1ctnZCvvqLIacKRLM6FhhLHNgf9Sqne61QIJ31Nt5MTI85rbm8xnHfAY7oabcfv6Oh3SWqLYDRLVn9dmwwZDZD', | |
'category': 'Blogger', | |
'category_list': [ | |
{ | |
'id': '361282040719868', | |
'name': 'Blogger' | |
} |
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
app_id = '512225539574368' | |
app_secret = '9dc19451ce6a58d4e22e9634053f443f' | |
user_short_token = 'EAAHR3c1UymABAARMW95G9U3NlzSE8lvWbmnJtGr7GauH3aofCCCiZBcxBfZBNN1ZAxOOWMEzzFgJLZAR2QHYtvIMZChB4ykU5U6ZAgvjdRo3lKffPeLJTPDztQZC29lN3mG4rVFFzuQibSVGhbr9Onhzf6oxfGXNbOSD9Sag5D3XjTgoH2LrfEfkUrj0SeZCXoNr9xaT7ZBrFoAZDZD' |