Skip to content

Instantly share code, notes, and snippets.

@sameo
sameo / vfio.md
Last active April 27, 2024 16:20

VFIO

Not KVM bound. The VFIO API deconstructs a device into regions, irqs, etc. The userspace application (QEMU, cloud-hypervisor, etc..) is responsible for reconstructing it into a device for e.g. a guest VM to consume.

Boot with intel_iommu=on.

IOMMU groups

Devices are bound together for isolation, IOMMU capabilities and platform topology reasons. It is not configurable.

@mohanpedala
mohanpedala / ssh_agent_forwarding_ansible.md
Created February 2, 2019 19:00
Ansible with SSH Agent Forwarding Tag: Bastion host
  • Create a “config” file that will be used by SSH-agent to do the forwarding of SSH connection.
$ cd .ssh
$ touch config
$ chmod 600 config
$ sudo vi config
SSH-agent forwarding
Host 
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active July 5, 2024 12:40
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
@Susensio
Susensio / numpy_lru_cache.md
Last active October 26, 2023 16:10
Make function of numpy array cacheable

How to cache slow functions with numpy.array as function parameter on Python

TL;DR

from numpy_lru_cache_decorator import np_cache

@np_cache()
def function(array):
 ...
@odavid
odavid / Jenkins-delete-lockable-resources
Created September 14, 2017 15:55
A short script to delete free locks from the lockable resources plugin
def manager = org.jenkins.plugins.lockableresources.LockableResourcesManager.get()
def resources = manager.getResources().findAll{
!it.locked
}
resources.each{
manager.getResources().remove(it)
}
manager.save()
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@devynspencer
devynspencer / ansible-github.yml
Last active September 23, 2023 08:37
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@abadger
abadger / gist:d3d1917cb9cb7b1cf31454f0c726e41b
Last active October 24, 2023 11:39
Documentation on how Ansible modules are made ready to be executed on a remote system.
=======
Modules
=======
This is an in-depth dive into understanding how Ansible makes use of modules.
It will be of use to people working on the portions of the Core Ansible Engine
that execute a module, it may be of interest to people writing Ansible Modules,
and people simply wanting to use Ansible Modules will likely want to read
a different paper.