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
root@jericho:~/scripts# cat createvm.sh | |
#!/bin/bash | |
echo "./createvm.sh HOSTNAME SUITE ARCH IP GW USER USERNAME PASS MEM" | |
echo "example: ./createvm.sh vm6 oneiric i386 192.168.0.186 192.168.0.1 username UserName password 1024" | |
BASEVM=vm1 | |
HOSTNAME=$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
root@jericho:~/scripts# cat /var/lib/libvirt/images/vm1/vmbuilder.partition | |
root 20000 | |
swap 500 |
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
sub vcl_recv { | |
# unless sessionid/csrftoken is in the request, don't pass ANY cookies (referral_source, utm, etc) | |
if (req.request == "GET" && (req.url ~ "^/static" || (req.http.cookie !~ "sessionid" && req.http.cookie !~ "csrftoken"))) { | |
remove req.http.Cookie; | |
} | |
# normalize accept-encoding to account for different browsers | |
# see: https://www.varnish-cache.org/trac/wiki/VCLExampleNormalizeAcceptEncoding | |
if (req.http.Accept-Encoding) { | |
if (req.http.Accept-Encoding ~ "gzip") { |
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
""" | |
A decorator to bypass per-site cache if the user is authenticated. Based on django.views.decorators.cache.never_cache. | |
See: http://stackoverflow.com/questions/12060036/why-django-1-4-per-site-cache-does-not-work-correctly-with-cache-middleware-anon | |
""" | |
from django.utils.decorators import available_attrs | |
from django.utils.cache import add_never_cache_headers | |
from functools import wraps | |
def conditional_cache(view_func): |
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 -e | |
# this script may need to run with source to switch the virtualenv correctly, like this: $ source thisscript.sh | |
# gunicorn application has to be enabled in Django project | |
LOGFILE=/home/alexis/logs/yourtango_secret_weapon_development/gunicorn.log | |
LOGDIR=$(dirname $LOGFILE) | |
LOGLEVEL=debug | |
NUM_WORKERS=3 | |
BIND_ADDRESS=127.0.0.1:8002 |
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 -e | |
PROJECTDIR=/home/alexis/yourtango_secret_weapon_development | |
PROJECTENV=/home/alexis/.virtualenvs/x_YourTango_SecretWeapon_development | |
source $PROJECTENV/bin/activate | |
cd $PROJECTDIR | |
export LC_ALL="en_US.UTF-8" | |
export YTSW_DATABASES_DEFAULT_NAME_DEVELOPMENT="db_name" |
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
googletag.cmd.push(function() { | |
googletag.defineSlot('/7181/blogs/blog_celeblove', [[728, 90], [320, 50]], 'ad-leaderboard').addService(googletag.pubads()).setTargeting("nid", "174371").setTargeting("type", "blog").setTargeting("name-url", "2013174371/five-things-you-must-know-sundays-downton-abbey-finale"); | |
; | |
googletag.defineSlot('/7181/blogs/blog_celeblove', [[300, 250], [300, 600]], 'ad-atf').addService(googletag.pubads()).setTargeting("nid", "174371").setTargeting("type", "blog").setTargeting("name-url", "2013174371/five-things-you-must-know-sundays-downton-abbey-finale"); | |
googletag.defineSlot('/7181/blogs/blog_celeblove', [160, 600], 'ad-skyscraper').addService(googletag.pubads()).setTargeting("nid", "174371").setTargeting("type", "blog").setTargeting("name-url", "2013174371/five-things-you-must-know-sundays-downton-abbey-finale"); | |
googletag.defineSlot('/7181/blogs/blog_celeblove', [300, 100], 'ad-incontent').addService(googletag.pubads()).setTargeting("nid", "174371").setTargeting("type", "blog").setTa |
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
<script type="text/javascript"> | |
<!--//--><![CDATA[//><!-- | |
GlamCreateSlot("281100876", "728x90", "ad-leaderboard"); | |
GlamCreateSlot("281100876", "300x250", "ad-atf"); | |
GlamCreateSlot("281100876", "970x66", "ad-pushdown"); | |
GlamGetAds("281100876"); | |
//--><!]]> | |
</script> |
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
<section class="ad-atf"><div id="ad-atf"> | |
<script type="text/javascript"> | |
if (GlamIsAvailable('ad-atf')) { | |
GlamShow('ad-atf'); | |
} else { | |
googletag.cmd.push(function() { googletag.display('ad-atf'); }); | |
} | |
</script> | |
</div></section> |
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
if (drupal_is_front_page()) { | |
$canonical_url = $base_url . '/'; |
OlderNewer