Skip to content

Instantly share code, notes, and snippets.

View pauloelias's full-sized avatar

Paulo Elias pauloelias

View GitHub Profile
@pauloelias
pauloelias / .gitignore
Created July 17, 2012 12:14
.gitignore – Ignore all files in dir. Useful for quickly adding empty directories (E.G. cache directories etc. but ignoring dirs/files underneath)
# Ignore everything in this directory
*
# Except this file
!.gitignore
@pauloelias
pauloelias / bulk-rename-delete.sh
Created July 17, 2012 12:20
Bulk rename/delete
# Review the offending files.
find /path/to/files -name '*:*' -print
# Delete the offending files.
find /path/to/files -name '*:*' -exec rm {} +
# Rename the offending files with an underscore.
find /path/to/files -name '*:*' -exec rename ':' '_' {} +
# For a more efficient version of delete some UNIX variants support (this avoids the need to fork and exec /bin/rm for every single matching file).
@pauloelias
pauloelias / mamp-mysql-import.sh
Created July 17, 2012 12:34
MAMP MySQL DB Import
/Applications/MAMP/Library/bin/mysql -u root -p cli_database < /path/to/cli_dump.sql
@pauloelias
pauloelias / wget-mirror-site.sh
Last active October 7, 2015 10:08
Mirror a site with wget
# http://www.gnu.org/software/wget/manual/wget.html
# OPTIONS: -m mirror, -k convert-links, -w delay (in seconds) between requests
wget -mk -w1 http://domain.tld/
@pauloelias
pauloelias / eecms_variable_prefixes.txt
Created August 5, 2012 18:44
EECMS Variable Prefixes
Variable prefixes are handy:
cf_ = custom field
sn_ = snippet
gv_= global variable
pr_ = preload replace
category_ = category custom
@pauloelias
pauloelias / _SIMPLE.htaccess
Created August 23, 2012 16:51
Simple ExpressionEngine .htaccess
# Standard ExpressionEngine Apache Configuration (.htaccess)
# httpd.apache.org/docs/2.2/mod/quickreference.html
# ------------------------------
# SECURITY: Secure "dot" files/directories
# ------------------------------
# Block access to "hidden" directories or files whose names begin with a
# period. This includes directories used by version control systems such as
# Subversion or Git.
# <IfModule mod_rewrite.c>
@pauloelias
pauloelias / .htaccess
Created August 24, 2012 03:32 — forked from MaxLazar/.htaccess
ExpressionEngine .htaccess template
# Standard .htaccess file
# Secure .htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# Don't show any directory without an index file
Options -Indexes
@pauloelias
pauloelias / ExpressionEngine "Edit This" Link
Last active December 28, 2017 17:49
ExpressionEngine "Edit Entry" link. Place this in your channel entries output to provide a direct link to edit the entry in the control panel.
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="/apple-touch-icon-152.png">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144.png">
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="/apple-touch-icon-120.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/apple-touch-icon-114.png">
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="/apple-touch-icon-76.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/apple-touch-icon-72.png">
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="/apple-touch-icon-60.png">
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="/apple-touch-icon-57.png">
<link rel="apple-touch-startup-image" href="/apple_startup_image.png">
<link rel="icon" type="image/png" href="/favicon-16.png" sizes="16x16">
@pauloelias
pauloelias / README.md
Created August 23, 2012 16:57
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).