Skip to content

Instantly share code, notes, and snippets.

@Rand0mB0t
Rand0mB0t / asciiFlipper.py
Last active April 18, 2024 17:40
Simple Python script for flipping an ASCII- art
__author__ = 'Rand0mb0t'
# Code for ASCII-ART Flipper
img_file = str(input("select an input file : "))
save_file = str(input("Select an output file : "))
with open(img_file,"r") as file: # Open art- file
lines = file.read().split('\n')
while '' in lines: # Remove any empty lines from file
lines.remove('')
@Rand0mB0t
Rand0mB0t / buttonFunc.py
Last active September 5, 2017 12:23
Calling functions on button click Tkinter (Python3.x)
#Tkinter gui based color changer on button click
__author__ = 'Randmb0t'
from tkinter import *
root = Tk() # Create root window for your application
root.geometry("150x150") # set the size of the main window
# Function to call when red btn is clicked
def colorRed():
@Rand0mB0t
Rand0mB0t / gist:ca88ad678fdef0b3e002c3026abb732d
Created July 30, 2018 16:21 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@Rand0mB0t
Rand0mB0t / whitelist_ip.py
Created October 6, 2020 14:43
Python script to whitelist ip in a GCP firewall rule
"""
BEFORE RUNNING:
---------------
1. If not already done, enable the Compute Engine API
and check the quota for your project at
https://console.developers.google.com/apis/api/compute
2. This sample uses Application Default Credentials for authentication.
If not already done, install the gcloud CLI from
https://cloud.google.com/sdk and run
`gcloud auth application-default login`. USING your gmail ACCOUNT associated
Container Registry
- immutable artifacts
- Artifact repository
- binary authorization
- IAM policy per environemnt ( have an overview of this )
Links
https://cloud.google.com/container-registry/docs/container-analysis-audit-logging
Exporting logs - https://cloud.google.com/logging/docs/export
Excluding logs - https://cloud.google.com/logging/docs/exclusions
cloud build
- Deployment to different services ( App Engine, GKE, Function, clour Run, Firebase)
- configuration
- pipeline triggers
- cloud build github app
- Cloud source Repos
- Cloud Pub/Sub
Links
Cloud build overview - https://cloud.google.com/cloud-build/docs/overview
Kubernetes
- configuration
- secret storage method
- secret rotaion and config changes
Spinnaker
- Deployment strategies ( this is like canary, Blue/green and so on )
- Testing new version
- configuration
Stackdriver logging
- log-based metric
- Enabling Vpc flow logs, cloud audit logs
- exporting logs to may be bigquery, gcs( project levl/ org level )
- logs from compute engine, GKE
- third party logs
- application logs to stackdriver api directly
- basic and advance logging filters
- logging exclusion
- IAM
Stackdriver Tracer/profiler
- Check performance
- What will be the impact to the user
- Be able to analyse answer what can be imporved
Stackdriver Debugger
- debug the app engine code
- debugger snapshots
- debugger Logpointsv