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
def round_to_nearest_quarter_hour(minutes, base=15): | |
""" | |
Input: A value in minutes. | |
Return: An integer rounded to the nearest quarter-hour (0, 15, 30, 45) based on the base interval, | |
with special handling to ensure rounding from 0 up to 7 goes to 0 and 8 to 15 round to 15 | |
Example round_to_nearest_quarter_hour(0) rounds to 0 | |
round_to_nearest_quarter_hour(7) rounds to 0 | |
round_to_nearest_quarter_hour(8) rounds to 15 | |
round_to_nearest_quarter_hour(22) rounds to 15 |
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
#!/usr/bin/env python | |
import requests | |
import gitlab | |
from jira import JIRA | |
import urllib3 | |
import json | |
## Disable urllib3 ssl checks warnings | |
urllib3.disable_warnings( urllib3.exceptions.InsecureRequestWarning ) |
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
<# | |
Create Unix VM's. | |
PREREQUISITES: | |
- A VM that has been installed with an OS that supports cloud-init | |
- cloud-init is installed on the vm | |
How it works: | |
- Asks for a bunch of parameters | |
- Creates a disk from parent vhdx for speed |
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
<# | |
Create Unix VM's. | |
PREREQUISITES: | |
- A VM that has been installed with an OS that supports cloud-init | |
- cloud-init is installed on the vm | |
How it works: | |
- Asks for a bunch of parameters | |
- Creates a disk from parent vhdx for speed |
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 sys | |
import json | |
import os | |
# Hook should extract all of the following for use as Timewarrior tags: | |
# UUID | |
# Project | |
# Tags | |
# Description | |
# UDAs |
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
#!/usr/bin/env python3 | |
import re | |
import fileinput | |
print("SET FOREIGN_KEY_CHECKS=0;") | |
def main(): | |
for line in fileinput.input(): |
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
mkfifo /tmp/gfifo | |
./xdp-screen-cast-ffmpeg.py & # or run in another terminal | |
# Note the gstreamer pipeline | |
# 'pipewiresrc fd=%d path=%u ! videorate ! video/x-raw,framerate=60/1 ! videoconvert ! filesink location=/tmp/gfifo' | |
# I specified a 60/1 frameerate. You can do other pre-processing here, or offload it to ffmpeg. | |
# Encode the stream and pipe to netcat | |
# note: must specify correct resolution here | |
# we can now use h264_nvenc, mpegts, and anything else ffmpeg has |
Using Edge WebView2 is really straightforward, but using the Composition controller is poorly documented and only discussed on few issues in the WebView2 repo.
The browser itself is rendered on a separate process using DirectComposition API wich does not directly interoperate with DirectX, but can be readed using GraphicsCaptureItem WinRT apis. This means that a capture session must be setup into the host visual root, and it will provide accelerated GPU texture capture of the browser (with transparency)
There are few extra steps to setup this pipeline under win32 apps, apart of usual WebView2 setup:
- A
DispatcherQueueController
need to be created in the hosting thread in order to be able to use theVisual
interfaces - Use
CreateCoreWebView2CompositionController
insteadCreateCoreWebView2Controller
or itsWithConfig
equivalent. - Create a WinRT DirectComposition
IContainerVisual
andIVisual
as in the example - Create a WinRT Direct3D11CaptureFramePool and start the session using `GraphicsC
OlderNewer