This file contains hidden or 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 | |
set -e | |
[[ $# != 2 ]] && echo "Usage: $0 projectDir snapshot.zip" && exit 1 | |
projectDir=$1 | |
snapZip=$2 | |
tmpDir=$(mktemp -d) | |
unzip -d $tmpDir $snapZip | |
jarFiles=$(find $projectDir -name gdx*.jar) |
This file contains hidden or 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 | |
STATS_DIR=/var/adm/localstats/iostats | |
mkdir -p -m750 $STATS_DIR | |
function prefix_date { | |
is_device=0 | |
while read line; | |
do | |
STATS_FILE=$STATS_DIR/iostats_$(date +"%Y%m%d").txt |
This file contains hidden or 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
""" | |
This script updates applications using the EARs placed on a specified dir | |
Usage: | |
wsadmin.sh -lang jython -f update_apps_from_dir.py apps_dir | |
""" | |
import os | |
import glob |
This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
# This scrip adds users from a list of users, sets them a random password | |
# and forces their password to change on the first login. | |
# If the username already exists it will be silently skipped | |
# The list of users and passwords being created are printed | |
# Add the list of users (txt format) into the following user_data variable | |
# The format is: username real name |
This file contains hidden or 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/sh | |
# This script reports the last backup status by checking the TSM scheduler log | |
[[ ! -f /opt/tivoli/tsm/client/ba/bin/dsm.sys ]] \ | |
&& echo "$(hostname);Config file not found" && exit 0 | |
SCHEDLOGNAME=$(grep -i SCHEDLOGN /opt/tivoli/tsm/client/ba/bin/dsm.sys | awk '{ print $2}') | |
LAST_MSG=$(grep "Elapsed processing time" $SCHEDLOGNAME| tail -1) | |
[[ -z "$LAST_MSG" ]] && LAST_MSG=$(grep "ANS1353E" $SCHEDLOGNAME| tail -1) | |
[[ -z "$LAST_MSG" ]] && LAST_MSG=$(tail -1 $SCHEDLOGNAME) | |
[[ -z "$LAST_MSG" ]] && LAST_MSG=$(tail -2 /var/log/dsmsched.log | head -1) | |
echo "$(hostname);$LAST_MS |
This file contains hidden or 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 | |
# | |
# /etc/init.d/nmon | |
# | |
# chkconfig: 345 70 55 | |
# description: nmon init script | |
# Source function library. | |
. /etc/init.d/functions |
This file contains hidden or 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
tar -C / -czvpf /system_backup.tar.gz \ | |
--one-file-system \ | |
--exclude=run \ | |
--exclude=sys \ | |
--exclude=dev \ | |
--exclude=system_backup.tar.gz \ | |
--exclude=home \ | |
--exclude=opt \ | |
--exclude=var/cache/apt/archives \ | |
. boot/ > >(tee /system_backup.log) 2> >(tee /system_backup.errors >&2) |
This file contains hidden or 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/sh | |
LOGDIR=/var/log/nmon | |
/etc/init.d/nmon stop | |
find $LOGDIR -name "*.nmon" -mtime -mmin +10 -exec gzip {} \; | |
find $LOGDIR -name "*.nmon.gz" -mtime +90 -exec rm {} \; | |
/etc/init.d/nmon start |
This file contains hidden or 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/sh | |
# avoid duplicates.. | |
export HISTCONTROL=ignoredups:erasedups | |
# append history entries.. | |
shopt -s histappend | |
# After each command, save and reload history | |
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" | |
readonly PROMPT_COMMAND |
This file contains hidden or 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
Surviving on Windows with MSYS | |
If you are experienced Linux/Unix user you will get a bad time working on Windows, to my rescue comes MSYS which contains most of common utilities like tail, grep and friends. It does not require installation so it can be easily used from Windows servers. | |
Download the installer (mingw-get-*-bin.zip/ ) from: | |
http://sourceforge.net/projects/mingw/files/Installer/mingw-get/ | |
Extract mingw-get-*-bin.zip to C:\mingw_install | |
From the command line: | |
cd C:\mingw_install\bin | |
mingw-get.exe install msys-mintty msys-grep msys-base msys-openssh |
OlderNewer