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 cv2 | |
| from flask import Flask, Response | |
| app = Flask(__name__) | |
| camera = cv2.VideoCapture(0) | |
| def generate_frames(): | |
| while True: | |
| success, frame = camera.read() |
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
| # Add Docker's official GPG key: | |
| sudo apt-get update | |
| sudo apt-get install ca-certificates curl | |
| sudo install -m 0755 -d /etc/apt/keyrings | |
| sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc | |
| sudo chmod a+r /etc/apt/keyrings/docker.asc | |
| # Add the repository to Apt sources: | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ |
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
| (function() { | |
| const buttonLabelPattern = /^Trash \d+$/; | |
| const interval = 1000; | |
| const checkInterval = 500; | |
| let clickIntervalId = null; | |
| let checkTimeoutId = null; | |
| function clickButton() { | |
| const buttons = document.querySelectorAll('button'); |
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
| "Image" "Title" "Description" "Severity" "Vulnerability ID" "Vendor ID" "Package Class" "Package Type" "Package Name" "Installed Version" "Fixed Version" "Severity Source" "Primary Url" "Reference" | |
| {{- range $ri, $r := . }} | |
| {{- $imageName := $r.Target }} | |
| {{- $pkgClass := $r.Class }} | |
| {{- $pkgType := $r.Type }} | |
| {{- range $vi, $v := .Vulnerabilities }} | |
| {{$imageName}} {{ $v.Title }} {{ $v.Description }} {{$v.Severity}} {{ $v.VulnerabilityID }} {{$v.VendorIDs | join ", "}} {{ $pkgClass }} {{$pkgType}} {{ $v.PkgName }} {{$v.InstalledVersion }} {{ $v.FixedVersion }} {{$v.SeveritySource}} {{$v.PrimaryURL}} "{{$v.References | join "\r"}}" | |
| {{- end}} | |
| {{- end }} |
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
| #!/bin/bash | |
| # Define source and destination registry | |
| source_registry="https://source.registry.com" | |
| destination_registry="https://destination.registry.com" | |
| # Authenticate if needed | |
| auth="--user <username>:<password>" # if authentication is required, otherwise leave it empty | |
| auth_param="" | |
| if [ -n "$auth" ]; then |
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 glob, csv | |
| sum: float = 0 | |
| orders: int = 0 | |
| for file in glob.glob("*.csv"): | |
| with open(file, 'r') as input: | |
| csvInput = csv.DictReader(input) | |
| for row in csvInput: | |
| if 'SUBTOTAL' in row['total']: | |
| continue |
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 csv | |
| INPUT_FILENAME: str = 'bitwarden_export_20221018212756.csv' | |
| OUTPUT_FILENAME: str = 'passbolt_converted.csv' | |
| def csvParse(file): | |
| with open(file, newline='') as csvfile: | |
| rows = [] | |
| csvreader = csv.reader(csvfile, delimiter=',', quotechar='"') | |
| header = next(csvreader) |