Skip to content

Instantly share code, notes, and snippets.

View nmattam's full-sized avatar

Nibin Abraham Mattam nmattam

View GitHub Profile
192.187.118.162 - - [28/Nov/2014:22:02:46 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" **12/12522737**
::1 - - [28/Nov/2014:22:02:59 +0000] "OPTIONS * HTTP/1.0" 200 152 "-" "Apache/2.2.20 (Ubuntu) (internal dummy connection)" **0/95**
192.187.118.162 - - [28/Nov/2014:22:02:46 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" **13/13069665**
192.237.163.6 - - [28/Nov/2014:22:02:59 +0000] "POST /wp-cron.php?doing_wp_cron=1417212179.1865758895874023437500 HTTP/1.0" 200 211 "-" "WordPress/3.9.1; http://spotmyphotos.com" **1/1172813**
192.237.163.6 - - [28/Nov/2014:22:02:59 +0000] "POST /wp-cron.php?doing_wp_cron=1417212179.3103239536285400390625 HTTP/1.0" 200 211 "-" "WordPress/3.9.1; http://spotmyphotos.com" **1/1081213**
192.187.118.162 - - [28/Nov/2014:22:02:47 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)" **12/12934145**
192.237.163.6 - - [28/Nov/2014:2
@nmattam
nmattam / access.log
Created November 29, 2014 01:31
Apache server issue
93.174.93.117 - - [28/Nov/2014:09:40:33 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.117 - - [28/Nov/2014:09:42:59 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
93.174.93.117 - - [28/Nov/2014:09:45:26 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
192.187.118.162 - - [28/Nov/2014:09:45:36 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
192.187.118.162 - - [28/Nov/2014:09:45:36 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
192.187.118.162 - - [28/Nov/2014:09:45:37 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
192.187.118.162 - - [28/Nov/2014:09:45:38 +0000] "POST /xmlrpc.php HTTP/1.0" 200 597 "-" "Mozilla/4.0 (compatible: MSIE 7.0; Windows NT 6.0)"
192.187.118.162 - - [28/Nov/2014:09:
Fatal error: Uncaught exception 'Services_Twilio_RestException' with message 'The 'To' number 5551234567 is not a valid phone number.' in /var/www/psn/twilio-php/Services/Twilio.php:213 Stack trace: #0 /var/www/psn/twilio-php/Services/Twilio.php(185): Services_Twilio->_processResponse(Array) #1 /var/www/psn/twilio-php/Services/Twilio/ListResource.php(83): Services_Twilio->createData('/2010-04-01/Acc...', Array) #2 /var/www/psn/twilio-php/Services/Twilio/Rest/SmsMessages.php(17): Services_Twilio_ListResource->_create(Array) #3 /var/www/psn/pg/scripts/classes/sky.php(178): Services_Twilio_Rest_SmsMessages->create('7342742961', '5551234567', 'You have been S...') #4 /var/www/psn/fr_app.php(20): sky::parse_recognition_response(Object(stdClass), '237') #5 {main} thrown in /var/www/psn/twilio-php/Services/Twilio.php on line 213
/*
@params
$center_x: returned by Coyote (is the percentage of photo width)
$center_y: returned by Coyote (is the percentage of photo height)
$thresh: threshold value for matching (currently set to 0.030)
$pwidth: width of the photo
$pheight: height of the photo
*/
13:38:23 $ ls -l /var/log/opscode/nginx/
total 1005728
-rw-r--r-- 1 opscode opscode 43407863 Feb 18 13:36 access.log
-rw-r--r-- 1 opscode opscode 105030831 Feb 8 00:33 access.log.1
-rw-r--r-- 1 opscode opscode 6355971 Jan 12 14:53 access.log.2.gz
-rw-r--r-- 1 opscode opscode 6491956 Nov 9 10:58 access.log.3.gz
-rw-r--r-- 1 opscode opscode 6339453 Sep 9 11:52 access.log.4.gz
-rw-r--r-- 1 opscode opscode 1 Feb 18 13:38 access-port-80.log
-rw-r--r-- 1 opscode opscode 421891110 Feb 18 13:38 access-port-80.log.1
-rw-r--r-- 1 opscode opscode 65467774 Feb 8 01:01 access-port-80.log.2.gz
@nmattam
nmattam / nginx_log_rotate.txt
Created February 23, 2016 20:04
nginx log rotate script
/var/log/opscode/nginx/*.log {
rotate 10
size 104857600
create 644 opscode opscode
delaycompress
sharedscripts
postrotate
/opt/opscode/embedded/sbin/nginx -s reopen
endscript
}
2.1.5 :052 > te.at_xpath('/license/payload/expiration_time/text()')
=> #<Nokogiri::XML::Text:0x3fd9088d6398 "1474469242">
2.1.5 :053 > te.at_xpath('/license/payload/expiration_time/text()').to_s
=> "1474469242"
2.1.5 :054 > te.at_xpath('/license/payload/expiration_time/text()').to_s.to_i
=> 1474469242
@nmattam
nmattam / gist:32ae2d6513a561dc3c9ea1dfa7dcb9ec
Created September 1, 2016 17:52
chef-client upgrade omnibus_updater
Recipe: omnibus_updater::downloader
* directory[/var/chef/cache/omnibus_updater] action create (up to date)
* remote_file[omnibus_remote[chef-12.5.1-1.el6.x86_64.rpm]] action create_if_missing
- create new file /var/chef/cache/omnibus_updater/chef-12.5.1-1.el6.x86_64.rpm
- update content in file /var/chef/cache/omnibus_updater/chef-12.5.1-1.el6.x86_64.rpm from none to 76dda2
(file sizes exceed 10000000 bytes, diff output suppressed)
Recipe: omnibus_updater::old_package_cleaner
* file[/var/chef/cache/omnibus_updater/chef-12.4.3-1.el6.x86_64.rpm] action delete
- delete file /var/chef/cache/omnibus_updater/chef-12.4.3-1.el6.x86_64.rpm
Recipe: omnibus_updater::installer
@nmattam
nmattam / script.rb
Created September 19, 2016 22:02 — forked from acharlieh/script.rb
Figuring out that one vagrant vault key wasn't updated
require 'chef-vault'
data = JSON.parse(File.open('data_bags/cerner_splunk/license_secrets_keys.json').read())
keys = (data['clients'] + data['admins']).inject({}) do |m,c|
pem = (c == 'knife_workstation') ? 'fake-key.pem' : "pems/#{c}.pem"
private_key = OpenSSL::PKey::RSA.new(File.open(pem).read())
m[c] = private_key.private_decrypt(Base64.decode64(data[c]))
m
end
@nmattam
nmattam / gist:d43959d1f2e048433f0cfa83b6a5c951
Created January 26, 2017 21:01
Kitchen converging app-install-centos-67
* directory[/opt/splunk/etc/apps/test_app/metadata] action create
- create new directory /opt/splunk/etc/apps/test_app/metadata
- change owner from '' to 'splunk'
- change group from '' to 'splunk'
- restore selinux security context
* ruby_block[set config overrides] action run
- execute the ruby block set config overrides
* splunk_conf[testing.conf] action configure
* directory[/opt/splunk] action create (up to date)
- update apps/set config overrides/default/testing.conf