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/perl | |
### check_backup.pl | |
# By Nathan Vonnahme, Sept 2011 | |
# An example for "Writing Custom Nagios Plugins in Perl" at the Nagios | |
# World Conference North America 2011. | |
# I. Prologue |
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
<?php | |
/** | |
* This is the model class for table "www_oauth". | |
* | |
* The followings are the available columns in table 'www_oauth': | |
* @property integer $id | |
* @property integer $user_id | |
* @property integer $service | |
* @property string $service_uid |
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 python2 | |
import re, sys, os, urllib | |
re_songs = re.compile(r'\'sid\': \'(.+?)\', \'sname\': \'(.+?)\'') | |
re_name = re.compile(r'\\&.+?;') | |
template_wgets = 'wget -nv -c -O "%s" %s' | |
durl = 'http://yinyueyun.baidu.com/data/cloud/downloadsongfile\?songIds\=%s\&rate\=320' | |
def modified_sname(sname): | |
sname = sname.replace('\\'', '\'') |
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
SELECT a.sid, | |
b.spid | |
FROM v$session a, | |
v$process b | |
WHERE A.paddr = b.addr | |
AND b.spid = 41484400; |
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
#!/bin/sh | |
DB_USER="root" | |
DB_PASS="123456" | |
DB_NAME="blog" | |
LOG_PATH="/data/db/errlog.log" | |
TIME=`date +%Y-%m-%d" "%H:%M:%S` | |
TABLES=`/usr/bin/awk '/'"repair failed"'/ {print $6}' $LOG_PATH | sort -k1n | uniq -c | awk -F "'" '{print $2}' | awk -F '/' '{print $3}'` | |
if [ -n "$TABLES" ] |
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
select sql.last_load_time, sql.elapsed_time/1000000, sql.sql_text from v$sql sql where sql.last_load_time>to_char(systimestamp - INTERVAL '1' HOUR, 'YYYY-MM-DD/HH24:MI:SS') and sql.elapsed_time > 1000000 * 60 order by sql.elapsed_time desc; |
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
declare @dbname varchar(255) | |
declare @check_mssql_health_USER varchar(255) | |
declare @check_mssql_health_PASS varchar(255) | |
declare @check_mssql_health_ROLE varchar(255) | |
declare @source varchar(255) | |
declare @options varchar(255) | |
declare @backslash int | |
/*******************************************************************/ | |
SET @check_mssql_health_USER = '"[Servername|Domainname]\nagios"' |
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
Select tables.owner || '.' || | |
tables.table_name | |
as table_owner | |
From all_tables tables, | |
(Select | |
owner, | |
TABLE_NAME, | |
constraint_type, | |
CONSTRAINT_NAME | |
FROM ALL_CONSTRAINTS |
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
curl --socks5 127.0.0.1:7070 http://cn.nytimes.com/ 2>/dev/null | grep -o '<a href="[^"]\+" title="[^"]\+"' | sed -e 's/<a href="//g' | sed -e 's/" title="/ /g' | sed -e 's/"//g' | while read url title | |
do if [[ ${url:0:5} != "http:" ]] | |
then | |
url="http://cn.nytimes.com$url" | |
fi | |
echo $url | mail -s "$title" [email protected] | |
done |
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/perl -w | |
############################################################################## | |
## sendEmail | |
## Written by: Brandon Zehm <[email protected]> | |
## | |
## License: | |
## sendEmail (hereafter referred to as "program") is free software; | |
## you can redistribute it and/or modify it under the terms of the GNU General | |
## Public License as published by the Free Software Foundation; either version | |
## 2 of the License, or (at your option) any later version. |
OlderNewer