Skip to content

Instantly share code, notes, and snippets.

View queirozsc's full-sized avatar

Sergio Carvaho Queiroz queirozsc

View GitHub Profile
@queirozsc
queirozsc / spec.json
Created November 10, 2023 21:29
Interactive Graph with Parameters #deneb #vega #powerbi
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 200,
"title": {
"text": "Macro Targets",
"align": "left",
"anchor": "start",
"subtitle": {
"signal": "['1. Enter your calorie target below ('+min_calories_allowed+'kcal - '+max_calories_allowed+'kcal)', '2. Click and drag the bars below to determine your macro targets (g)', empty_character, '1g fat = 9 kcal', '1g carbohydrates = 4 kcal', '1g protein = 4 kcal', empty_character]"
}
@queirozsc
queirozsc / linux.sh
Created February 8, 2021 19:02
Wifi Recovery Password
nmcli -t -f active,ssid dev wifi | egrep '^yes:' | sed 's/^yes://'
sudo nmcli -s -g 802-11-wireless-security.psk connection show 'HITRON-F7F0'
@queirozsc
queirozsc / models.py
Created May 25, 2020 16:20
Google Classroom API
import os
import pickle
from google.auth.transport.requests import Request # pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from django.db import models
from django.conf import settings
# Create your models here.
class Greeting(models.Model):
@queirozsc
queirozsc / preparation.sh
Last active April 28, 2020 14:41
Django commands
virtualenv venv
source venv/bin/activate
pip install django
django-admin startproject mysite
django-admin startapp polls
pyhton manage.py migrate # applies migrations on database
python manage.py createsuperuser # create a super user in database
./manage.py makemigrations polls # creates migration for polls app
./manage.py sqlmigrate polls 0001 # shows sql command that will be generated by migrate command
@queirozsc
queirozsc / DataFactory-Expressions.md
Created February 29, 2020 15:32
Azure Data Factory Expressions

Azure Event Grid

@triggerBody().fileName @triggerBody().folderPath

@queirozsc
queirozsc / Create-AlexaSkill.sh
Last active October 13, 2018 04:52
[Configurando o AWS Alexa Cli] Configurando a interface de linha de comando do Alexa Skill Kit. Fonte: https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html#step-2-install-and-initialize-ask-cli #aws #alexa
# Create a new skill project from the built-in Hello World sample
ask new ;
# Deploy a skill to developer account
ask deploy ;
# Create a local skill project directory from the development stage of an existing skill
# (note: get skill id at Alexa Developer Console)
# (note 2: will download the skill manifest, interaction model and skill code from AWS Lambda)
ask clone --skill-id amzn1.ask.skill.714b7ee8-85cb-4b18-8ce6-3bdeaa03bd48 ;
# Test a skill on device
ask simulate --text "open nursing skill" --locale en-us
@queirozsc
queirozsc / Count-Licenses.ps1
Last active October 13, 2018 05:21
[Manipulando usuários do Office 365 via PowerShell] Comandos para manipular o Office 365. Fonte: https://docs.microsoft.com/pt-br/office365/enterprise/powershell/getting-started-with-office-365-powershell #office365 #powershell #azuread
Get-MsolAccountSku
(Get-MsolAccountSku | where {$_.AccountSkuId -eq "reseller-account:O365_BUSINESS_PREMIUM"}).ServiceStatus
@queirozsc
queirozsc / Connect-LigthSail.sh
Last active October 13, 2018 02:02
[Manipulando LigthSail] Comunicando com instância AWS LightSail via SSH e SCP #aws #ligthsail #mysql #ssh #scp #wordpress
# Change the permission of .pem certificate so only the root user can read it
chmod 400 LightsailDefaultPrivateKey-us-east-1.pem ;
cp LightsailDefaultPrivateKey-us-east-1.pem ~/.ssh ;
# Connect to LigthSail via SSH
ssh -i ~/.ssh/LightsailDefaultPrivateKey-us-east-1.pem bitnami@34.200.244.131 ;
# Send file LightSail via SCP
scp -i ~/.ssh/LightsailDefaultPrivateKey-us-east-1.pem backup-9.5.2018_09-40-41_gaiapole.tar.gz bitnami@34.200.244.131:~ ;
@queirozsc
queirozsc / 01-Creating_a_feature_branch.sh
Last active April 4, 2018 13:26
Git branching model
git checkout -b myfeature develop #Switched to a new branch "myfeature"
@queirozsc
queirozsc / generate_password.py
Last active March 25, 2018 13:43
Python Generating Passwords
from string import punctuation, ascii_letters, digits
import random
def generate_password(pass_length):
symbols = ascii_letters + digits + punctuation
secure_random = random.SystemRandom()
password = "".join(secure_random.choice(symbols) for i in range(pass_length))
return password
generate_password(15)