Skip to content

Instantly share code, notes, and snippets.

View Mstaaravin's full-sized avatar

Mstaaravin Mstaaravin

View GitHub Profile
@ianblenke
ianblenke / zil_and_arc.sh
Last active December 1, 2021 11:35
FreeBSD ZFS: Putting a ZIL mirror and an L2ARC on only 2 SSD drives
#!/bin/bash
# Based on this blog post: https://clinta.github.io/FreeNAS-Multipurpose-SSD/
set -xe
ssd1=ada2
ssd2=ada3
pool=tank
gpart create -s gpt $ssd1
gpart create -s gpt $ssd2
gpart add -a 4k -b 128 -t freebsd-zfs -s 30G $ssd1
#!/bin/sh
#
# Copyright (c) 2015, Grogdor.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@Grogdor
Grogdor / tsBattleBanner.sh
Last active November 8, 2015 23:37
TeamSpeak banner with upcoming CW battles
#!/bin/sh
#
# Copyright (c) 2015, Grogdor.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@arthurzenika
arthurzenika / poodlebleed.sls
Created October 15, 2014 09:22
poodlebleed.sls for saltstack deploymenet of poodel vulnerability in SSLv3
{% if salt['pkg.version']('apache2') %}
poodle apache server restart:
service.running:
- name: apache2
{% for foundfile in salt['cmd.run']('rgrep -m 1 SSLProtocol /etc/apache*').split('\n') %}
{% if 'No such file' not in foundfile and 'bak' not in foundfile and foundfile.strip() != ''%}
poodle {{ foundfile.split(':')[0] }}:
file.replace:
- name : {{ foundfile.split(':')[0] }}
- pattern: "SSLProtocol all -SSLv2[ ]*$"
@djs52
djs52 / check_salt.py
Created October 13, 2014 10:56
Simple Nagios Salt check
#!/usr/bin/env python
import salt.client
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()
@oroce
oroce / basic-usage.js
Last active April 1, 2017 15:12
This is just a proof of concept demo to parse haproxy log and put into Google Analytics.
var haproxyLog = new HaProxyLog({
port: process.env.PORT||3333
});
haproxyLog
.on( "up", console.log.bind( console, "Server is up" ) )
.on( "down", console.log.bind( console, "Server is down" ) )
.on( "backend-down", console.log.bind( console, "Backend is down" ) )
.on( "access-log", console.log.bind( console, "access log entry:" ) )
.on( "raw", function( message ){console.log( "this is the raw message:", message.toString() ) });