Skip to content

Instantly share code, notes, and snippets.

View bigbosst's full-sized avatar

Troy bigbosst

  • memes.bz
  • Anaheim Ca
View GitHub Profile
@bigbosst
bigbosst / etc_init.d_iptables
Last active December 22, 2015 06:09
iptables init script for Debian Wheezy
#! /bin/bash
### BEGIN INIT INFO
# Provides: iptables
# Required-Start: mountkernfs $local_fs
# Required-Stop: mountkernfs $local_fs
# X-Start-Before: networking
# X-Stop-After: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Iptables
@bigbosst
bigbosst / checkallzones.sh
Last active December 22, 2015 10:28
Bash script to check named configuration and all zone files included in the configuration. This is a bit customized at the moment, only using single configuration file and skipping the first value in the loop
#!/bin/bash
#
# Checks the Named Configuration then
# Checks all zones in the named.conf
#
# Written by Troy Germain
# Base location of named configuration file
NAMEDCONF="/etc/named.conf"
@bigbosst
bigbosst / logstash_init
Last active December 23, 2015 07:19 — forked from rtd/logstash.sh
Debian Wheezy Logstash Shipper Init Script
#! /bin/sh
#
# /etc/rc.d/init.d/logstash-shipper
#
# Starts Logstash as a daemon
#
# chkconfig: 2345 20 80
# description: Starts Logstash as a daemon
# pidfile: /var/run/logstash-shipper.pid
@bigbosst
bigbosst / logstash.bat
Last active December 23, 2015 18:59
Windows Event Config for Logstash
C:
cd C:\logstash
set HOME=c:/logstash/sincedb
> Hello,
>
> I need some help in understanding how to iterate thru array of hashes. I am
> basically pushing a hash into array and then passing the array to another
> function to iterate thru the values. I could do it parallely but I wanted to
> check the size of the array and make sure it is within the defined limits.
>
> Q: After passing the array, how can I iterate thru the entries to perform an
> LDAP-ADD. I am getting error adding. Any help or optimization for this?
>
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
@bigbosst
bigbosst / gist:89d11a1e40e437451af9
Last active August 29, 2015 14:07
Bacula - init script with configtest
#! /bin/sh
### BEGIN INIT INFO
# Provides: bacula-director
# Required-Start: $remote_fs $syslog
# Should-Start: bacula-fd postgresql mysql
# Required-Stop: $remote_fs $syslog
# Should-Stop: bacula-fd postgresql mysql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start Bacula Director at boot time
@bigbosst
bigbosst / b2disbackup
Created October 3, 2014 20:04
Bacula enable/disable individual Server backups, similar to a2ensite a2dissite (yes I know the '2' isn't needed I left it in the names, deal with it)
#!/usr/bin/perl
$file = @ARGV[0];
if($file eq "") {
print "Usage: b2disbackup <server-backup-config>\n";
exit 1;
}
unless(-e "/etc/bacula/backups-enabled/$file") {
#!/bin/bash
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# The remote machine must accept password authentication,
# one of the other keys in your ssh-agent,
# or accept the key passed with the Identity (-i) flag for this to work.
# -f : public identity to copy to the known_hosts file
@bigbosst
bigbosst / gist:7f0a8ef8809cb10e70e5
Last active August 29, 2015 14:11
irssi memes function
# memes.pl
use strict;
use warnings;
use LWP::Simple;
use Irssi;
our $VERSION = '1.0';
our %IRSSI = (
author => 'Troy Germain',