Skip to content

Instantly share code, notes, and snippets.

View hernad's full-sized avatar

Ernad Husremović hernad

View GitHub Profile
@yodermk
yodermk / centos8-9.sh
Created February 13, 2022 19:08
Commands to live-upgrade CentOS Streams 8 -> 9
# The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/
#
# It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here.
yum upgrade
reboot
dnf install epel-release
dnf install rpmconf
dnf install yum-utils
rpmconf -a # answer "n" to both things
# Rails production setup via SQLite3 made durable by https://litestream.io/
# Copy this to Dockerfile on a fresh rails app. Deploy to fly.io or any other container engine.
#
# try locally: docker build . -t rails && docker run -p3000:3000 -it rails
#
# in production you might want to map /data to somewhere on the host,
# but you don't have to!
#
FROM ruby:3.0.2
@henry40408
henry40408 / README.md
Last active June 4, 2022 12:45
How does Harvester mount volumes from Longhorn to virtual machine?
@dbkinghorn
dbkinghorn / user-data-server
Created September 28, 2021 21:49
Ubuntu 20.04 user-data files for autoinstall ISO
#cloud-config
autoinstall:
version: 1
refresh-installer: # start with an up-to-date installer
update: yes
interactive-sections: # Install groups listed here will wait for user input
- storage
storage: # should set the interactive default but doesn't seem to work??
layout:
name: direct
@djfdyuruiry
djfdyuruiry / README.md
Last active April 28, 2024 08:34
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@thiagosf
thiagosf / centos-apache-fix.md
Created July 30, 2019 23:45
CentOS and Apache: Permission denied

Error

[Tue Jul 30 23:32:08.018098 2019] [proxy:error] [pid 1845] (13)Permission denied: AH00957: HTTP: attempt to connect to 0.0.0.0:3000 (0.0.0.0) failed
[Tue Jul 30 23:32:08.018168 2019] [proxy:error] [pid 1845] AH00959: ap_proxy_connect_backend disabling worker for (0.0.0.0) for 60s

Resolution

@CakJuice
CakJuice / odoo12_custom_report_template.xml
Created May 24, 2019 06:03
Odoo 12 custom report template
<odoo>
<record model="report.paperformat" id="paperformat_attendance_recap_report">
<field name="name">paperformat.attendance.recap.report</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_width">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">30</field>
<field name="margin_right">5</field>
@guss77
guss77 / reset-tb
Last active April 11, 2024 05:11
Script to reset the XHCI of a Thunderbolt connection in case the kernel stops it
#!/bin/bash
# As described in https://bugs.launchpad.net/bugs/1766076
### Installation Instructions:
# 1. Install file into `/usr/local/bin/reset-tb`
#
# 2. Optional: allow password less sudo by creating a file `/etc/sudoers.d/allow-reset-tb` with the following content:
# ----8<-----
# <your username> ALL = NOPASSWD: /usr/local/bin/reset-tb
# ----8<-----
#
@mcastelino
mcastelino / VFIO_nested.md
Last active February 5, 2024 09:34
QEMU VFIO in Nested VM vIOMMU

How to use VFIO to assign a device to nested VM

  • Here the vfio-pci device is passed in into the L1 VM
  • The L1 VM is setup with kernel_irqchip=split
  • The L0 exposes a virtual IOMMU to the L1 VM
qemu-system-x86_64 \
    -machine q35,accel=kvm,kernel_irqchip=split \
    -enable-kvm \
@penzoiders
penzoiders / onlyoffice_documentserver_centos7.sh
Last active January 1, 2021 14:13
Install OnlyOffice Document Server on clean CentOS 7 base without asking anything + oneliner to get SSL cert from Let's Encrypt
#!/bin/bash
# Install OnlyOffice Document Server on clean CentOS 7 base (may not work on non fresh systems) without asking anything
# HOW TO: just open a root terminal and brutally copy/paste this gist to your shell.
# SSL READY: featuring also a lazy-boy-style oneliner to get SSL cert from Let's Encrypt ( see bottom of this gist )
curl -sL https://rpm.nodesource.com/setup_8.x | bash -
cat << EOF > /etc/yum.repos.d/nginx.repo
[nginx]