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 | |
def is_comment(line): | |
return line.startswith('<!--') | |
def is_empty(line): | |
return len(line) == 0 | |
if __name__ == '__main__': | |
f = open('/tmp/definitions.txt', 'r') |
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 | |
# | |
# Tells you the average size of your Apache processes | |
# It must run on a live apache server (unless you know what you are doing). | |
# It requires pmap, /proc, ps, grep, awk, sed and bc, | |
# | |
# Written by: Amr Mostafa" <[email protected]> | |
# | |
# Courtesy of Egypt Development Centre (c). |
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 | |
# | |
# Find all processes that are executing a futex(2) call with op=FUTEX_WAIT | |
# In some cases this can be helpful in finding deadlock-ed processes. | |
# | |
test ! $UID -eq 0 && echo -e "WARNING: Not running as root, only processes for this user are being scanned\n" >&2; | |
pids=$(ps -u $UID -opid --no-headers) | |
for pid in $pids; do |
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
<?php | |
/** | |
* @file | |
* Retrieves various load indicators from servers using SNMP. | |
* | |
* Licensed under GPL v3 or later. | |
* Copyright 2009 (c) Egypt Development Center. | |
*/ | |
/** |
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 | |
SLEEP=1 | |
THRESHOLD=500 | |
while [ 1 ] | |
do | |
threads=`mysqladmin stat | awk '{ print $4 }'` | |
echo "Active threads: $threads" | |
if [ $threads -gt $THRESHOLD ]; then | |
log="/root/mysql-monitor/logs/sqls-$threads-`date +%s`.log" |
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 | |
# | |
# Shuffles given playlist outside mplayer instead of using -shuffle | |
# | |
# Usage: | |
# | |
# mplayer-shuffle-playlist <playlist-file> [mplayer-options] ... | |
# | |
PLAYLIST=$(mktemp mplayer-shuffle-playlist.XXXXX) |
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
<?php | |
$regex = '#^\\{\\|(.*?)(?:^\\|\\+(.*?))?(^(?:((?R))|.)*?)^\\|}#msi'; | |
$source = "==GUIDE TO UNITED NATIONS HUMAN RIGHTS MACHINERY== | |
{| border=1 | |
|'''remit''' | |
|International | |
Covenant on Civil and Political Rights (ICCPR) | |
· periodic reports every 5 |
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 | |
# Print average apache process size | |
# Licensed under GPL v3 or later | |
# | |
# =| USAGE |=================================================================== | |
# | |
# echo <apache-parent-process-id> | ./apache_avg_procsize.sh | |
# | |
# On Debian this translates to: | |
# |
NewerOlder