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/bash | |
## | |
## are you root? | |
## | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi |
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 | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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/bash | |
echo "This is intended as a guideline only!" | |
if [ -e /etc/debian_version ]; then | |
APACHE="apache2" | |
elif [ -e /etc/redhat-release ]; then | |
APACHE="httpd" | |
fi | |
RSS=`ps -aylC $APACHE |grep "$APACHE" |awk '{print $8'} |sort -n |tail -n 1` | |
RSS=`expr $RSS / 1024` | |
echo "Stopping $APACHE to calculate free memory" |
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
add-apt-repository ppa:brianmercer/php | |
aptitude -y update | |
aptitude -y install php5-cli php5-common php5-mysql php5-suhosin php5-gd php5-curl | |
aptitude -y install php5-fpm php5-cgi php-pear php5-memcache php-apc php5-dev | |
echo "apc.mmap_file_mask=/tmp/apc.XXXXXX" >> /etc/php5/conf.d/apc.ini | |
echo "apc.shm_size = 64" >> /etc/php5/conf.d/apc.ini | |
cp /etc/php5/fpm/php5-fpm.conf /etc/php5/fpm/php5-fpm.conf.original | |
sed -i 's/.*listen.allowed_clients = 127.0.0.1.*/listen.allowed_clients = 127.0.0.1/g' /etc/php5/fpm/php5-fpm.conf |
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 | |
# | |
# varnish_ - Munin plugin to for Varnish | |
# Copyright (C) 2009 Redpill Linpro AS | |
# | |
# Author: Kristian Lyngstøl <[email protected]> | |
# | |
# This 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 |
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 | |
# | |
# Copyright (C) 2008 Rodolphe Quiedeville <[email protected]> | |
# | |
# This 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; version 2 dated June, | |
# 1991. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 | |
# | |
# Copyright (C) 2008 Rodolphe Quiedeville <[email protected]> | |
# | |
# This 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; version 2 dated June, | |
# 1991. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 | |
# | |
# Copyright (C) 2008 Rodolphe Quiedeville <[email protected]> | |
# | |
# This 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; version 2 dated June, | |
# 1991. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 | |
$mem = apc_sma_info(); | |
$mem_size = $mem['num_seg']*$mem['seg_size']; | |
$mem_avail= $mem['avail_mem']; | |
$mem_used = $mem_size-$mem_avail; | |
$out = array( | |
'size: ' . sprintf("%.2f", $mem_size), | |
'used: ' . sprintf("%.2f", $mem_used), | |
'free: ' . sprintf("%.2f", $mem_avail) | |
); |
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 | |
# | |
# Magic markers: | |
#%# family=auto | |
#%# capabilities=autoconf | |
my $ret = undef; | |
if (! eval "require LWP::UserAgent;") | |
{ |