This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
################################################################## | |
# Copyright (C) 2012 - Jon Agland # | |
# # | |
# 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 2 # | |
# of the License, or (at your option) any later version. # | |
# # | |
# This program is distributed in the hope that it will be useful,# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH=$PATH:/usr/sbin | |
VCBSNAP="/usr/sbin/vcbSnapAll" | |
USERNAME="" | |
PASSWORD="" | |
HOST="vcenter" | |
DEST="/vmfs/volumes/nnnnnnnn-nnnnnnnn" | |
$VCBSNAP -h $HOST -u $USERNAME -p $PASSWORD -a powerstate:on -r $DEST -M 1 | |
cp /usr/scripts/backup-vm.log $DEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This a dirty script to remove any VCB Backup snapshosts - see my vm-backup.sh in gist | |
PATH=$PATH:/usr/sbin | |
VCBVMNAME="/usr/sbin/vcbVmName" | |
VCBSNAP="/usr/sbin/vcbSnapshot" | |
VMLIST=$(/usr/sbin/vcbVmName -h vcenter -u username -p password -s powerstate:on | grep moref | awk -F\: '{ print $2 }' | |
for i in $VMLIST; | |
do | |
SNAPNAME=$(/usr/sbin/vcbSnapshot -h vcenter -u username -p password -f moref:$i "_VCB-BACKUP_" | grep "SsId:" | awk -F: '{ print $2 }') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You need a user called backup on the pfsense box and | |
# the SSH key of the user running this script shared. | |
HOSTS='' | |
for HOST in $HOSTS | |
do | |
scp -B -q backup@$HOST:/conf/config.xml ~/pfsense/$HOST-config.xml | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Use this to create a local pfSense mirror as the updates | |
# can sometimes be a bit slow in the UK, useful if you have multiple boxes. | |
# you can specify multiple URLs, in this case grabbing x86 and amd64 | |
TMPFILE=`mktemp` | |
updateurl='http://updates.pfsense.org' | |
urls='_updaters _updaters/amd64' | |
dest='/var/www/localhost/htdocs/pfsense' | |
for j in $urls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Handy script for submitting swipes to the timeware system. | |
# Once wrapped it with Zenity so that I could be prompted to swipe on login to my PC | |
# If you were deceitful you could use cron - Don't hold me responsible if you get sacked! | |
TMPFILE=`mktemp` | |
curl -b $TMPFILE -c $TMPFILE --data "txtUserName=username&txtPassword=password&cmdLogIn=Log%20In" -i http://timeware/log_in.html | |
curl -b $TMPFILE -c $TMPFILE --data "cmdSubmit=Submit%20Booking" -i http://timeware/attendance_booking.html | |
rm $TMPFILE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/runscript | |
# Copyright 1999-2012 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# This a wrapper for the vmware-tools init script, as it doesn't seem to work well under Gentoo. | |
extra_started_commands="reload" | |
depend() { | |
need logger | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################## | |
# Copyright (C) 2013 - Jon Agland # | |
# # | |
# 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 2 # | |
# of the License, or (at your option) any later version. # | |
# # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generate Address List from Aliases and drop an e-mail with an txt attachment | |
# Useful for importing to other mail systems that require a list of valid addresses | |
# for a particular domain. | |
if [ "$1" == "" ] | |
then | |
echo "Give me your email address..." | |
else | |
TMPFILE=`mktemp` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILES=`ls -1 /var/lib/tcpdump` | |
for j in $FILES | |
do | |
tcpdump -q -r "/var/lib/tcpdump/"$j "$@" | |
done | |
OlderNewer