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 | |
LOG_FILE="/tmp/script-output.log" | |
function watchTail() { | |
local cur_pid=$$ | |
local tail_args=`echo "tail -f $LOG_FILE" | cut -c1-79` | |
local pid=`ps -e -o pid,ppid,args | grep ${cur_pid} | grep "${tail_args}"| grep -v grep | nawk '{print $1}'` | |
if [ "$pid" = "" ] |
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 | |
function formatSeconds() { | |
local s=${1} | |
((h=s/3600)) | |
((m=s%3600/60)) | |
((s=s%60)) | |
if [ "${#h}" == 1 ]; then h="0"$h; fi | |
if [ "${#m}" == 1 ]; then m="0"$m; fi | |
if [ "${#s}" == 1 ]; then s="0"$s; fi |
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 | |
echo "http%3A%2F%2Fwww.foo.com%2Findex.php%3Fid%3Dqwerty" | sed -e "s/%\([0-9A-F][0-9A-F]\)/\\\\\x\1/g" | xargs -0 echo -e | |
# http://www.foo.com/index.php?id=qwerty |
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 | |
function wgetFilter() { | |
local flag=2 c count cr=$'\r' nl=$'\n' | |
while IFS='' read -d '' -rn 1 c | |
do | |
if [ $flag == 1 ] | |
then | |
printf '%c' "$c" | |
if [[ "$c" =~ (s$) ]] |
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 | |
echo wget -S --spider -O - "http://www.foo.com/file" >&1 2>&1 | grep '^213' | awk '{print $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 | |
function wgetFind() { | |
local host="$1" | |
local path="$2" | |
local files=$(wget -q -O - "$host$path" | grep -o 'ftp:[^"]*') | |
while read -r line | |
do | |
local file=$(echo "$line" | sed "s#&\#32;#%20#g" | sed "s#$host# #g" | cut -c2-) | |
if [ "${file#${file%?}}" == "/" ] |
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 | |
MAX_RETRIES=3 | |
function sayHelloTo() { | |
echo "Hello $1!" | |
if [ -z "$2" ]; then local retry=0; else local retry=$2; fi | |
# Make something and test | |
if [ -d "/tmp/" ] |
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 | |
FOLDER="/mnt" | |
MAIL="root" | |
tree -ah -H $FOLDER --nolinks -- $FOLDER > /tmp/tree-folder.html | |
echo "See attachment." | mutt -a "/tmp/tree-folder.html" -s "Tree of $FOLDER on `hostname`" -- $MAIL |
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 | |
TMP_FILE=/tmp/check-smart-errors.log | |
for I in $(ls /sys/block); do | |
smartctl -a /dev/$I > $TMP_FILE | |
if [ "$?" -ne "1" ]; then | |
DEVICE_MODEL="$(smartctl -a /dev/$I | grep -i 'device model')" | |
echo "DISK $I - $DEVICE_MODEL" | |
cat "$TMP_FILE" | grep -v "\- 0" | grep Raw_Read_Error_Rate |
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
name: release | |
on: | |
push: | |
branches-ignore: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
jobs: |
OlderNewer