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 | |
// Define root path constant. $_SERVER['SCRIPT_FILENAME'] seems to survive | |
// redirects. | |
$root_path = dirname($_SERVER['SCRIPT_FILENAME']); | |
if(substr($root_path,-1) != '/') { | |
$root_path .= '/'; | |
} | |
define('ROOT_PATH',$root_path); | |
unset($root_path); |
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 | |
if(!isset($_GET['rewritecheck'])) { | |
$headers = get_headers(ROOT_URL.'/web/?rewritecheck',1); | |
define('REWRITE_ENABLED',strpos($headers[0],'301') !== false); | |
} | |
if(!defined('REWRITE_ENABLED')) {define('REWRITE_ENABLED',true);} | |
?> |
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 | |
if(!isset($_GET['number']) || empty($_GET['number'])) { | |
echo '<h3>Please enter a number > 1</h3>'; | |
} elseif(!is_numeric($_GET['number'])) { | |
echo '<h3>It has to be a number.</h3>'; | |
} | |
?> | |
<form action="" method="get"> | |
<input type="text" name="number"> | |
<input type="submit" value="Go"> |
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 | |
function array_stats(array $arr) { | |
sort($arr); | |
// Basic data | |
$result = array(); | |
$result['cnt'] = count($arr); | |
$result['min'] = min($arr); | |
$result['max'] = max($arr); | |
$result['sum'] = array_sum($arr); |
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 | |
# Get interface information | |
$LANIF="eth1" | |
$LANIP=$(ifconfig | awk "/$LANIF/,/inet addr/" | grep -oP "inet addr:[0-9\.]+" | cut -d':' -f2) | |
$EXTIF="eth0" | |
$EXTIF=$(ifconfig | awk "/$EXTIF/,/inet addr/" | grep -oP "inet addr:[0-9\.]+" | cut -d':' -f2) | |
# Clear all existing IPTables rules | |
echo " * Clearing old rules" |
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
failregex = NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Wrong password | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - No matching peer found | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - No matching peer found | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Username/auth name mismatch | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Device does not match ACL | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Peer is not supposed to register | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - ACL error (permit/deny) | |
NOTICE.* .*: Registration from '.*' failed for '<HOST>:.*' - Device does not match ACL | |
NOTICE.* .*: Registration from '\".*\".*' failed for '<HOST>:.*' - No matching peer found | |
NOTICE.* .*: Registration from '\".*\".*' failed for '<HOST>:.*' - Wrong password |
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 | |
# /etc/init.d/sentry | |
# A debian-compatible sentry startup script | |
# | |
### BEGIN INIT INFO | |
# Provides: sentry | |
# Required-Start: $remote_fs $syslog $network | |
# Required-Stop: $remote_fs $syslog $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
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
[composite:neutron] | |
use = egg:Paste#urlmap | |
/: neutronversions | |
/v2.0: neutronapi_v2_0 | |
[composite:neutronapi_v2_0] | |
use = call:neutron.auth:pipeline_factory | |
noauth = request_id catch_errors extensions neutronapiapp_v2_0 | |
keystone = request_id catch_errors authtoken keystonecontext extensions neutronapiapp_v2_0 |
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 | |
/* Change the following */ | |
$job = urlencode("Project name as seen in Jenkins"); | |
$token = "the build token you gave to the jenkins job"; | |
$url = "https://ci.example.com/"; | |
$json= file_get_contents('php://input'); | |
$jsarr = json_decode($json,true); | |
$branch = substr($jsarr['ref'], strrpos($jsarr['ref'], '/') + 1); |
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
/* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
OlderNewer