I hereby claim:
- I am jjorissen52 on github.
- I am jjorissen (https://keybase.io/jjorissen) on keybase.
- I have a public key ASB6Ww6qSARphLT-X7dBsdRawEARNaf6NbtxQNUfov908Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
This should be enough to get you started!
hello_pubsub
should take an event
object, uwu-ize the data, and print the uwu-d message!
import base64
def hello_pubsub(event, context):
"""Background Cloud Function to be triggered by Pub/Sub.
Args:
locals { | |
gcloud_config_script =<<GCLOUD | |
# Make a gcloud config for this project locally if there isn't one already. | |
# if there is one, go ahead and activate. | |
script_dir=$PWD | |
configname="${var.project_id_prefix}-${terraform.workspace}" | |
project_id="${google_project_services.project.project}" | |
account="${var.gcp_account}" | |
existing_account=$(gcloud auth list --format="value(account)" --filter="account:$account") |
# Copyright 2019 JP Jorissen | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
#!/usr/bin/env python | |
import os | |
import sys | |
import json as json | |
import json as _json | |
import base64 | |
import logging | |
import functools | |
import subprocess |
Using ssh
Command:
# sudo only necessary to bind to protected port such as 80 or 443
sudo gcloud compute ssh <instance_name> -- -N -L 80:localhost:80
Using start-iap-tunnel
Command
# sudo only necessary to bind to protected port such as 80 or 443
sudo gcloud compute start-iap-tunnel 80 --local-host-port=localhost:80
""" | |
Basic GET/POST bulk operations using asyncio and aiohttop | |
Copyright 2020 John-Paul Jorissen | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
documentation files (the "Software"), to deal in the Software without restriction, including without | |
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
of the Software, and to permit persons to whom the Software is furnished to do so, subject to the | |
following conditions: |
alias ll="ls -l" | |
alias la="ls -al" | |
alias lh="ls -lh" | |
alias code="code-insiders" | |
gcloud-projects-set() { | |
# Make a gcloud config for this project locally if there isn't one already. | |
# if there is one, go ahead and activate. | |
local script_dir=$PWD | |
local configname="$1" |
import os | |
import dotenv | |
dotenv.read_dotenv(override=True) | |
os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true" | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_project.settings") | |
# django.setup() is called as a side-effect | |
from django.core.wsgi import get_wsgi_application | |
_ = get_wsgi_application() |
# licensed under the UNLICENSE https://unlicense.org/ | |
mpip() { | |
if [[ "$1" == "install" ]]; then | |
touch requirements.txt | |
local old_req="$(< requirements.txt)" | |
local new_req="$old_req" | |
shift 1 | |
local install_list=($@) | |
python -m pip install "$@" |