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/awk -f | |
function valid_ip(ip) { | |
octets=4 | |
search="." |
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
# Class to JSON encode nested and awkward python objects | |
import json | |
import inspect | |
class ObjectEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if hasattr(obj, "to_json"): | |
return self.default(obj.to_json()) | |
elif hasattr(obj, "__dict__"): | |
d = dict( |
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
#as user sidadm | |
cd /usr/sap/trans # or where wherever TRANSDIR should be | |
mkdir -p actlog bin data log buffer sapnames cofiles olddata tmp backup serial |
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
#GET A LIST OF INSTANCES | |
#/usr/sap/hostctrl/exe/saphostctrl -function Listinstances -format Script | |
#GET A LIST of databases | |
saphostctrl -nr 99 -function Listdatabases | |
# manage a db with the host agent | |
# /usr/sap/hostctrl/exe/saphostctrl -nr 99 -function StopDatabase -dbname NPL -dbtype ada -user sapadm passwd | |
#query a db with the host agent |
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/env bash | |
############################ | |
############################ | |
############################ | |
# Script Skeleton | |
# does nothing | |
# copy it and change it | |
# its supposed to be a starting | |
# point for your own scripts | |
############################ |
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
import Foundation | |
extension String | |
{ | |
// Works in Xcode but not Playgrounds because of a bug with .insert() | |
mutating func insertString(string:String,ind:Int) { | |
var insertIndex = advance(self.startIndex, ind, self.endIndex) | |
for c in string { |
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
git log --oneline --after="2016-03-28" --before="2016-04-03" --pretty=format:"%ad, %s" --date=short |
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
monitorapp.sh | |
#!/bin/bash | |
#CONSTANTS | |
OFFLINE=100 | |
UNKNOWN=99 | |
ONLINE=110 | |
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
#This is a script to get the bits of the sapmnt global dir that you want during a migration | |
#but not the bits that you dont want | |
#first make sure we are in something that looks like a global dir | |
if [[ $(pwd) =~ ^/sapmnt/[A-Z0-9]{3}/global ]] | |
then | |
echo Great you are in the global directory | |
echo Generating Unique Archive filename | |
fname="$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 32).tar" | |
echo Archive filename is $fname |
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
call all with one parameter the name of the pretend sample app from the vcs application agent | |
# cat startsampleapp | |
#!/bin/sh | |
sleep $(shuf -i 10-30 -n 1) | |
touch /tmp/$1 # add any steps, if required | |
exit 0 | |
# cat stopsampleapp | |
#!/bin/sh |
NewerOlder