Skip to content

Instantly share code, notes, and snippets.

Eric Magnuson ericmagnuson

View GitHub Profile
@ericmagnuson
ericmagnuson / ResetWordPressPermissions.sh
Last active Oct 1, 2017
Reset WordPress Permissions
View ResetWordPressPermissions.sh
#!/bin/bash
#
# Written by Michael Conigliaro <mike@conigliaro.org>
# Updated by Eric Magnuson <eric@ericmagnuson.me>
# MIT License (http://opensource.org/licenses/MIT)
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Instructions:
View upgradeAll.sh
#!/bin/bash
#
# Updates the entire system. Booyah.
set -e
start=`date +%s`
printf '%*s\n' '80' '' | tr ' ' =
printf "| Upgrades starting.\n"
View a-snappier-dock.sh
# To remove the autohide delay and speed up the transition, run this in Terminal:
defaults write com.apple.dock autohide -bool true \
&& defaults write com.apple.dock autohide-delay -float 0 \
&& defaults write com.apple.dock autohide-time-modifier -float 0.3 \
&& killall Dock
# To revert back to default settings, run this:
defaults delete com.apple.dock autohide \
&& defaults delete com.apple.dock autohide-delay \
&& defaults delete com.apple.dock autohide-time-modifier \
View keybase.md

Keybase proof

I hereby claim:

  • I am ericmagnuson on github.
  • I am ericmagnuson (https://keybase.io/ericmagnuson) on keybase.
  • I have a public key ASBU4q9_ew1yvWQ3h1xX1IxVnqlF6eDgke21TY6k1oA3Ygo

To claim this, I am signing this object:

View README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@ericmagnuson
ericmagnuson / lamp_setup.sh
Last active Aug 29, 2015
LAMP Stack from Scratch
View lamp_setup.sh
##############
# Basic LAMP #
##############
## Set root password (generate random password with `openssl rand -hex 5`)
passwd
## Update package sources
aptitude update
View ericm.zsh-theme
# Preview available at http://eri.cm/PRL
function get_pwd() {
echo "${PWD/$HOME/~}"
}
PROMPT='%{$fg_bold[white]%}☁ %{$fg_bold[cyan]%} %{$fg[yellow]%}$(get_pwd)%{$fg_bold[cyan]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$fg_bold[white]%}→%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}%{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
@ericmagnuson
ericmagnuson / cartodb20_build.sh
Last active Apr 13, 2017
How to build CartoDB 2.0 on Ubuntu 12.04
View cartodb20_build.sh
###################################
## CartoDB 2.0 Install [Working] ##
## Tested on Ubuntu 12.04 ##
###################################
# Change password
passwd
adduser [username]
adduser [username] sudo
@ericmagnuson
ericmagnuson / .htaccess
Last active Oct 24, 2017
Compiling and serving LESS on-the-fly with PHP & Apache
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*\.min.css) less.php?min=yes&path=$1
RewriteRule (.*\.css) less.php?min=no&path=$1
</IfModule>
You can’t perform that action at this time.