Skip to content

Instantly share code, notes, and snippets.

View ericmagnuson's full-sized avatar
👋

Eric Magnuson ericmagnuson

👋
View GitHub Profile
@ericmagnuson
ericmagnuson / ResetWordPressPermissions.sh
Last active October 1, 2017 21:17
Reset WordPress Permissions
#!/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:
@ericmagnuson
ericmagnuson / upgradeAll.sh
Last active September 27, 2017 22:58
Vega Upgrades
#!/bin/bash
#
# Updates the entire system. Booyah.
set -e
start=`date +%s`
printf '%*s\n' '80' '' | tr ' ' =
printf "| Upgrades starting.\n"
# 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 \
@ericmagnuson
ericmagnuson / keybase.md
Created October 20, 2016 08:38
Keybase proof

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:

@ericmagnuson
ericmagnuson / README.md
Last active August 29, 2015 14:12 — forked from oodavid/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 August 29, 2015 14:12
LAMP Stack from Scratch
##############
# Basic LAMP #
##############
## Set root password (generate random password with `openssl rand -hex 5`)
passwd
## Update package sources
aptitude update
@ericmagnuson
ericmagnuson / ericm.zsh-theme
Created June 27, 2013 22:37
Oh My 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 April 13, 2017 22:53
How to build CartoDB 2.0 on Ubuntu 12.04
###################################
## CartoDB 2.0 Install [Working] ##
## Tested on Ubuntu 12.04 ##
###################################
# Change password
passwd
adduser [username]
adduser [username] sudo
@ericmagnuson
ericmagnuson / .htaccess
Last active March 29, 2021 01:00
Compiling and serving LESS on-the-fly with PHP & Apache
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule (.*\.min.css) less.php?min=yes&path=$1
RewriteRule (.*\.css) less.php?min=no&path=$1
</IfModule>