This file contains hidden or 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
server { | |
include /data/disk/o1/config/includes/fastcgi_params.conf; | |
limit_conn gulag 32; # like mod_evasive - this allows max 32 simultaneous connections from one IP address | |
listen *:80; | |
server_name typo3.example.com; | |
root /data/disk/o1/static/www/typo3.example.com; | |
# Extra configuration for TYPO3 -- see http://www.howtoforge.com/running-typo3-4.6-on-nginx-lemp-on-debian-squeeze-ubuntu-11.10: | |
index index.php index.html; | |
location = /favicon.ico { | |
log_not_found off; |
This file contains hidden or 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
// convert | |
$descriptorspec = array( | |
0 => array("pipe", "r"), // stdin | |
1 => array("pipe", "w"), // stdout | |
2 => array("pipe", "w"), // stderr | |
); | |
flush(); | |
$process = proc_open($youtdl, $descriptorspec, $pipes); | |
if (is_resource($process)) { | |
while ($s = fgets($pipes[1])) { |
This file contains hidden or 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
// convert | |
$timeout = 30; | |
$descriptorspec = array( | |
0 => array("pipe", "r"), // stdin | |
1 => array("pipe", "w"), // stdout | |
2 => array("pipe", "w"), // stderr | |
); | |
$process = proc_open($youtdl, $descriptorspec, $pipes); | |
var_dump($pipes); | |
if (isset($stdin)) { |
This file contains hidden or 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
/*execute program and write all output to $out | |
terminate program if it runs more than 30 seconds */ | |
execute("program --option", null, $out, $out, 30); | |
echo $out; | |
function execute($cmd, $stdin=null, &$stdout, &$stderr, $timeout=false) | |
{ | |
$pipes = array(); | |
$process = proc_open( | |
$cmd, |
This file contains hidden or 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
### /data/disk/o1/config/server_master/nginx/post.d/nginx_vhost_include.conf | |
### | |
### Custom rewrites to map stub files and iframe busters | |
### | |
location ~* ^.+\.(html?)$ { | |
### Directory specific redirects -- http://www.adopstools.com/?section=miscellaneous&page=iframes | |
rewrite ^/adcentric/ifr_b\.html(.*)$ /sites/$server_name/files/vclk_expandable_pack/ifr_b.html$1 permanent; | |
rewrite ^/adinterax/adx-iframe-v2\.html(.*)$ /sites/$server_name/files/vclk_expandable_pack/adx-iframe-v2.html$1 permanent; | |
rewrite ^/atlas/atlas_rm\.htm(.*)$ /sites/$server_name/files/vclk_expandable_pack/atlas_rm.htm$1 permanent; |
This file contains hidden or 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 | |
# baseline advagg + httprl configuration | |
$conf['advagg_bundler_active'] = 1; | |
$conf['advagg_cache_level'] = 1; | |
$conf['advagg_combine_css_media'] = 0; | |
$conf['advagg_core_groups'] = 0; | |
$conf['advagg_css_compressor'] = 2; | |
$conf['advagg_css_inline_compressor'] = 2; | |
$conf['advagg_css_inline_compress_if_not_cacheable'] = 1; |
This file contains hidden or 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
cd tmp | |
wget https://github.com/drush-ops/drush/archive/6.3.0.zip | |
unzip 6.3.0.zip | |
rm -rf 6.3.0.zip | |
mv drush-6.3.0 ~/var/php/admin/ | |
cd ~/var/php/admin/ | |
mv drush-6.3.0 drush | |
chmod 755 drush/drush | |
chmod 755 drush/drush.php | |
nano ~/etc/bash/bashrc |
This file contains hidden or 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 # override global settings.php | |
// This file should be created as /data/conf/override.global.inc. | |
// Kind of core version agnostic, securepages module | |
// for proper HTTP/HTTPS redirects. | |
if (isset($_SERVER['HTTP_HOST']) && preg_match("/(?:domain\.com|another-domain\.com)/", $_SERVER['HTTP_HOST']) && | |
isset($_SERVER['REQUEST_URI']) && isset($_SERVER['HTTP_USER_AGENT'])) { | |
$request_type = ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ? 'SSL' : 'NONSSL'; | |
$conf['https'] = TRUE; |
This file contains hidden or 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 | |
SHELL=/bin/bash | |
PATH=/usr/local/bin:/usr/local/sbin:/opt/local/bin:/usr/bin:/usr/sbin:/bin:/sbin | |
BACKUPDIR=/data/disk/arch/sql | |
HOST=`uname -n` | |
DATE=`date +%y%m%d-0008` | |
HOUR=`date +%H` | |
LASTHOUR=`date --date="2 hours ago" +%H` | |
SAVELOCATION=$BACKUPDIR/$HOST-$DATE/hourly |
This file contains hidden or 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 | |
$vt = 21; // vt start | |
$ip = 48; // ip start | |
$vt_static = "eth2:"; | |
$ip_static = "192.99.243."; | |
$ip_max = "55"; | |
while ($ip <= $ip_max) { | |
$vt_full = ''; |
OlderNewer