Skip to content

Instantly share code, notes, and snippets.

@squadbox
squadbox / cool_gpu2.sh
Last active December 6, 2023 05:34
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <akohlmey@gmail.com>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds
@tylermakin
tylermakin / Multipart MIME Email.md
Last active May 7, 2024 21:24
Multipart MIME Email Guide

Multipart MIME Email Guide

This is a guide on how to send a properly formatted multipart email. Multipart email strings are MIME encoded, raw text email templates. This method of structuring an email allows for multiple versions of the same email to support different email clients.

// Example Multipart Email:
From: sender@example.com
To: recipient@example.com
Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string"
@slav0nic
slav0nic / custom_views.py
Created September 5, 2016 12:03
Django oscar authoprize.net backend
from django.db import transaction
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic import DeleteView
from oscar.core.loading import get_model
from apps.oscar_authorize.facade import Facade
@meain
meain / loading_messages.js
Last active July 22, 2024 13:32
Funny loading messages
export default [
"Reticulating splines...",
"Generating witty dialog...",
"Swapping time and space...",
"Spinning violently around the y-axis...",
"Tokenizing real life...",
"Bending the spoon...",
"Filtering morale...",
"Don't think of purple hippos...",
"We need a new fuse...",
@narenst
narenst / quota.py
Created August 13, 2019 19:00
programmatically view and increase aws quota using boto3
import argparse
import boto3
def get_value_for_quota_name(quotas, quota_name):
for quota in quotas:
if quota['QuotaName'] == quota_name:
return quota['Value'], quota['QuotaCode']
return None, None
@ixs
ixs / cimc-certgen.sh
Last active July 3, 2023 05:05
Cisco UCS CIMC/IMC Certificate Generator
#!/bin/bash
set -euo pipefail
#
# Use the Cisco IMC XML Interface to generate a CSR, use dehydrated to
# have this signed and upload the resulting cert back to the IMC.
# This script requires a working dehydrated setup, preferably using the
# DNS-01 ACME protocol.
#
@jamesmishra
jamesmishra / README.md
Last active March 25, 2024 20:02
Using Terraform to run a docker-compose.yml file directly on an Amazon EC2

Introduction

This is a Hashicorp Terraform module that provisions an AWS EC2 instance for the purpose of running a given docker-compose.yml file.

Usage

# ===== OUR MAGIC DOCKER-COMPOSE.YML FILE HERE =====
# It is also possible to get Terraform to read an external `docker-compose.yml`
# file and load it into this variable.
# We'll be showing off a demo nginx page.
@AdamEldred
AdamEldred / netbox_import.py
Last active December 28, 2021 16:14 — forked from rlaneyjr/netbox_import.py
Import the devicetype-library into NetBox
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: noai:et:tw=80:ts=4:ss=4:sts=4:sw=4:ft=python
'''
Title: netbox_import.py
Description: Insert records from devicetype-library into NetBox
Author: Ricky Laney
Version: 0.1.5
==============================================================================
import argparse
import atexit
import getpass
import time
from pyVim import connect
from pyVmomi import vim
def get_args():
@jpluimers
jpluimers / delimited vim-cmd help for each vmsvc command.txt
Created April 7, 2021 17:24
Delimited `vim-cmd help` for each `vmsvc` command
-----
help for vim-cmd help vmsvc/acquiremksticket
Usage: acquiremksticket vmid
Acquire mks ticket.
-----
help for vim-cmd help vmsvc/acquireticket