Skip to content

Instantly share code, notes, and snippets.

View meaksh's full-sized avatar
🏠
Working from home

Pablo Suárez Hernández meaksh

🏠
Working from home
View GitHub Profile
@meaksh
meaksh / salt-api-deadlock.Dockerfile
Last active February 14, 2024 10:39
Dockerfile to create a container with Salt API / Salt SSH environment to replicate importlib deadlock
FROM registry.suse.com/bci/bci-base:15.4
RUN zypper in -y salt-api salt-master openssh curl vim
RUN echo "admin:admin" > /tmp/users
RUN salt-call --local tls.create_self_signed_cert
RUN chown -R salt:salt /etc/pki/tls/certs/
RUN <<EOF cat >> /etc/salt/master.d/custom.conf
#!/usr/bin/python3
#-*- coding: utf-8 -*-
# This is just a fixed version of https://gist.github.com/moio/13030dbf575f998cdd6bcc430da6c4fe
import subprocess
import sys
import zmq
SERVER_ADDRESS = "tcp://127.0.0.1:4505"
@meaksh
meaksh / libcloud_example.py
Created September 11, 2019 13:09
List virtual instances from AWS, Azure and Google Compute Engine using libcloud
#-*- coding: utf8 -*-
# AWS related variables
AWS_ACCESS_KEY_ID = "EXAMPLE"
AWS_SECRET_ACCESS_KEY = "EXAMPLE"
AWS_REGION = "us-east-2"
# Azure related variables
AZURE_SUBSCRIPTION_ID = "EXAMPLE"
AZURE_APPLICATION_ID = "EXAMPLE"
# -*- coding: utf-8 -*-
'''
This grain module is only loaded in case of a public cloud instance.
Supported Instances: AWS EC2, Azure and Google Compute Engine instances
Returns a grain called "instance_id" containing the virtual instance ID
according to the Public Cloud provider. The data is gathered using the
internal API available from within the instance.
@meaksh
meaksh / salt-master-tracemalloc.py
Last active August 7, 2019 15:52
tracemalloc stats dumper for salt-master
import tracemalloc
import threading
from salt.scripts import salt_master
import signal
import sys
stop_flag = False
def print_stats():

Keybase proof

I hereby claim:

  • I am meaksh on github.
  • I am meaksh (https://keybase.io/meaksh) on keybase.
  • I have a public key ASD_b9Svy2NriOsLO_9LzrezIG4LOGnC0z9eX6J-eDsYIgo

To claim this, I am signing this object: