Skip to content

Instantly share code, notes, and snippets.

Rui Lopes rgl

Block or report user

Report or block rgl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@rgl
rgl / error.md
Last active Jul 17, 2019
k3s-server fails to start with --disable-agent
View error.md

Errors while installing k3s with --disable-agent.

I'm using my rgl/k3s-vagrant environment to try this out. I've used the following command to start the vagrant environment:

vagrant up --provider=libvirt s1 # see https://github.com/rgl/k3s-vagrant/blob/master/provision-k3s-server.sh

which will eventually install k3s and error out:

@rgl
rgl / installer-syslog.txt
Created Jul 9, 2019
I'm trying to use https://github.com/rgl/debian-vagrant to create a buster vagrant box, but on virtualbox it fails with https://pasteboard.co/ImUOUzF.png ... any idea why? after I click Continue it works fine. It also works fine when I use libvirt instead of virtualbox.
View installer-syslog.txt
This file has been truncated, but you can view the full file.
Jul 7 19:26:43 syslogd started: BusyBox v1.30.1
Jul 7 19:26:43 kernel: klogd started: BusyBox v1.30.1 (Debian 1:1.30.1-4)
Jul 7 19:26:43 kernel: [ 0.000000] Linux version 4.19.0-5-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-7)) #1 SMP Debian 4.19.37-5 (2019-06-19)
Jul 7 19:26:43 kernel: [ 0.000000] Command line: BOOT_IMAGE=/install.amd/vmlinuz initrd=/install.amd/initrd.gz auto=true url=10.0.2.2:8616/preseed.txt hostname=vagrant domain=home net.ifnames=0 BOOT_DEBUG=2 DEBCONF_DEBUG=5
Jul 7 19:26:43 kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jul 7 19:26:43 kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Jul 7 19:26:43 kernel: [ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Jul 7 19:26:43 kernel: [ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
@rgl
rgl / deb-tree-graph.sh
Last active Jun 3, 2019
debian package tree graph
View deb-tree-graph.sh
# XXX failed attempt at getting a single graph with all the package dependencies...
mkdir tmp
cd tmp
for pkg in `grep-status --not --field=Package --eq '' --show-field=Package -n`; do
debtree --show-installed "$pkg" >"$pkg.dot"
done
cat *.dot | grep -v digraph | grep -v '}'| (echo 'strict digraph "root" {';cat;echo '}') | dot | neato -n2 -Tpng -o example.png
@rgl
rgl / try-vagrant-triggers-experimental.rb
Created May 27, 2019
an example on how to see which vagrant triggers exist
View try-vagrant-triggers-experimental.rb
# NB before running this you need to export an environment variable: export VAGRANT_EXPERIMENTAL='typed_triggers'
# see https://www.vagrantup.com/docs/triggers/configuration.html#trigger-types
# NB to see all triggers you need to edit your vagrant source code:
# sudo vim /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/plugin/v2/trigger.rb
# and add a @ui.info to see all trigger action stages, et all:
# NB see https://github.com/hashicorp/vagrant/blob/v2.2.4/lib/vagrant/plugin/v2/trigger.rb
# # Fires all triggers, if any are defined for the action and guest. Returns early
# # and logs a warning if the community plugin `vagrant-triggers` is installed
# #
# # @param [Symbol] action Vagrant command to fire trigger on
@rgl
rgl / docker-build-log.txt
Created Jan 14, 2019
swtpm build failure
View docker-build-log.txt
rgl@rgl-desktop:~/Projects/swtpm$ docker build -t build-swtpm-ubuntu-18.04 -f Dockerfile.ubuntu-18.04 .
Sending build context to Docker daemon 3.927MB
Step 1/9 : FROM ubuntu:18.04
---> 1d9c17228a9e
Step 2/9 : RUN apt-get -y update && apt-get -y install build-essential fakeroot devscripts equivs
---> Using cache
---> 3702a1c0519d
Step 3/9 : ENV DEBIAN_FRONTEND noninteractive
---> Running in 97d7d40c7e1a
Removing intermediate container 97d7d40c7e1a
@rgl
rgl / Start-WrappedProcess.ps1
Created Jan 6, 2018
Run a process and capture its stdout and stderr to a file
View Start-WrappedProcess.ps1
# converts/escapes a string to a command line argument.
function ConvertTo-CommandLineArgument {
# Normally, an Windows application (.NET applications too) parses
# their command line using the CommandLineToArgvW function. Which has
# some peculiar rules.
# See http://msdn.microsoft.com/en-us/library/bb776391(VS.85).aspx
#
# TODO how about backslashes? there seems to be a weird interaction
# between backslahses and double quotes...
process {
@rgl
rgl / export-windows-ca-certificates.ps1
Last active Nov 1, 2017
export-windows-ca-certificates
View export-windows-ca-certificates.ps1
# dump all the windows trusted roots into a ca file.
$pems = New-Object System.Text.StringBuilder
Get-ChildItem Cert:\LocalMachine\Root | ForEach-Object {
# $_ is-a System.Security.Cryptography.X509Certificates.X509Certificate2
Write-Host "Exporting the $($_.Issuer) certificate..."
[void]$pems.AppendLine('-----BEGIN CERTIFICATE-----')
[void]$pems.AppendLine(
[Convert]::ToBase64String(
$_.Export('Cert'),
'InsertLineBreaks'));
@rgl
rgl / show-youtube-playlist.md
Created Oct 22, 2017
show a youtube playlist metadata
View show-youtube-playlist.md

Download the youtube-dl binary:

wget -q https://github.com/rg3/youtube-dl/releases/download/2017.10.20/youtube-dl
chmod +x youtube-dl
./youtube-dl --version

Download the playlist metadata, prefering audio:

@rgl
rgl / TlsServerCertificateChainExporter.ps1
Created May 17, 2017
Export a given server certificate chain into local independent files
View TlsServerCertificateChainExporter.ps1
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
trap {
Write-Output "ERROR: $_"
Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1')
Write-Output (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1')
Exit 1
}
Add-Type @'
@rgl
rgl / whoami.ps1
Created May 1, 2017
whoami for Windows Nano Server
View whoami.ps1
# whoami for Nano Server.
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
trap {
Write-Output "ERROR: $_"
Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1')
Write-Output (($_.Exception.ToString() -split '\r?\n') -replace '^(.*)$','ERROR EXCEPTION: $1')
You can’t perform that action at this time.