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
| C{ | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <pthread.h> | |
| static pthread_mutex_t lrand_mutex = PTHREAD_MUTEX_INITIALIZER; | |
| void generate_uuid(char* buf) { | |
| pthread_mutex_lock(&lrand_mutex); | |
| long a = lrand48(); | |
| long b = lrand48(); |
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
| # Setup var defaults | |
| set $no_cache ""; | |
| # If non GET/HEAD, don't cache & mark user as uncacheable for X second(s) via cookie | |
| if ($request_method !~ ^(GET|HEAD)$) { | |
| set $no_cache "1"; | |
| } | |
| # Drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block) | |
| if ($no_cache = "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
| # /etc/nginx/sites-enabled/magento | |
| server { | |
| listen 80; | |
| server_name ec2-184-72-68-219.compute-1.amazonaws.com; | |
| root /var/www/magento/; | |
| access_log /var/log/nginx/magento-access_log; | |
| error_log /var/log/nginx/magento-error_log; | |
| location / { |
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
| # Set cache dir | |
| proxy_cache_path /var/cache/nginx levels=1:2 | |
| keys_zone=microcache:5m max_size=1000m; | |
| # Virtualhost/server configuration | |
| server { | |
| listen 80; | |
| server_name yourhost.domain.com; | |
| # Define cached location (may not be whole site) |
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
| Manual and upstart config for AeroFS (aerofs-cli) on Ubuntu 12.04.1 LTS: | |
| # link standard upstart script | |
| cd /etc/init.d | |
| sudo ln -s /lib/init/upstart-job aerofs-cli | |
| # create upstart config for aerofs-cli | |
| sudo nano /etc/init/aerofs-cli.conf | |
| (replace andreas with your desired runtime user) | |
| ---- |
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
| # A heavily customized VCL to support WordPress | |
| # Some items of note: | |
| # Supports https | |
| # Supports admin cookies for wp-admin | |
| # Caches everything | |
| # Support for custom error html page | |
| vcl 4.0; | |
| import directors; | |
| import std; |
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/sh | |
| # Usage 1: | |
| # optimize-images.sh /images/dir | |
| # | |
| # Usage 2: | |
| # cd /images/dir | |
| # optimize-images.sh | |
| EXTENSIONS="jpe?g" |
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
| // --- Compiling --- | |
| $ wget http://download.redis.io/releases/redis-2.8.3.tar.gz | |
| $ tar xzvf redis-2.8.3.tar.gz | |
| $ cd redis-2.8.3 | |
| $ make | |
| $ make install | |
| // --- or using yum --- | |
| $ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
| $ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm |
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
| [Unit] | |
| Description=Disable Transparent Huge Pages (THP) | |
| DefaultDependencies=no | |
| After=sysinit.target local-fs.target | |
| Before=mongod.service | |
| [Service] | |
| Type=oneshot | |
| ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null' |
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
| ; Enable APCu extension module | |
| extension = apcu.so | |
| ; This can be set to 0 to disable APCu | |
| apc.enabled=1 | |
| ; Setting this enables APCu for the CLI version of PHP | |
| ; (Mostly for testing and debugging). | |
| ;apc.enable_cli=0 |
OlderNewer