Skip to content

Instantly share code, notes, and snippets.

View hybridadmin's full-sized avatar

Tinashe Chikomo hybridadmin

View GitHub Profile
@msacks
msacks / gist:2848189
Created June 1, 2012 02:32
working snmpd.conf with ucd snmp mibs enabled
######################################################### #####################
#
# EXAMPLE.conf:
# An example configuration file for configuring the ucd-snmp snmpd agent.
#
########################################################## #####################
#
# This file is intended to only be an example. If, however, you want
# to use it, it should be placed in /usr/share/snmp/snmpd.conf.
# When the snmpd agent starts up, this is where it will look for it.
@gionn
gionn / import.sh
Created June 27, 2012 09:00
Migration script from Windows DNS to PowerDNS
#!/bin/bash
DOMAINARRAY=`cat /mnt/samba/winnt/system32/dns/domainlist`
for domainname in $DOMAINARRAY
do
echo " "
echo "$domainname being imported"
zone2sql --zone=$domainname.dns --gmysql --zone-name=$domainname | mysql -h
10.10.1.1 -D pdns -u pdns
echo "$domainname done!"
@growse
growse / unbound_to_graphite.sh
Created July 31, 2012 19:37
Output unbound statistics for sending to graphite
#!/bin/bash
/usr/sbin/unbound-control stats|grep -E '^total\.|^num\.' | sed 's/=/\t/' | gawk 'BEGIN{"hostname -f" | getline hstnm ; }; {print "unbound." hstnm "." $0"\t" strftime("%s")}'
@dguerri
dguerri / gist:4749098
Last active September 24, 2019 10:53
Growroot with LVM for OpenStack
#!/bin/bash
#
# This file is part of the UniCloud project
#
# Copyright (C) 2013 Unidata S.p.A. (Davide Guerri - d.guerri@rd.unidata.it)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@altrive
altrive / Test-RebootRequired.ps1
Last active August 3, 2023 14:34
Check pending reboot on local computer
#Based on <http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542>
function Test-RebootRequired
{
$result = @{
CBSRebootPending =$false
WindowsUpdateRebootRequired = $false
FileRenamePending = $false
SCCMRebootPending = $false
}
@s4553711
s4553711 / gist:9488399
Created March 11, 2014 15:41
Some example for subprocess.Popen exception example
#!/usr/bin/python
import subprocess
import os
import sys
#res = subprocess.Popen(['ls','-al','/ahome'],stdout=subprocess.PIPE,stderr=subprocess.PIPE);
#output,error = res.communicate()
#if res.returncode:
# #raise Exception(error)
@matejskubic
matejskubic / gist:10268126
Created April 9, 2014 13:06
Setup your IIS for SSL Perfect Forward Secrecy and TLS 1.2
### http://www.hass.de/content/setup-your-iis-ssl-perfect-forward-secrecy-and-tls-12
# Add and Enable SSL 3.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0' -Force
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0xffffffff' -PropertyType 'DWord' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force
# Add and Enable TLS 1.0 for client and server SCHANNEL communications
md 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0' -Force
@alzabo
alzabo / xmlrpc-distributed-brute-defense.conf
Last active October 9, 2020 09:51
WP/xmlrpc brute force ModSecurity rules
# These rules are designed to be effective versus /distributed/ brute force
# attacks. While they will function just as well against attacks which are
# /not distributed/ they will deny access to all XML-RPC method calls
# namespaced with the prefix "wp."
#
# An IP-based version of these rules may be more appropriate for sites which
# attacked from just a few distinct IP addresses.
#
# See http://alzabo.io/modsecurity/2014/09/15/wordpress-xml-rpc-brute-force.html
# for additional information
<#
.SYNOPSIS
Performs a SQL query and returns an array of PSObjects.
.NOTES
Author: Jourdan Templeton - hello@jourdant.me
.LINK
https://blog.jourdant.me/post/simple-sql-in-powershell
#>
function Invoke-SqlCommand() {
[cmdletbinding(DefaultParameterSetName="integrated")]Param (
@meanevo
meanevo / compile-openssl_102.sh
Last active March 14, 2023 11:41
Compile OpenSSL 1.0.2* from source on CentOS 7
# Make sure you have these installed
yum install -y make gcc perl pcre-devel zlib-devel
# Download/Extract source
wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
tar -zxf /tmp/openssl.tgz -C /tmp
cd /tmp/openssl-*
# Optional: Patch chacha20
# https://github.com/cloudflare/sslconfig/tree/master/patches
wget https://raw.githubusercontent.com/cloudflare/sslconfig/master/patches/openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch
patch -p1 < openssl__chacha20_poly1305_draft_and_rfc_ossl102j.patch