Skip to content

Instantly share code, notes, and snippets.

@EmmanuelKasper
EmmanuelKasper / gist:f24cc7088b206ea0ec87
Last active Apr 28, 2021
Proxmox Text Terminal Howto
View gist:f24cc7088b206ea0ec87

Map a virtual serial port on the guest(ttyS0) to a pseudo terminal(pty) on the host This has to be added to /etc/pve/qemu-server/VMID.conf:

args: -device isa-serial,chardev=myChardevice,id=s -chardev pty,id=myChardevice

After starting the VM check you will see a message:

char device redirected to /dev/pts/7 (label myChardevice)

Inside the guest, you should see now the serial port:

View gist:0563efab29127fc187a784af4ee6e659
From: Emmanuel Kasper <manu@xx.yy>
Date: Fri, 2 Apr 2021 14:25:28 +0200
Subject: [PATCH] Use absolute path to oc binary, as we install it outside of
$PATH
---
.../openshift-4-cluster/tasks/post-install-storage-nfs.yml | 2 +-
ansible/roles/openshift-4-cluster/tasks/post-install.yml | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
@EmmanuelKasper
EmmanuelKasper / EFI boot on Lenovo Thinkcenter M92Z
Last active Jan 16, 2021
EFI boot on Lenovo Thinkcenter M92Z
View EFI boot on Lenovo Thinkcenter M92Z
# disable secure boot in the bios, in menu security
# downlad and unzip refind-bin-0.7.8.zip
# install refind, assuming your ESP partition is /dev/sda1 and mounted in /boot/efi
cd refind-bin-0.7.8
./install.sh
# type y and go ahead
# at that time your boot entry should look like that
@EmmanuelKasper
EmmanuelKasper / bmi.py
Last active Dec 25, 2019
Different line joinings in pyton
View bmi.py
#!/usr/bin/python3
def output():
# explicit line joining with backslash (prefered for simple strings)
print("let's do some calculations \
of the body mass index")
# explicit line joining with operator # generally prefered, allows to keep indentation consistent
# PEP 8 recommends operator on the next line
print(f"weight: 75, size: 1.77 "
+ f"bmi: {bmi_calc(75,1.77)}")
@EmmanuelKasper
EmmanuelKasper / convert.sh
Last active Jan 13, 2019
Convert images for Atari ST resolution
View convert.sh
# with dithering
convert input.jpg -resize 640x400\! -colorspace gray -colors 2 -normalize output.gif
# without dithering, strong separation
convert input.jpg -resize 640x400\! -colorspace gray +dither -colors 2 -normalize output.gif
# see http://www.multipole.org/discourse-server/viewtopic.php?t=34042 for background
# convert to low resultion for atari ST 16 colors / 4096 palette
convert rio_hill.jpg -colors 16 -depth 4 -resize 320x200\! rio.gif
@EmmanuelKasper
EmmanuelKasper / create_gif.sh
Created Jul 10, 2015
Create gif file with avconf
View create_gif.sh
#export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
#assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif
@EmmanuelKasper
EmmanuelKasper / wget.js
Last active Aug 8, 2018
Nodejs shell like programming: calling an external command and returning output to stdout
View wget.js
#! env node
// execFileSync will call the command directly without using a shell, a tad faster and prevents interpretation of characters
// ( similar to C and java exec )
const exec = require('child_process').execFileSync;
// inherit will use the stdio of the parent process, ie this nodejs script
exec('wget', ['https://git.kernel.org/torvalds/t/linux-4.18-rc8.tar.gz', '--output-document', '/tmp/bla'], {stdio:'inherit'});
@EmmanuelKasper
EmmanuelKasper / kvm-autostable
Last active Feb 21, 2018
A script to automatically install Debian Wheezy on a KVM guest
View kvm-autostable
#!/bin/sh
# You can optionally connect to the VM with
# virt-viewer -c qemu:///system Debian7
export OS=Debian7
virt-install \
--connect qemu:///system \
--name ${OS} \
--ram 1024 \
--vcpus 1 \
@EmmanuelKasper
EmmanuelKasper / vmake.pl
Created Oct 13, 2017
Make wrapper to execute make file in a sandbox VM
View vmake.pl
#!/usr/bin/perl
use strict;
use warnings;
use English;
use Sys::Virt;
use Net::OpenSSH;
use File::Spec;
use File::Basename;
use Cwd 'realpath';
View gist:b5fff82c06a9287935bf

commands

#client 
iperf -c pf -i 1 -t 60
#server
iperf -s

server side result vr2: VIA VT6105M Rhine III 10/100BaseTX