Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Longren tlongren

View GitHub Profile
View flash-all.sh
#!/bin/sh
# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
View flash-all.sh
#!/bin/sh
# Copyright 2012 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@tlongren
tlongren / output.txt
Created Aug 19, 2020
Payton Blankflash Success
View output.txt
tyler:blankflash/ $ sudo ./qboot blank-flash $* [3:09:51]
Motorola qboot utility version 3.86
[ 0.000] Opening device: /dev/ttyUSB0
[ 0.000] Detecting device
[ 0.003] ...cpu.id = 172 (0xac)
[ 0.003] ...cpu.sn = 1271461894 (0x4bc8f806)
[ 0.003] Opening singleimage
[ 0.199] Loading package
[ 0.210] ...filename = pkg.xml
[ 0.216] Loading programmer
View a-coming-soon-page.markdown

A "Coming Soon" page

Place this as a temporary homepage for visitors to know that your website is under construction.

A Pen by Ompmega on CodePen.

License.

View dashboard.yml
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 3 columns:
- rows:
- h3 text: Bananas
- pie chart: {
"columns": [
["Protein", 5], ["Sugar", 10], ["Other carbs", 40], ["Fat", 1]
]
@tlongren
tlongren / tinify.sh
Created Sep 28, 2017
Bash script to tinify images in a folder using the TinyPNG API
View tinify.sh
#!/bin/bash
TINYAPIKEY="YOUR_API_KEY"
# Make sure source dir is supplied
if [ -z "$1" ]
then
echo "Missing argument. Supply the source directory containing the images to be optimized. Usage: ./tiny.sh <source_dir>"
exit 1
fi
@tlongren
tlongren / backup.sh
Last active Sep 21, 2017
Quick & easy remote backups
View backup.sh
#!/bin/sh
SERVER=backup.server.com
rsync -avz --partial --delete --bwlimit=25 --progress --stats -e ssh
/opt/backups tyler@$SERVER:/home/tyler/
@tlongren
tlongren / dockerize-meteor-app.sh
Last active Jun 11, 2019
Dockerize a Meteor App
View dockerize-meteor-app.sh
#!/bin/bash
# Taken from https://blog.mvp-space.com/how-to-dockerize-a-meteor-app-with-just-one-script-4bccb26f6ff0
APP_NAME=myapp
APP_DOMAIN=localhost
APP_PORT=3000
SETTINGS_PATH=.config/staging/settings.json
MONGO_URL=localhost
MONGO_PORT=27017
MONGO_DB=myappdb
@tlongren
tlongren / compression-minify-wordpress.md
Last active May 6, 2019
Output Compression, Browser Caching, Asset Minification and Image Optimization for WordPress
View compression-minify-wordpress.md

Output Compression, Browser Caching, Asset Minification and Image Optimization

The following apache and nginx configurations will handle compression and browser caching. A few different WordPress plugins can be used for asset minification.

mod-pagespeed may be available for configuration as an apache or nginx module. If available, there's no need to use the individual apache or nginx configurations. Mod-pagespeed will handle compression and browser caching, making the apache and nginx configurations unnecessary. The WordPress plugins are still needed for asset minification as they ensure assets are loaded in the proper order once minified.

Image optimization should be done using the EWWW Image Optimizer plugin.

Apache Config

Output Compression

View wordpress-hardening-techniques.md

Hardening WordPress

Securing WordPress using a combination of configuration changes and plugins.

.htaccess and wp-config.php tasks

1. Add keys to wp-config.php

2. Hide .htaccess and wp-config.php