Skip to content

Instantly share code, notes, and snippets.

View paperdarwin's full-sized avatar

Paper Darwin paperdarwin

  • Paperstreet Media
  • Over There
View GitHub Profile
@paperdarwin
paperdarwin / nats_sample.php
Last active December 31, 2015 06:48
NATS propagation sample code
<?php
/**
* - NATS value should be read first on the cookie, before the GET variables. If it is not defined, then a default value should be provided
* - For each tour, there is a default NATS value which is in NATS admin
* - ALL links in any tour should propagate the NATS variable
**/
?>
$nats = isset($_REQUEST['nats']) ? $_REQUEST['nats'] : 'My4yLjEuMS4wLjAuMC4wLjA';
<a href="target.php?nats=<?php echo $nats; ?>">Join Link</a>
SELECT subject, COUNT( * ) AS ctr
FROM historical_notification
WHERE added >=1388505600
GROUP BY subject
ORDER BY ctr DESC
@paperdarwin
paperdarwin / scenes with non ansi desc.sql
Created January 30, 2014 13:42
teamskeet scenes with non ansi characters in description
SELECT * FROM updates WHERE NOT HEX(mdesc) REGEXP '^([0-7][0-9A-F])*$';
@paperdarwin
paperdarwin / nats1.sql
Created February 7, 2014 18:39
nats username field is not case sensitive
SELECT * FROM member WHERE username = 'williaml'
@paperdarwin
paperdarwin / check_nagios_config.sh
Created February 18, 2014 17:34
verify if nagios config has no error
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
@paperdarwin
paperdarwin / apahce.conf
Created February 20, 2014 16:06
make css folder public
<Directory /home/httpd/html/members.teamskeet.com/public_html/error>
Order Allow,Deny
Allow from all
Satisfy Any
</Directory>
<Directory /home/httpd/html/members.teamskeet.com/public_html/v2/css>
Order Allow,Deny
Allow from all
Satisfy Any
</Directory>
@paperdarwin
paperdarwin / runnodejs.sh
Last active January 21, 2016 08:28
run a nodejs app even after you logout from ssh
nohup node app &
# to kill it execute ps -ef
# find the process id for "node app " and then
# kill -9 <process id>
@paperdarwin
paperdarwin / error.log
Created March 24, 2014 18:17
errors in psmhelp
[Mon Mar 17 18:25:35 2014] [error] [client 50.241.210.125] PHP Notice: Use of undefined constant memberidx - assumed 'memberidx' in /home/httpd/html/psmhelp.com/public_html/cancel_script/cancel/index.php on line 57
[Mon Mar 17 18:25:35 2014] [error] [client 50.241.210.125] PHP Notice: Use of undefined constant siteid - assumed 'siteid' in /home/httpd/html/psmhelp.com/public_html/cancel_script/cancel/index.php on line 59
[Mon Mar 17 18:25:35 2014] [error] [client 50.241.210.125] PHP Notice: Undefined variable: netbilling_account in /home/httpd/html/psmhelp.com/public_html/cancel_script/cancel/index.php on line 61
[Mon Mar 17 18:25:35 2014] [error] [client 50.241.210.125] PHP Notice: Use of undefined constant siteid - assumed 'siteid' in /home/httpd/html/psmhelp.com/public_html/cancel_script/cancel/index.php on line 78
[Mon Mar 17 18:25:35 2014] [error] [client 50.241.210.125] PHP Notice: Use of undefined constant siteid - assumed 'siteid' in /home/httpd/html/psmhelp.com/public_html/cancel_script/cancel/ind
#check the mail queue
mailq
# check the mail queue bodies
/var/spool/mqueue/df*
@paperdarwin
paperdarwin / is_sendmail_running.sh
Created May 6, 2014 15:26
determine if sendmail is running
/sbin/service sendmail status