Skip to content

Instantly share code, notes, and snippets.

View plasx's full-sized avatar
🧭
👁️

Daniel Plas Rivera plasx

🧭
👁️
View GitHub Profile
@plasx
plasx / main.py
Created January 19, 2022 19:32
Rate Limiting Async API Requests With AIOHTTP and ASYNCIO
# standard
import asyncio
import logging
# thirdparty
import aiohttp
import attr
from attr.validation import instance_of
LOGGER_FORMAT = "%(asctime)s %(messages)s"
@plasx
plasx / sublime_text_helpful.md
Last active February 4, 2021 14:38
Sublime Text 3 Helpful Tricks

Enable Sublime Text 3 to open up via terminal (Mac OS Catalina 10.15.7)

ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl

@plasx
plasx / nvm-react-mac.md
Last active August 16, 2020 20:22
Getting Started

Install NVM

Remove existing brew installed node

brew uninstall --ignore-dependencies node
brew uninstall --force node
rm -f ~/.npm

Update homebrew

brew update

@plasx
plasx / linux-commands.md
Last active March 17, 2020 16:20
Useful Gunicorn Nginx Commands

reload changes in nginx gunicorn files in system

sudo systemctl daemon-reload

Look at nginx errors live

sudo tail -f /var/log/nginx/error.log
@plasx
plasx / python37cheatsheet.md
Last active July 27, 2018 20:52
Daniel's Python 3.7 Cheat sheet

Looping with index

Enumerate

Great for maintaining the index in the loop, as "for i in somelist: " does not maintain the index

items = ['dog','fog', 'jump', 'joma']
for i, item in enumerate(items):
    print(i, item)
0 dog
1 fog

2 jump

@plasx
plasx / instantclientguide.md
Created May 23, 2018 03:23 — forked from addodelgrossi/instantclientguide.md
Installing instant client 12 on macOS Sierra

Installing Oracle Mac OS Sierra

Download

  • instantclient-basic-macos.x64-12.2.0.1.0.zip
  • instantclient-sqlplus-macos.x64-12.2.0.1.0.zip
  • instantclient-sdk-macos.x64-12.2.0.1.0.zip

Create a directory /usr/local/lib/share/oracle

@plasx
plasx / Azure2TerraformTranslation.md
Last active September 13, 2017 14:51
Azure To Terraform Translation

Creating Tags

Azure

--tags "createdby=Daniel Plas Rivera" "year=2019"

Terraform

  tags {
    createddate = "${var.created_date}"
    editeddate = "${timestamp()}"
    createdby = "${var.created_by}"

environment = "${var.environment}"

Create it

New-AzureRmKeyVault -VaultName vaultofdaniel -ResourceGroupName myResourceGroup -Location eastus -EnabledForDeployment -EnabledForTemplateDeployment

which would look like this

az keyvault create --resource-group myResourceGroup --name danielvault

find objectid from serviceprinsiple

az ad sp show --id

@plasx
plasx / AzureCheatSheet.md
Last active May 24, 2022 05:47
Azure Cheat Sheet

Listing Images via Azure CLI

az vm image list --output table

Deleting certain resoruces in a resource group

List resource groups in a subscription

az resource list
@plasx
plasx / linkedin.py
Created March 31, 2017 01:29
linkedin login bs4
import requests
from bs4 import BeautifulSoup
client = requests.Session()
HOMEPAGE_URL = 'https://www.linkedin.com?allowUnsupportedBrowser=true'
LOGIN_URL = 'https://www.linkedin.com/uas/login-submit?allowUnsupportedBrowser=true'
html = client.get(HOMEPAGE_URL).content
soup = BeautifulSoup(html)