Skip to content

Instantly share code, notes, and snippets.

@mrschyte
mrschyte / terraform-libvirt-virtiofs.xsl
Created December 30, 2024 11:27
XSL transform for supporting virtiofs using libvirt terraform provider
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<!-- copy the whole xml doc to start with -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

Keybase proof

I hereby claim:

  • I am mrschyte on github.
  • I am pkasza (https://keybase.io/pkasza) on keybase.
  • I have a public key ASB0Lv2ykldeY0K3Gin2cqQMB6vEo6pFutezn5A7ZGY3Zwo

To claim this, I am signing this object:

rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.
@mrschyte
mrschyte / avg.py
Created November 11, 2019 11:03
Running average
import random
_avg = None
_min = None
_max = None
num = []
n = 0
for i in range(10):
k = random.randint(0, 10)
num.append(k)
@mrschyte
mrschyte / 01-undeploy.log
Created October 23, 2019 18:01
Debug logs for linstor_un undeploy/redeploy
[Wed Oct 23 19:53:45 CEST 2019] /var/lib/one/remotes/tm/linstor_un/mv nebula01:/var/lib/one//datastores/106/192/disk.0 nebula01:/var/lib/one//datastores/106/192/disk.0 192 107
+ '[' 1 '!=' 1 ']'
+ SRC=nebula01:/var/lib/one//datastores/106/192/disk.0
+ DST=nebula01:/var/lib/one//datastores/106/192/disk.0
+ VMID=192
+ DSID=107
+ '[' -z '' ']'
+ TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
++ dirname /var/lib/one/remotes/tm/linstor_un/mv
+ DRIVER_PATH=/var/lib/one/remotes/tm/linstor_un
@mrschyte
mrschyte / deploy.log
Created October 23, 2019 09:23
nebula vm deploy log
Wed Oct 23 11:14:46 2019 [Z0][VM][I]: New state is ACTIVE
Wed Oct 23 11:14:46 2019 [Z0][VM][I]: New LCM state is PROLOG
Wed Oct 23 11:15:03 2019 [Z0][VM][I]: New LCM state is BOOT
Wed Oct 23 11:15:03 2019 [Z0][VMM][I]: Generating deployment file: /var/lib/one/vms/183/deployment.0
Wed Oct 23 11:15:05 2019 [Z0][VMM][I]: Successfully execute transfer manager driver operation: tm_context.
Wed Oct 23 11:15:05 2019 [Z0][VMM][I]: Successfully execute network driver operation: pre.
Wed Oct 23 11:15:07 2019 [Z0][VMM][I]: ExitCode: 0
Wed Oct 23 11:15:07 2019 [Z0][VMM][I]: Successfully execute virtualization driver operation: deploy.
Wed Oct 23 11:15:07 2019 [Z0][VMM][I]: Successfully execute network driver operation: post.
Wed Oct 23 11:15:07 2019 [Z0][VM][I]: New LCM state is RUNNING
@mrschyte
mrschyte / nmap-converter-mac.patch
Created October 12, 2019 18:26
Show MAC addresses in NMAP converter reports
diff --git a/nmap-converter.py b/nmap-converter.py
index 0bafb52..f1827a6 100755
--- a/nmap-converter.py
+++ b/nmap-converter.py
@@ -30,9 +30,10 @@ def generate_hosts(workbook, sheet, report):
sheet.autofilter("A1:E1")
sheet.freeze_panes(1, 0)
- hosts_header = ["Host", "IP", "Status", "Services", "OS"]
+ hosts_header = ["Host", "IP", "MAC", "Status", "Services", "OS"]
@mrschyte
mrschyte / barchart.tex
Created September 29, 2019 17:17
Small LaTeX macro to plot bar charts
\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\newcommand{\plotbars}[1]
{
\begin{tikzpicture}
\newcounter{length}
\foreach \n [count=\k] in #1 {
\stepcounter{length}
@mrschyte
mrschyte / maven.xslt
Created January 30, 2019 19:21
Replace maven parent version with LATEST
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://maven.apache.org/POM/4.0.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="ns0:parent/ns0:version/text()">LATEST</xsl:template>
</xsl:stylesheet>
#!/bin/sh
version="$1"
bootdir=/boot
# passing the kernel version is required
[ -z "${version}" ] && exit 0
# absolute file name of kernel image may be passed as a second argument;
# remove the initrd from the same directory