Skip to content

Instantly share code, notes, and snippets.

View xtha's full-sized avatar
💭
k8s,openstack

zsh xtha

💭
k8s,openstack
  • China
  • 19:23 (UTC +08:00)
View GitHub Profile
@robinsmidsrod
robinsmidsrod / ubuntu-install.gpxe
Created March 25, 2011 10:12
My work-in-progress ubuntu install iPXE script
#!ipxe
echo
echo Installing Ubuntu for ${hostname} from SAN
# Setup iSCSI root path
set root-path iscsi:nas.smidsrod.lan::::iqn.2011-02.lan.smidsrod:${hostname}.boot.ubuntu
set skip-san-boot 1
set keep-san 1
# Setup PXELinux options
# See http://syslinux.zytor.com/wiki/index.php/PXELINUX for details
@SEJeff
SEJeff / check_salt.py
Created March 27, 2012 04:08
nagios check to make sure the salt minion is available and responding to commands from @bastichelaar
#!/usr/bin/env python
import salt.cli.caller
import salt.config
import argparse
import sys
parser = argparse.ArgumentParser(description='Check if minions are online.')
parser.add_argument('hostname', help='The name of the minion to be checked')
args = parser.parse_args()
@gordonm
gordonm / gist:2896872
Created June 8, 2012 16:59
Salt state example
include:
- yum.omd
mon-required-pkgs:
pkg.installed:
- names:
- omd-0.54
- mod_ssl
- check_mk-agent-mon
- require:
@cemerson
cemerson / chrome.reg
Created October 3, 2013 17:33
Chrome Default Browser Registry keys
; REPLACE USERNAME w/your username
; ============ for Chrome Browser
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\http\shell\open\command]
@="\"C:\\Users\\USERNAME\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe\" -- \"%1\""
[HKEY_CURRENT_USER\Software\Classes\https\shell\open\command]
@="\"C:\\Users\\USERNAME\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe\" -- \"%1\""
@ipmb
ipmb / schedule.sls
Created December 17, 2013 18:05
Sample schedule pillar for Salmon
{% set minutes = 5 %}
{% set returner = "salmon_return" %}
schedule:
# all servers no args
{% for func in ['ps.physical_memory_usage', 'ps.virtual_memory_usage', 'ps.disk_io_counters', 'ps.network_io_counters'] %}
stat{{ loop.revindex }}:
function: {{ func }}
minutes: {{ minutes }}
returner: {{ returner }}
@rjsalts
rjsalts / discover_checkmk.yml
Created January 16, 2014 00:38
Ansible playbook to discover all the hosts which have the check_mk agent setup.
- hosts: all
vars:
- monitoring_agent : "nrpe_server"
tasks:
- name: test check_mk
local_action: wait_for port=6556 timeout=2 host={{inventory_hostname}}
register: check_mk
ignore_errors: True
- name: set fact
set_fact: monitoring_agent="check_mk_agent"
@DavidWittman
DavidWittman / mongo-ansible.py
Last active April 18, 2023 18:16
MongoDB-backed dynamic inventory script for Ansible
#!/usr/bin/env python
#
# MongoDB-backed dynamic inventory script for Ansible
# http://docs.ansible.com/intro_dynamic_inventory.html
import os
from argparse import ArgumentParser
import pymongo
@KonradIT
KonradIT / goproled.md
Last active October 19, 2017 16:25
DIY GoPro LED Indicator

When you are up there, ready to fly, you need to make sure your gopro is turned on, and recording. So you hope your GoPro is turned on and recording, you jump and fly... Then when you arrive, you press the shutter button to stop the gopro, but you dont hear anything. The story has just began.

###Parts

@lyoshenka
lyoshenka / ssl_oneline.sh
Created June 23, 2014 13:31
One-liner to create a self-signed SSL cert
#!/bin/bash
# http://stackoverflow.com/questions/10175812/how-to-build-a-self-signed-certificate-with-openssl
openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 10000
# if you don't want a password for your cert
openssl genrsa -out key.pem 4096 && openssl req -x509 -new -nodes -key key.pem -out cert.pem -days 10000 -subj "/CN=DOMAIN"
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();