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 google.auth.transport.requests import Request | |
from google.cloud import storage | |
import os | |
# Set up proxy configuration | |
os.environ['HTTP_PROXY'] = "http://username:password@proxyserver:port" | |
os.environ['HTTPS_PROXY'] = "https://username:password@proxyserver:port" | |
# Create a custom request object with proxy | |
auth_request = Request() |
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 pandas as pd | |
import hashlib | |
# Define the hashing function using SHA-256 | |
def hash_value(value): | |
# Ensure the value is a string | |
value = str(value) | |
return hashlib.sha256(value.encode()).hexdigest() | |
# Load the CSV file into a DataFrame |
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
- name: Get current timestamp | |
ansible.builtin.shell: "date '+%Y-%m-%d_%H-%M-%S'" | |
register: current_time |
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 asyncio | |
import aiohttp | |
from aiohttp import web | |
import aioconsole | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
# Global variable to toggle | |
toggle_state = False |
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 os | |
import json | |
from confluent_kafka import Producer | |
import random | |
from faker import Faker | |
from jinja2 import Template | |
import sys | |
fake = Faker() |
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 logging | |
import time | |
import aiohttp | |
from aiohttp import web | |
# Configure logging to print to stdout | |
logging.basicConfig(level=logging.INFO) | |
async def handle_post(request): | |
# Record the start time |
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
python -c "from http.server import HTTPServer, BaseHTTPRequestHandler; import logging; logging.basicConfig(level=logging.INFO); HTTPServer(('', 8000), type('Handler', (BaseHTTPRequestHandler,), {'do_POST': lambda self: [self.send_response(200), self.end_headers(), self.wfile.write((data := self.rfile.read(int(self.headers.get('Content-Length'))))), logging.info(f'Received data: {data.decode()}')]})).serve_forever()" |
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
package main | |
import ( | |
"database/sql" | |
"encoding/csv" | |
"fmt" | |
"os" | |
_ "github.com/lib/pq" // or the driver of your choice | |
) |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"golang.org/x/oauth2/clientcredentials" | |
) | |
func main() { | |
// Define your Service Principal credentials |
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
graph TB | |
A[Create feature branch on VM] --> B[Add changes] | |
B --> C[Increment version number] | |
C --> D[Commit & Push] | |
D --> E{Does a release already exist?} | |
E -->|Yes| F[Update artifact version] | |
E -->|No| G[Create a new release and attach the right artifacts and version] | |
F --> H[Deploy the release for the DEV environment] | |
G --> H | |
H --> I[Implement the release in DEV] |