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
<?php | |
class onixSplitter | |
{ | |
function split($file,$header,$footer,$split_at=2000) | |
{ | |
$this->file = $file; | |
$this->header = $header; | |
$this->footer = $footer; | |
$this->split_at = $split_at; | |
$this->write_num = 1; // starting number for files written |
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
<?php | |
/** | |
* sar documentation http://linux.die.net/man/1/sar | |
*/ | |
class SystemStats | |
{ | |
function __construct($sar) | |
{ | |
$this->sar = $sar; | |
} |
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
<?php | |
require '../includes/class.common.php'; | |
require '../includes/class.images.php'; | |
$common = new common; | |
$images = new images; | |
// mysql connection | |
$conn=mysqli_connect("localhost","database","password","database_name"); | |
// Check connection | |
if (mysqli_connect_errno($conn)) { |
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
check process hekad-system with pidfile /var/run/hekad-system.pid | |
start program = "/bin/bash -c 'hekad --config=/usr/share/heka/conf.d/system.toml'" with timeout 60 seconds | |
stop = "/bin/bash -c 'kill -s SIGTERM `cat /var/run/hekad-system.pid`'" |
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
<?php | |
$workers = 400; | |
//10000 | |
echo 'StartServers '.($workers * .3).PHP_EOL; | |
echo 'MinSpareServers '.($workers * .05).PHP_EOL; | |
echo 'MaxSpareServers '.($workers * .10).PHP_EOL; | |
echo 'ServerLimit '.($workers).PHP_EOL; | |
echo 'MaxRequestWorkers '.($workers).PHP_EOL; | |
echo 'MaxRequestsPerChild 10000'; |
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
# stld | |
log-format %h %^[%d:%t %^] "%m %r %H" %s %b "%u" | |
# invubu | |
log-format %h %^[%d:%t %^] %m "%U" "%^" %^ %s %T %b "%u" |
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
function getMiddleRange(min,max,limit,type) | |
{ | |
--limit; | |
var new_num | |
var data = ''; | |
for(var x=0; x<=limit; x++) | |
{ | |
var new_num = Math.ceil((max - min) / limit); | |
new_num = min + (new_num * x); | |
if(x==0){new_num = min;} |
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
require "cjson" | |
local dt = require "date_time" | |
--[[ | |
From trink in IRC - thanks! | |
Example use: | |
[HttpListenInput] | |
address = "0.0.0.0:8325" |
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
{ | |
"order_num": "5066", | |
"customer_id": "1", | |
"po_num": null, | |
"email": "john@veldboom.com", | |
"phone": "", | |
"billing_name": "JOHN VELDBOOM", | |
"billing_addr1": "289 W MAIN ST", | |
"billing_addr2": "", | |
"billing_city": "NESS CITY", |
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
#!/bin/bash | |
spinner() | |
{ | |
local pid=$1 | |
local delay=0.4 | |
local spinstr='|/-\' | |
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do | |
local temp=${spinstr#?} | |
printf " [%c] " "$spinstr" | |
local spinstr=$temp${spinstr%"$temp"} |
OlderNewer