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 | |
# Desc: Finds 50x errors in Varnishncsa logs and writes daily reports for later analysis | |
# Tags: varnish, varnishlog, varnishncsa, varnishncsa logs, 500 errors, error reports, logs | |
TODAY_GREP=`date +%d/%b/%Y` | |
TODAY=`date +%Y%m%d` | |
REPORT_DIR="/tmp/varnish-500-report" | |
REPORT_FILE="${REPORT_DIR}/${TODAY}" | |
VARNISHNCSA_LOG="/var/log/varnish/varnishncsa.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/bash | |
# Distributed under the terms of the BSD License. | |
# Copyright (c) 2012 Phil Cryer [email protected] | |
# Source https://gist.github.com/gists/3333039 | |
# DESCRIPTION: | |
# This code updates OpenELEC on Raspberry PI to any available dev version you want | |
# The script to install the latest version did install the latest, but then failed to run :( | |
# This script allowed me to try another version (a few days older), which worked :) |
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 | |
(sleep 5; | |
mount -t nfs 192.168.1.6:/home/media/games -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/games | |
mount -t nfs 192.168.1.6:/export/music -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/music | |
mount -t nfs 192.168.1.6:/export/videos -o rw,nolock,tcp,soft,posix,noatime,nodiratime,timeo=600,actimeo=0,nfsvers=3,async,rsize=131072,wsize=131072 /storage/videos) & |
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 | |
# king of the mountain - because sharing is for faceb00k | |
# * networking fun for geeks in conferences and cafes | |
# * find other clients on the local network | |
# * see if they have any exposed files via http | |
# * use nmap to attempt to knock them offline | |
# - OSX or Linux supported (nmap, wget required) | |
# - this script derived from manual steps I used to take |
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 | |
# | |
# Set your bash prompt according to the branch/status of the current git repository. | |
# | |
# One-line install: | |
# curl https://gist.github.com/philcryer/5066010/raw/784e1e4c9df5289fe6f922fb6d122461d374758c/gitrc -o ~/.gitrc; echo "source ~/.gitrc" >> ~/.profile; source ~/.profile | |
# | |
# Originally forked from http://gist.github.com/31934 then modified liberally. | |
# |
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
[...] | |
[2013-10-02T11:33:38-05:00] INFO: Processing template[/root/.profile] action create (base::default line 1) | |
[2013-10-02T11:33:38-05:00] INFO: Processing template[/root/.bash_profile] action create (base::default line 8) | |
[2013-10-02T11:33:38-05:00] INFO: Processing template[/root/.curlrc] action create (base::default line 15) | |
[2013-10-02T11:33:38-05:00] INFO: Processing yum_key[RPM-GPG-KEY-EPEL-6] action add (yum::epel line 22) | |
[2013-10-02T11:33:38-05:00] INFO: Processing yum_repository[epel] action add (yum::epel line 27) | |
[2013-10-02T11:33:38-05:00] INFO: Processing package[tzdata] action install (timezone-ii::default line 16) | |
[2013-10-02T11:48:49-05:00] ERROR: /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.6.0/lib/chef/provider/package/yum-dump.py exceeded timeout 900 | |
[2013-10-02T11:48:49-05:00] INFO: Running queued delayed notifications before re-raising exception | |
[2013-10-02T11:48:49-05:00] ERROR: Running exception handlers |
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
ISSUE | |
=========== | |
76 running chef-client processes exhausting system memory, causing other apps to crash (in this case zabbix), chef-client is set to run once an hour, currently showing 76 running processes. | |
[root@dc2mgmtsavpd01 ~]# ps -fe | grep chef-client | wc -l | |
76 | |
Also, when I have failed chef-client runs like this I always find this in the ps; a chef-client worker process that is old (hung?), and a yum-dump.py that always needs to be killed before a chef-client run will be successful. | |
# ps -fe|grep chef |
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
# /etc/nginx/sites-enabled/fak3r.com | |
server { | |
server_name fak3r.com; | |
listen 88; | |
server_name_in_redirect off; | |
index index.html; | |
root /usr/share/nginx/www/fak3r.com/; | |
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { | |
expires max; | |
add_header Pragma public; |
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
[root@dc2mgmtsavpd01 ~]# curl 10.187.254.188:8080/lbcheck_adv.php | |
node01 FAILED | |
Memcache bin <em>default</em> at address localhost:11211 is not available.<br /> | |
Errors on this server will cause it to be removed from the load balancer. | |
[root@dc2mgmtsavpd01 ~]# /etc/init.d/moxi-server stop | |
[root@dc2mgmtsavpd01 ~]# netstat -plunt|grep 11211 | |
[root@dc2mgmtsavpd01 ~]# /etc/init.d/moxi-server start | |
Starting moxi server [ OK ] |
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
directory "/opt/iaas/web/app" do | |
owner "apache" | |
group "apache" | |
mode 755 | |
action :create | |
recursive true | |
end | |
directory "/opt/iaas" do | |
recursive true | |
owner "apache" |