Skip to content

Instantly share code, notes, and snippets.

View kaidokert's full-sized avatar

Kaido Kert kaidokert

View GitHub Profile
@kaidokert
kaidokert / yts.exolist.json
Last active June 5, 2023 00:44
YTS test playlist file
[{
"name": "Youtube Test suite",
"samples": [{
"name": "Random first test",
"uri": "https://storage.googleapis.com/ytlr-cert.appspot.com/test-materials/media/high-bitrate/concat/sdr-fps-30/video10_137_h264_1920x1080_fps%3D30_bitrate_kbps%3D19021k.mp4"
},
{
"name": "A bit heavy test",
"uri": "https://storage.googleapis.com/ytlr-cert.appspot.com/test-materials/media/high-bitrate/sdr-drm/video10_h264_fps%3D30.0_bitrate_kbps%3D18994.589.enc"
}
@kaidokert
kaidokert / install-openssh.ps1
Last active May 2, 2023 02:09
Stub for testing provisioning
Add-WindowsCapability -Online -Name "OpenSSH.Server~~~~0.0.1.0"
# Dump in the key
echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCyFmcGw1DQhD7mns6lBQquepRf1p69ZjU/ml8bp3AA0RhDDwBYd4sjXfa/YgXS8A+5jDnivVvcqaB9jDWwGedLVYtPyObjp+OWZelGzx/hLI/E5LJ5iOh3Wu/AVJfaz+xdMEVNMq3fVNDgG72l9LlAxP8LC7tNWEGFsHESSg19RP61I8tOW5us/gjsAhwn+cZF8oURFx5daeLN7vjjXAMl6TOSvYxZR3Fcl+J/3FRTIQ0Iy5a463Jdc/lh/SMMWzwWNfTxOewm9Ay/KsA44ymcPTZOjSGfMRPeJ9KfQtbl2F/KYHkvtE5BFtwAZOVuFfrPSRWCQpPNvZp2U74/ffx2LZa8MvTIqOv1mzTeeR+/Ym6kc2CSmqkJ/STmXyj7b66gCuYfS9cwK+3Six6+8uYir1RGkjqM0WevH1V+EU0SSdyWqixK/R5GLPpwTpW3VBauEIdMZTXae4w67+EcocwiAtltZzrpizqGOE60WAHHrKPzRtGkqRo27Qor7u968kH4ir9i6Qy+4KeEiKgaZv+S0TNXIz+9tc8fpSDXw4WK0zm5Pmiu8rdRbwVLBSTFhPkvbkT4kVX2IGZtajUgP5Gw6abMGeuugeK2qYX+WsJMhXLBE6OinORTZIWsUGb5MZhPnQFCt66tcDkvuoTGYsNlujLufn99qvA8Ggo8U22/Uw== | Add-Content -Force -Path C:\ProgramData\ssh\administrators_authorized_keys
icacls 'C:\ProgramData\ssh\administrators_authorized_keys' /inheritance:r /grant 'Administrators:F' /grant 'SYSTEM:F'
Set-Service -N
@kaidokert
kaidokert / install-openssh.ps1
Created May 1, 2023 02:10
Install openssh on Windows
# OpenSSH
$capability = Get-WindowsCapability -Online -Name "OpenSSH.Client~~~~0.0.1.0"
if($capability.State -ne "Installed") {
WriteInfoHighlighted "`t Enabling OpensSH Client"
Add-WindowsCapability -Online -Name "OpenSSH.Client~~~~0.0.1.0"
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
}
@kaidokert
kaidokert / vms.tf
Created May 1, 2023 01:37
Azure Free VMs terraform snippet
# Create Windows VM
resource "azurerm_windows_virtual_machine" "windows_vm" {
size = "Standard_B1s"
name = "${var.prefix}-windows-vm"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
admin_username = "${var.adminname}"
admin_password = "${var.adminpwd}"
network_interface_ids = [
@kaidokert
kaidokert / Git Subtree basics.md
Created April 29, 2023 01:13 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@kaidokert
kaidokert / cryptoparts.sql
Last active March 6, 2021 21:56
Query STM32 parts for security features
-- The SQLite database file is in STMCube installation, cube-finder-db.db
select * from (
select substr(rpn,1,length(rpn)-2) as rpn, --remove last 2 letters of RPN which are memory size
core, featurename, featureitemname
from (
select replace(replace(rpn,'-A',''),'-X','') as rpn, --squash minor variants
strValue as core, f.name featurename, fi.item featureitemname
from cpn
join cpn_has_attribute cha on cha.cpn_id=cpn.id
https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/windows-builder
https://github.com/search?q=gcr.io+ltsc2019&type=Code
@kaidokert
kaidokert / Vagrantfile
Last active June 29, 2020 02:21
Simple quick Win VM
Vagrant.configure("2") do |config|
config.vm.box = "gusztavvargadr/visual-studio"
config.vm.box_version = "2019.0.2006"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "8192"
vb.cpus = 6
vb.customize ["modifyvm", :id, "--accelerate3d", "on"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
vb.customize ["setextradata", "global", "GUI/MaxGuestResolution", "any"]
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@kaidokert
kaidokert / const_strcmp.h
Last active March 30, 2023 06:58
C++11 constexpr strcmp, from gcc 4.7.2+ and clang 3.5+
// https://godbolt.org/z/5G3Ah3
// API: constexpr int const_strcmp( "foo", "bar" );
// Much more readable version here: https://gist.github.com/kaidokert/dfc08be8e75a3fc650d3daf8e89c3fe9
// but that doesn't work with GCC before version 7
#include <cstddef>
#include <utility>
namespace detail {