Skip to content

Instantly share code, notes, and snippets.

View livelace's full-sized avatar
🇷🇺

Oleg "livelace" Popov livelace

🇷🇺
View GitHub Profile
@livelace
livelace / gist:d3a684da32783d74f1b56ab59dc9faa5
Created October 24, 2022 18:52
windows-10-with-gpu-inside-qemu-kvm
<domain type='kvm'>
<name>w10-gpu</name>
<uuid>7653a187-ea53-4dd9-95a8-712e8eb0a8ea</uuid>
<metadata>
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
<libosinfo:os id="http://microsoft.com/win/10"/>
</libosinfo:libosinfo>
</metadata>
<memory unit='KiB'>33554432</memory>
<currentMemory unit='KiB'>33554432</currentMemory>
@livelace
livelace / gist:0e1f01f01ffa9553e3223dd680c57802
Created March 1, 2022 01:29
Run shell function in parallel over file lines
#!/usr/bin/env bash
FILE="/tmp/file.txt"
PROC=3
echo -e "aaa bbb ccc\nddd eee fff" > "$FILE"
function do_it() {
echo "---"
printf "$1 $2 $3\n"
@livelace
livelace / ddc.sh
Created March 12, 2019 18:57
DDC (Display Data Channel) switcher
#!/usr/bin/env bash
# This script acts as a switcher between video inputs of a monitor (https://en.wikipedia.org/wiki/Display_Data_Channel).
# It allows to switch to a custom video input and get back in one key pressing.
#
# Dependencies:
# 1. ddcutil
# Example:
#
@livelace
livelace / sms2mattermost.sh
Created March 10, 2019 19:32
A bridge between smsd and mattermost.
#!/usr/bin/env bash
# This script acts as a bridge between smstools and mattermost.
#
# Dependencies:
# 1. curl
# 2. iconv
# 3. procmail
# Example of smsd.conf:
@livelace
livelace / grafana_dashboards.py
Created January 31, 2019 17:41
Take a screenshot of a Grafana dashboard.
#!/usr/bin/env python
import sys
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
@livelace
livelace / windows-set-mtu.bat
Created January 17, 2019 13:08
Different ways to set MTU at startup Windows based operating system.
@ECHO OFF
chcp 65001
SET FLAG="C:\testlab-common\tmp\MTU.flag"
SET MTU=1450
ECHO "INFO: Make directory for MTU flag."
mkdir "C:\testlab-common\tmp" 2> nul
@livelace
livelace / samba.conf
Created January 16, 2019 23:54
Sample of Samba configuration for Windows ACL support.
[global]
workgroup = EXAMPLE
server string = "data exchange"
# Active Directroy authentication settings
security = ADS
realm = EXAMPLE.COM
password server = dc1.example.com, dc2.example.com *
# Map Active Directory users to these ranges of UID/GID.