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 is a script to add some rpms necessary for a minimum installed RHEL6 system to use ssh, mount.nfs and lftp. | |
# supported distro: RHEL6.0 | |
baseurl=ftp://FTPSERVER/PATH_TO_MOUNTED_ISOIMAGE | |
arch=x86_64 | |
rpmopts=-ivh |
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/perl | |
# calcurate average physical CPU usage from Processor Utilization Resources Register, aka PURR. | |
# see URL below in detail. | |
# http://www.ibm.com/developerworks/wikis/display/LinuxP/Entries+in+the+proc+Filesystem | |
use strict; | |
use warnings; | |
$| = 1; |
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 | |
x=0 | |
for group in `yum --enablerepo=rhel60 grouplist -v | grep '^ ' | sed -e 's/.*(\(.*\))/\1/' | sort`; do | |
echo "===> ($x) ${group}" | |
yum --enablerepo=rhel60 groupinfo ${group} | |
((x = x + 1)) | |
done |
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/local/bin/perl | |
use strict; | |
use warnings; | |
open FILE, $ARGV[0] or die; | |
my $curpos; | |
for (;;) { | |
for ($curpos = tell(FILE); $_ = <FILE>; $curpos = tell(FILE)) { | |
print; |
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/local/bin/ruby | |
f = open(ARGV[0]) | |
while true | |
if (line = f.gets) | |
puts line | |
else | |
sleep 1 | |
end | |
end |
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/local/bin/python | |
import sys | |
import time | |
file = open(sys.argv[1]) | |
while True: | |
where = file.tell() | |
line = file.readline() | |
if not line: |
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 | |
# Send SCSI-3 Persistent Reserve/Release command using sg_persist | |
# Inspired by http://www.redhat.com/archives/cluster-devel/2006-June/msg00084.html | |
# eg1. send SCSI Persistent Reserve to /dev/sde, | |
# where type of PROUT is "exclusive access - registrants only" | |
# $ sudo ./scsi_pr.sh reserve /dev/sde 6 | |
# eg2. send SCSI Persistent Release to /dev/sde, | |
# where type of PROUT is "exclusive access - registrants only" |
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
MegaCLI SAS RAID Management Tool Ver 8.04.07 May 28, 2012 | |
(c)Copyright 2011, LSI Corporation, All Rights Reserved. | |
NOTE: The following options may be given at the end of any command below: | |
[-Silent] [-AppLogFile filename] [-NoLog] [-page[N]] |
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 | |
current_branch=$(git branch | grep '^\*' | sed -e 's/^\* //') | |
echo "==> checking current branch: ${current_branch}" | |
if [ x"${current_branch}" != x"master" ]; then | |
echo "current branch is not 'master'." | |
echo "===> checking out master..." | |
git checkout master | |
if [ x"$?" != x"0" ]; then |
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/env python | |
# Obtain kernel related errata for RHEL6 from RHN. | |
# This depends on rhnapi (https://github.com/lanky/python-rhnapi). | |
import sys | |
import re | |
import rhnapi | |
from pprint import pprint | |
from rhnapi import channel |
OlderNewer