Skip to content

Instantly share code, notes, and snippets.

View ssudharsan's full-sized avatar

ssudharsan

  • India
View GitHub Profile
#relay-rules.conf
[default]
default = true
DESTINATIONS = haproxy-relay:2015,haproxy-relay:2016
#carbon.conf
[relay:1]
USER = graphite
RELAY_METHOD = rules
@ssudharsan
ssudharsan / gist:f3625476d92ca278da99
Created July 21, 2014 09:00
Rials recaptcha - always return false
setting timeout to verify_recaptcha resolved the problem.
if verify_recaptcha(:timeout => 30)
..
else
..
end
@ssudharsan
ssudharsan / gist:e5941195f79074e46f3c
Last active June 29, 2017 20:23
Running chef manually in a opsworks instance
# put the cookbook path in solo.rb file.
echo 'cookbook_path ["/opt/aws/opsworks/current/site-cookbooks"]' > solo.rb
# create json file incase if you want use the attributes from opsworks.
opsworks-agent-cli get_json > attributes.json
#run chef-solo
/opt/aws/opsworks/current/bin/chef-solo -c solo.rb -o cookbook_name::default -j attributes.json
@ssudharsan
ssudharsan / gist:d0d41c7e21e31381330f
Last active August 29, 2015 14:02
mounting instance storage on ec2
umount /media/ephemeral0
mdadm --create /dev/md1 --chunk=4 --level=0 --raid-devices=2 /dev/xvdb /dev/xvdc
mkfs.ext4 /dev/md1
mkfs.ext4 /dev/md1
mkdir /data
mount /dev/md1 /data
mount --bind /var/test /data/test
@ssudharsan
ssudharsan / nconf
Last active August 29, 2015 14:02
[nconf] Resolving semi-blank screen problem with nconf
Resolving semi-blank screen problem with nconf on Amazon Linux
==============================================
1. Check the apache error log, I had the following error in my error_log
/var/log/httpd/error_log
[Mon Jun 02 05:39:36.149471 2014] [:error] [pid 29946] [client *.*.*.*:59964] PHP Fatal error: Call to undefined function mysql_query() in /usr/share/nagios/html/nconf/include/functions.php on line 1016, referer: /nagios/nconf/INSTALL.php?logout=1
2. Install MySQL database module for PHP
do rpm -qa | grep mysql