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/sh | |
# Usage 1: | |
# optimize-images.sh /images/dir | |
# | |
# Usage 2: | |
# cd /images/dir | |
# optimize-images.sh | |
EXTENSIONS="jpe?g" |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
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 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 | |
PROGNAME=${0##*/} | |
INPUT='' | |
QUIET='0' | |
NOSTATS='0' | |
max_input_size=0 | |
max_output_size=0 | |
usage() |
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
# /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 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 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
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
# Controls source route verification | |
net.ipv4.conf.default.rp_filter = 1 | |
# Do not accept source routing | |
net.ipv4.conf.default.accept_source_route = 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
# 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) |
NewerOlder