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 | |
//just making a note of this here for later use... | |
//subscribe.php | |
function f($redis, $chan, $msg) { | |
switch($chan) { | |
case 'chan-1': | |
print "get $msg from $chan\n"; | |
break; | |
case 'chan-2': |
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 | |
print_r($_SERVER); | |
define('PLUGINDIR','./plugin.d/'); | |
foreach (glob(PLUGINDIR."*.php") as $filename) { | |
require_once($filename); | |
$basename=substr($filename,strlen(PLUGINDIR),-4); | |
$funcname='plugin_'.$basename; | |
$result[$basename]=$funcname(); | |
} |
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
Rough concept is as follows. | |
Setup 4 lists for each queue. | |
for a queue 'foobar' | |
'queue:foobar:low' | |
'queue:foobar:medium' | |
'queue:foobar:high' | |
'queue:foobar:run_at' | |
and optionally 'queue:foobar:failed' |
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
<h3>Generating the keys</h3> | |
<p>Generating the key isn't difficult.</p> | |
<code> | |
[root@server1 ~]# <b>ssh-keygen</b> | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/root/.ssh/id_rsa): <b>test_key</b> | |
Enter passphrase (empty for no passphrase): <b>my passphrase</b> | |
Enter same passphrase again:<b>my passphrase</b> |
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 | |
$link=mysql_pconnect($db['write']['host'],$db['write']['user'],$db['write']['pass']) or die ("Could not connect to datadase"); | |
mysql_select_db($db['write']['name']) or die ("could not select database"); | |
//patharray is an essentially an exploded $_SERVER['REQUEST_URI'] | |
//for articles rss feeds it would be /rss/articles/categoryname | |
//so $patharray[0]='rss', $patharray[1]='articles' and $patharray[2]='categoryname' | |
const('SITENAME','Example.com'); | |
const('WEBMASTER','[email protected] ([email protected])'); |
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 | |
header('Content-type: text/xml'); | |
//connect to db | |
$link=mysql_pconnect($db['write']['host'],$db['write']['user'],$db['write']['pass']) or die ("Could not connect to datadase"); | |
mysql_select_db($db['write']['name']) or die ("could not select database"); | |
$base='http://'.$_SERVER['HTTP_HOST']; | |
$xml = new SimpleXMLElement("<?xml version='1.0' encoding='UTF-8' ?>\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />'); |
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
teamplayr.com: | |
This host is located in: NA | |
This host is located in: US | |
Array | |
( | |
[continent_code] => NA | |
[country_code] => US | |
[country_code3] => USA | |
[country_name] => United States | |
[region] => TX |
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 | |
/* | |
This has been used for testing a logstash install and searching infrastructure. It is a quick and dirty implementation of the twitter streaming api. A better way would be to do it with curl with callback handlers. Normal curl wont work as the stream doesn't have a proper end. | |
*/ | |
set_time_limit(0); | |
$query_data = array('track' => '#devops', 'stall_warnings' => 'true'); | |
$user = 'twitteraccount'; // replace with your account |
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 | |
#### Edit the paths to suit your environment. | |
mkdir /tmp/geoip | |
cd /tmp/geoip/ | |
rm -f *.dat | |
wget -N -q http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | |
gzip -d - < GeoIP.dat.gz > GeoIP.dat |
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
NAME=kibana | |
VERSION=0.1.5 | |
MAINTAINER="Mike Preston <[email protected]>" | |
URL="https://domain.com/mikepreston/kibana-packaging" | |
DOWNLOADURL="https://github.com/rashidkpc/Kibana/tarball/v0.1.5" | |
.PHONY: package | |
package: | |
#rm -f $(NAME)-*.tgz | |
wget -O $(NAME)-$(VERSION).tgz -N https://github.com/rashidkpc/Kibana/tarball/v0.1.5 |
OlderNewer