Includes:
- Configuration
- BrowserSync
- Environments (e.g.,:
--environment=production
) - Image optimization (gif, jpg, png, and svg)
- Sass compilation with external libraries
- Bower installed Sass libraries example(s)
- CSS processing with Pleeease
/usr/local/etc/nginx.conf | |
# GeoIP | |
geoip_country /usr/local/share/GeoIP/GeoIP.dat; # the country IP database | |
geoip_country /usr/local/share/GeoIP/GeoIPv6.dat; # the country IPv6 database | |
geoip_city /usr/local/share/GeoIP/GeoLiteCity.dat; # the city IP database | |
geoip_city /usr/local/share/GeoIP/GeoLiteCityv6.dat; # the city IPv6 database | |
geoip_org /usr/local/share/GeoIP/GeoIPASNum.dat; # the ASN IP database | |
geoip_org /usr/local/share/GeoIP/GeoIPASNumv6.dat; # the ASN IPv6 database |
mkdir /data | |
mkfs.ext4 -L data /dev/mmcblk0p1 | |
uci add fstab mount | |
uci set fstab.@mount[-1].device=/dev/mmcblk0p1 | |
uci set fstab.@mount[-1].target=/data | |
uci set fstab.@mount[-1].fstype=ext4 | |
uci set fstab.@mount[-1].options=rw,sync,noatime,nodiratime | |
uci set fstab.@mount[-1].enabled=1 |
#Configure ssh key autologin: | |
ssh-copy-id -i ~/.ssh/id_rsa [email protected] | |
uci set system.@system[0].hostname=gate | |
uci add_list sshd.@openssh[0].Port=2222 | |
uci add firewall rule | |
uci set firewall.@rule[-1].name=ssh | |
uci set firewall.@rule[-1].src=wan | |
uci set firewall.@rule[-1].target=ACCEPT |
Includes:
--environment=production
)location ~* ^/s3/(.*) { | |
set $bucket '<REPLACE WITH YOUR S3 BUCKET NAME>'; | |
set $aws_access '<REPLACE WITH YOUR AWS ACCESS KEY>'; | |
set $aws_secret '<REPLACE WITH YOUR AWS SECRET KEY>'; | |
set $url_full "$1"; | |
set_by_lua $now "return ngx.cookie_time(ngx.time())"; | |
set $string_to_sign "$request_method\n\n\n\nx-amz-date:${now}\n/$bucket/$url_full"; | |
set_hmac_sha1 $aws_signature $aws_secret $string_to_sign; | |
set_encode_base64 $aws_signature $aws_signature; |
The MySQL slow query log is a difficult format to extract information from. After looking at various examples with mixed results, I realized that it's much easier to configure MySQL to write the slow query log to a table in CSV format!
From the MySQL documentation:
By default, the log tables use the CSV storage engine that writes data in comma-separated values format. For users who have access to the .CSV files that contain log table data, the files are easy to import into other programs such as spreadsheets that can process CSV input.
Note: don't forget to open up permissions on your slow query log CSV file so logstash can read it!
# enable slow query log
// change your piwik server host | |
// change YOUR_SITE_ID with your site id | |
<amp-pixel src="https://piwik.example.org/piwik.php?idsite=YOUR_SITE_ID&rec=1&action_name=TITLE&urlref=DOCUMENT_REFERRER&url=CANONICAL_URL&rand=RANDOM"></amp-pixel> |
global | |
#debug | |
chroot /var/lib/haproxy | |
user haproxy | |
group haproxy | |
pidfile /var/run/haproxy.pid | |
# Default SSL material locations | |
ca-base /etc/ssl/certs | |
crt-base /etc/ssl/private |
kind: Ingress | |
apiVersion: extensions/v1beta1 | |
metadata: | |
name: redirect-ingress | |
annotations: | |
ingress.kubernetes.io/configuration-snippet: | | |
if ($host ~ ^(.+)\.somedomain\.io$) { | |
return 301 https://$1.domain.io$request_uri; | |
} | |
spec: |
data "template_file" "main" { | |
template = <<EOF | |
set -e | |
WORKDIR=/tmp/${uuid()} | |
mkdir -p "$WORKDIR" | |
cd "$WORKDIR" | |
curl -f "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
unzip awscli-bundle.zip | |
./awscli-bundle/install -i "$WORKDIR"/aws |