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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Move Database Files (like MYD, MYI and frm) | |
|-------------------------------------------------------------------------- | |
| | |
| $config = array( | |
| 'tables' => array('table1','table2'), // array of tables / filenames to move | |
| 'extensions' => array('MYD','MYI','frm'), // required extensions for each database | |
| 'from' => dirname(__DIR__).'/transfer', // from location of files |
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_once app_path().'/libraries/google-api-php-client/src/Google_Client.php'; | |
require_once app_path().'/libraries/google-api-php-client/src/contrib/Google_AnalyticsService.php'; | |
session_start(); | |
$client = new Google_Client(); | |
$client->setApplicationName("Google Analytics PHP Starter Application"); | |
// Visit https://code.google.com/apis/console?api=analytics to generate your |
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
ANT000000 | Antiques & Collectibles / General | |
---|---|---|
ANT001000 | Antiques & Collectibles / Americana | |
ANT002000 | Antiques & Collectibles / Art | |
ANT003000 | Antiques & Collectibles / Autographs | |
ANT005000 | Antiques & Collectibles / Books | |
ANT006000 | Antiques & Collectibles / Bottles | |
ANT007000 | Antiques & Collectibles / Buttons & Pins | |
ANT008000 | Antiques & Collectibles / Care & Restoration | |
ANT009000 | Antiques & Collectibles / Transportation | |
ANT010000 | Antiques & Collectibles / Clocks & Watches |
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
### Download setup Ubuntu 14.04 box | |
``` | |
// from local directory | |
vagrant init chef/ubuntu-14.04 | |
``` | |
### Setup Vagrantfile | |
``` | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : |
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
<?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'; |