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
var xmlrpc = require('xmlrpc'), | |
sys = require('sys'); | |
var config = { | |
host: 'www.mymagentohost.com', | |
port: 80, | |
path: '/api/xmlrpc/', | |
login: 'apilogin', | |
pass: 'myapikey' |
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
upstream rrbackend { | |
server 127.0.0.1:8080 weight=3; | |
server 127.0.0.1:8888; | |
} | |
map $cookie_backend $backend { | |
default rrbackend; | |
experimental 127.0.0.1:8888; | |
} |
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
var page = require('webpage').create(), | |
system = require('system'), | |
address,time,tries,j; | |
if (system.args.length === 1) { | |
console.log('Usage: loadspeed.js <some URL>'); | |
phantom.exit(); | |
} else { | |
address = system.args[1]; | |
tries = Number(system.args[2]) || 10; |
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/env node | |
"use strict"; | |
var debug = require('_debugger'); | |
var c = new debug.Client(); | |
function main() { | |
console.log('requesting trace'); | |
c.reqBacktrace(function(err,trace) { | |
if (!err) { |
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
"use strict"; | |
/* | |
* Emulates Java's PBEWITHMD5ANDDES for node.js | |
*/ | |
var crypto = require('crypto'); | |
var pbewithmd5anddes = { | |
KDF: function(password,salt,iterations) { |
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
"use strict"; | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath(__dirname + '/../aws-config.json'); | |
var autoscaling = new AWS.AutoScaling(); | |
var cloudwatch = new AWS.CloudWatch(); | |
function goFigure() { | |
var e = new Date(); |
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
# Show largest tables and indexes | |
SELECT CONCAT(table_schema, '.', table_name),CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,ROUND(index_length / data_length, 2) idxfrac FROM information_schema.TABLES ORDER BY data_length + index_length DESC LIMIT 10; | |
# Show temp table stats | |
show global status like '%tmp%' |
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
# verify if its on/off | |
SHOW VARIABLES LIKE 'perf%'; | |
# List frequently running queries | |
select * from events_statements_summary_by_digest order by count_star desc limit 4; | |
# List queries creating temp tables | |
select * from events_statements_current where CREATED_TMP_DISK_TABLES > 0 limit 1\G; |
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
recursive_error_pages on; | |
location / { | |
try_files $uri @nodesrv; | |
} | |
location @nodesrv { | |
proxy_pass http://localhost:5000; | |
proxy_intercept_errors on; | |
error_page 404 = @phpsrv; | |
} |
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/env node | |
//# vi: ft=javascript | |
"use strict"; | |
var util = require('util'); | |
var recluster = require('recluster'); | |
var path = require('path'); | |
var fs = require('fs'); | |
var args = require('optimist').argv; |
OlderNewer