From 999290053325e064d88760f5c52c98043d62d52c Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 16 Aug 2010 20:07:40 +0300 Subject: added cyclone --- LICENSE | 22 +--------------------- bloop.command | 2 +- build_rsync.sh | 2 ++ cyclone.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ hellyes.command | 1 + make_boot/makeboot.sh | 3 +++ mob2loc.sh | 1 + poweron.command | 2 ++ serverbackup.sh | 2 ++ useradd.sh | 2 +- 10 files changed, 56 insertions(+), 23 deletions(-) create mode 100755 cyclone.sh diff --git a/LICENSE b/LICENSE index 2705b08..059abc7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1 @@ -The MIT License - -Copyright (c) 2010 Filipp Lepalaan - -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 -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +This work is in the Public Domain. To view a copy of the public domain certification, visit http://creativecommons.org/licenses/publicdomain/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. diff --git a/bloop.command b/bloop.command index 45e643e..e21c7eb 100755 --- a/bloop.command +++ b/bloop.command @@ -3,7 +3,7 @@ # Launch applications and reboot the machine # @author Filipp Lepalaan # @author Vesa Viskari -# @copyright (c) 2010 Filipp Lepalaan +# @copyright No (c), Public Domain software MYDIR="~/Desktop/BlooperApps" diff --git a/build_rsync.sh b/build_rsync.sh index 249f282..6fd7834 100755 --- a/build_rsync.sh +++ b/build_rsync.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # build_rsync.sh # @author Filipp Lepalaan +# @copyright No (c), Public Domain software # Build the most recent version of rsync # with necessary patches. # All thanks to Mike Bombich @@ -41,6 +42,7 @@ cd rsync-${RSYNC_VERSION} echo "Building rsync..." patch -p1 + +if [[ $USER != "root" ]]; then + echo "Insufficient privileges!" 2>&1 + exit 1 +fi + +if [[ $# -lt 2 ]]; then + echo "Usage: $(basename $0) source destination" 2>&1 + exit 1 +fi + +SOURCE=$1 +TARGET=$2 + +TMPFILE="/tmp/$(uuidgen)" + +# Get size of source +diskutil info -plist $SOURCE > "${TMPFILE}".plist +SOURCE_SIZE=`defaults read $TMPFILE TotalSize` + +# Get size of destination +diskutil info -plist $TARGET > $TMPFILE +TARGET_SIZE=`defaults read $TMPFILE TotalSize` +rm $TMPFILE + +if [[ $TARGET_SIZE < $SOURCE_SIZE ]]; then + echo "Warning: target drive is smaller than source!" 2>&1 +fi + +if [[ $TARGET_SIZE == $SOURCE_SIZE ]]; then + echo "Drives are identical, cloning with dd..." + diskutil quiet unmountDisk $SOURCE + diskutil quiet unmountDisk $TARGET + dd bs=16m if="/dev/r${SOURCE}" of="/dev/r${TARGET}" conv=noerror,sync + diskutil quiet mountDisk $SOURCE + diskutil quiet mountDisk $TARGET + exit 0 +fi diff --git a/hellyes.command b/hellyes.command index cd857a0..bb4076b 100755 --- a/hellyes.command +++ b/hellyes.command @@ -2,6 +2,7 @@ # hellyeah.command # Do some stress testing # @author Filipp Lepalaan +# @copyright No (c), Public Domain software MYDIR=/private/tmp/_hellyeah CORES=$(sysctl hw.logicalcpu_max | cut -d : -f 2 | sed 's/ //') diff --git a/make_boot/makeboot.sh b/make_boot/makeboot.sh index 135d978..e65decd 100755 --- a/make_boot/makeboot.sh +++ b/make_boot/makeboot.sh @@ -3,6 +3,9 @@ # Create NetBoot Image from any OS X volume # Much of this is borrowed from DeployStudio/sys_builder.sh # usage makeboot..sh source destination +# http://pastebin.com/aJi3AxTe +# https://www.wiki.ed.ac.uk/display/DSwiki/Automating+the+creation+of+NetBoot+images +# http://clc.its.psu.edu/Labs/Mac/Resources/blastimageconfig/default.aspx if [ $USER != "root" ]; then echo "This must be run as root" diff --git a/mob2loc.sh b/mob2loc.sh index ad4c83c..a3f6b11 100755 --- a/mob2loc.sh +++ b/mob2loc.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Convert Mobile account to Local # @author Filipp Lepalaan +# @copyright No (c), Public Domain software if [[ $USER != "root" ]]; then echo "This tool must be run as root" >&2 diff --git a/poweron.command b/poweron.command index 3e04120..67324ea 100755 --- a/poweron.command +++ b/poweron.command @@ -1,4 +1,6 @@ #!/usr/bin/env bash +# @author Filipp Lepalaan +# @copyright No (c), Public Domain software ON_DELAY=20 OFF_DELAY=120 # this should always be > 60 diff --git a/serverbackup.sh b/serverbackup.sh index 68438e4..afa831c 100644 --- a/serverbackup.sh +++ b/serverbackup.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash # serverbackup.sh +# @author Filipp Lepalaan +# @copyright No (c), Public Domain software ODPASS=somepass # Password used to encrypt the OD archive CALDATA=/Library/CalendarServer/Documents diff --git a/useradd.sh b/useradd.sh index 9ad307f..1efd9d4 100644 --- a/useradd.sh +++ b/useradd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # useradd.sh v1.2 -# (cc) 2006 Filipp Lepalaan +# @copyright No (c), Public Domain software # Updated to support both Tiger & Leopard # Updated for Leopard by Allan Sanderson # Included non-interactive password setting - this is a contencious issue for -- cgit v1.2.3