Skip to content

Instantly share code, notes, and snippets.

View furu-nob's full-sized avatar

Nobuyuki Furuyama furu-nob

View GitHub Profile
#!/bin/sh
function USAGE {
cat <<EOL
Script for output NewKEY file and CSR file
Usage $0
$0 www.example.jp
Output
KEYFILE: ${KEYDIR}/www.example.jp.2018.nopass.key
CSRFILE: ${CSRFILE}/www.example.jp.2018.csr
@furu-nob
furu-nob / check_milter.pl
Created August 12, 2016 04:34
Nagios check_milter.pl
#!/usr/bin/env perl
##############################################################################
# Program to check to make sure milter is running and report back to nrpe
# for nagios. The defalt port here is for DKIM which is commonly found on
# port 8891 and default host is localhost
# Created: 2015-06-18
# Version: 1.0.1
# Author: Alex Schuilenburg
##############################################################################
#!/bin/bash
#
# Origin https://exchange.nagios.org/directory/Plugins/Network-Protocols/HTTP/check_http_curl-2Esh/details
#
# This script connects to a site via curl and searches for a string in the web page.
# If the string is not found it throws out an error and Nagios exit is set to 'critical'.
##
# Ver. 0.1a
# Last modified by Roberto Carraro on 20150528
#
@furu-nob
furu-nob / rules-both.iptables
Created July 27, 2016 01:42 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
#!/bin/sh
function USAGE {
cat <<EOL
Script for create password.
Usage
$0 [count]
EOL
exit 0
@furu-nob
furu-nob / dns_check_existence.sh
Last active August 29, 2015 14:02
dns_check_existence.sh
#!/bin/sh
# Version 140624_1534
NAGIOS_CHECK_DNS_COMMAND='/usr/local/nagios/libexec/check_dns'
HOSTNAME=$1
EXITSTATUS='1' # Defaults
function usage {
cat <<-EOF
$(basename ${0}) is check HOSTMANE and IPAddress on DNS server.
@furu-nob
furu-nob / grep_hostname_httpd_conf.sh
Last active August 29, 2015 14:02
grep_hostname_httpd_conf.sh
#!/bin/sh -f
# version 20140623.1146
DNSCHECK_SH='/root/scripts/onetime/dns_check_existence.sh'
CONF_FROM_DIR=$(find /etc/httpd/conf.d/ -name *.conf -print)
HTTPDCONF="/etc/httpd/conf/httpd.conf $CONF_FROM_DIR"
GREP_VIRTUAL=$(cat $HTTPDCONF | grep -v ^# |grep -iE 'Virtual|alias |servername|documentroot'|grep -v ScriptAlias|sed -e "s/^[[:space:]]*//"|grep -v ^# |grep -v ^$)
#!/bin/sh
# For stat version: 2.2
# If you use New Version maybe can use printf Option.
function usage {
cat <<-EOF
$(basename ${0}) is a tool for file copy same parmission, owner and group as DEST.
Usage: $(basename ${0}) from_file to_file
EOF
}
#!/bin/bash
### User Settings (things you must set)
## Location of the dnscurl.pl script
DNSCurl="/path/to/route53DynDNS/dnscurl.pl"
## The host name you wish to update/create
myHostName="*"
## Zone/domain in which host (will) reside(s)
myDomainName="example.com"